1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
%:
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/+.*$$//' )
# get-orig-source is kept because upstream only makes releases rarely.
# The usual source of the orig.tar is the upstream SVN.
.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)"
|