#!/usr/bin/make -f include /usr/share/dpkg/pkg-info.mk #export DH_VERBOSE=1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed %: dh $@ PKD = $(abspath $(dir $(MAKEFILE_LIST))) PKG = $(DEB_SOURCE) UVER = $(DEB_VERSION_UPSTREAM) REV = $(shell echo $(VER) | perl -ne 'print "$$1" if m/(?:git|svn|hg)(\d+)/;') VER ?= $(subst $(DTYPE),,$(UVER)) UURL = svn://svn.code.sf.net/p/avarice/code/trunk UPVER = $(shell echo $(VER) | sed 's/+.*$$//' ) .PHONY: get-orig-source get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz echo $(info I: $(PKG)_$(VER)) @ $(PKG)_$(VER).orig.tar.xz: echo $(info I: REV=$(REV) UPVER=$(UPVER)) $(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..)) svn checkout --config-option config:miscellany:use-commit-times=yes -r $(REV) \ $(UURL) $(PKG)-$(VER) || $(RM) -r $(PKG)-$(VER) @echo "Clean-up..." cd $(PKG)-$(VER)/avarice \ && find . -depth -name ".svn" -exec $(RM) -r '{}' \; \ && ./Bootstrap && ./configure && make dist-xz @echo "# Packing..." find "$(PKG)-$(VER)/avarice/" -name avarice-$(UPVER)svn*.xz -exec mv '{}' "$(PKG)_$(VER).orig.tar.xz" \; \ && $(RM) -r "$(PKG)-$(VER)"