#!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed export DEB_BUILD_MAINT_OPTIONS = hardening=+all %: dh $@ PKD = $(abspath $(dir $(MAKEFILE_LIST))) PKG = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source)) VER ?= $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\-\d+.*)};') get-orig-source: $(PKG)_$(VER).orig.tar.gz $(info I: $(PKG)_$(VER)) @ $(PKG)_$(VER).orig.tar.gz: @echo "# Downloading..." rm -rf $(PKG)-$(VER) git clone git://github.com/raboof/sfarkxtc.git $(PKG)-$(VER) cd $(PKG)-$(VER) \ && git checkout `echo $(VER) | perl -pe 's/[\d\.]+?[\+~]\d\d\d\d\d\d\d\dgit(\w\w\w\w\w\w\w)/\1/'` \ && $(RM) -rf .git .gitignore .travis.yml @echo "# Packing..." find -L "$(PKG)-$(VER)" -xdev -type f -print | sort \ | GZIP=-9n tar -czvf "$(PKG)_$(VER).orig.tar.gz" -T- --owner=root --group=root --mode=a+rX \ && $(RM) -rf "$(PKG)-$(VER)"