#!/usr/bin/make -f NULL = PKD = $(word 1, $(abspath $(dir $(MAKEFILE_LIST)))) PKG = $(DEB_SOURCE) UVER = $(shell echo $(DEB_VERSION) | cut -d "-" -f1) DTYPE = +dfsg1 VER ?= $(subst $(DTYPE),,$(UVER)) %: dh $@ --with phpcomposer .PHONY: get-orig-source get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz $(info I: $(PKG)_$(VER)$(DTYPE)) @ $(PKG)_$(VER)$(DTYPE).orig.tar.xz: @echo "# Downloading..." uscan --noconf --verbose --rename --destdir=$(CURDIR) --check-dirname-level=0 --force-download --download-version $(VER) $(PKD) $(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..)) @echo "# Extracting..." mkdir $(PKG)-$(VER) \ && tar -xf $(PKG)_$(VER).orig.tar.* --directory $(PKG)-$(VER) --strip-components 1 \ || $(RM) -r $(PKG)-$(VER) @echo "# Cleaning-up..." cd $(PKG)-$(VER) \ && $(RM) -r -v \ Exception.php \ $(NULL) $(RM) -v $(PKG)_$(VER).orig.tar.* @echo "# Packing..." find -L "$(PKG)-$(VER)" -xdev -type f -print | LC_ALL=C sort \ | XZ_OPT="-6v" tar -caf "../$(PKG)_$(VER)$(DTYPE).orig.tar.xz" -T- --owner=root --group=root --mode=a+rX \ && $(RM) -r "$(PKG)-$(VER)" # uscan --noconf --force-download --rename --download-current-version --destdir=..