From ddd4108335058ed89728c88c67af9b4142c5f336 Mon Sep 17 00:00:00 2001 From: Dmitry Smirnov Date: Sun, 4 Aug 2013 05:15:07 +1000 Subject: reference get-orig-source implementation --- debian/rules | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/debian/rules b/debian/rules index b0d98bd..fd15757 100755 --- a/debian/rules +++ b/debian/rules @@ -39,17 +39,19 @@ override_dh_installchangelogs: override_dh_builddeb: dh_builddeb -- -Zxz -DPATH := $(abspath $(dir $(MAKEFILE_LIST))) -PKG := $(word 2,$(shell dpkg-parsechangelog -l$(DPATH)/changelog | grep ^Source)) -VER ?= $(shell dpkg-parsechangelog -l$(DPATH)/changelog | perl -ne 'print $$1 if m{Version:\s*([\d\.]+)}') +## http://wiki.debian.org/onlyjob/get-orig-source +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\.]+)}') +DTYPE = +repack .PHONY: get-orig-source -DTYPE := +repack get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz @ $(PKG)_$(VER)$(DTYPE).orig.tar.xz: @echo "# Downloading..." - uscan --noconf --verbose --rename --destdir=$(CURDIR) --check-dirname-level=0 --force-download --download-version $(VER) $(DPATH) + 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 \ -- cgit