summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
Diffstat (limited to 'debian')
-rwxr-xr-xdebian/rules12
1 files 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 \
bgstack15