summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorDmitry Smirnov <onlyjob@member.fsf.org>2013-08-04 05:15:07 +1000
committerDmitry Smirnov <onlyjob@member.fsf.org>2013-08-04 05:15:07 +1000
commitddd4108335058ed89728c88c67af9b4142c5f336 (patch)
tree1aab8a44577a589aa71c9f85cfa2edbbb5235b1e /debian
parentXS-Autobuild: yes (diff)
downloadd2x-rebirth-ddd4108335058ed89728c88c67af9b4142c5f336.tar.gz
d2x-rebirth-ddd4108335058ed89728c88c67af9b4142c5f336.tar.bz2
d2x-rebirth-ddd4108335058ed89728c88c67af9b4142c5f336.zip
reference get-orig-source implementation
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