The following commit has been merged in the master branch:
commit fdd9a6cf457e10e13d262e285d11d7f2a55da0a9
Author: Pierre Blanc <pierreblan...@gmail.com>
Date:   Wed Oct 16 11:44:50 2013 +0200

    Add get-orig-source rule

diff --git a/debian/rules b/debian/rules
index 41d4697..5d281f0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,8 +5,38 @@
 #export DH_VERBOSE=1
 export DEB_BUILD_HARDENING=1
 
-DPKG_EXPORT_BUILDFLAGS = 1
-include /usr/share/dpkg/buildflags.mk
+CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
+CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
+CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
+LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
+
+PKD  = $(abspath $(dir $(MAKEFILE_LIST)))
+PKG  = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source))
 
 %:
        dh $@ --with autoreconf
+
+## http://wiki.debian.org/onlyjob/get-orig-source
+VER ?= $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if 
m{^Version:\s+(?:\d+:)?(\d.*)(?:\-\d+.*)};')
+.PHONY: get-orig-source
+get-orig-source: $(PKG)_$(VER).orig.tar.xz
+       @
+
+UURL = git://gitorious.org/osm-c-tools/osmctools.git
+$(PKG)_$(VER).orig.tar.xz:
+       $(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..))
+       @echo "# Downloading..."
+       git clone $(UURL) $(PKG)-$(VER) \
+        || $(RM) -r $(PKG)-$(VER)
+       cd $(PKG)-$(VER) \
+        && git checkout v$(VER) \
+        && echo "# Setting times..." \
+        && for F in $$(git ls-tree -r --name-only HEAD); do touch 
--no-dereference -d "$$(git log -1 --format="%ai" -- $$F)" "$$F"; done \
+        && [ -s ChangeLog ] || ( echo "# Generating ChangeLog..." \
+           ; git log --pretty="format:%ad  %aN  <%aE>%n%n%x09* %s%n" 
--date=short > ChangeLog \
+           ; touch -d "$$(git log -1 --format='%ci')" ChangeLog) \
+        && $(RM) -r .git .git*
+       @echo "# Packing..."
+       find -L "$(PKG)-$(VER)" -xdev -type f -print | sort \
+        | XZ_OPT="-6v" tar -caf "$(PKG)_$(VER).orig.tar.xz" -T- --owner=root 
--group=root --mode=a+rX \
+        && $(RM) -r "$(PKG)-$(VER)"

-- 
Some tools to manipulate OpenStreetMap files

_______________________________________________
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel

Reply via email to