add a prebuild target for use from git-buildpackage clean hook, that creates
[fw/altos] / debian / rules
index b81278a156de9ca1c288feb5caf604580d831496..d576ab32acb9d339a8a162e1ee5e12a95fa07937 100755 (executable)
@@ -2,6 +2,12 @@
 # -*- makefile -*-
 
 export DH_VERBOSE=1
+PKG_VERSION := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p'| sed 's/+dfsg//')
+
+# this target invoked by git-buildpackage using a clean hook, see .gbp.conf
+prebuild:
+       dch -v `git describe | tr - +` "build for Debian from git"
+       git commit debian/changelog -m "update Debian changelog for build"
 
 configure: configure-stamp
 configure-stamp:
@@ -13,7 +19,7 @@ build: build-stamp
 
 build-stamp: configure-stamp  
        dh_testdir
-       $(MAKE)
+       $(MAKE) VERSION=$(PKG_VERSION)
        touch $@
 
 clean: