debian: Generate version from debian/changelog
authorDavid Bremner <bremner@debian.org>
Tue, 21 Jun 2011 12:03:19 +0000 (09:03 -0300)
committerDavid Bremner <bremner@debian.org>
Wed, 22 Jun 2011 11:11:54 +0000 (08:11 -0300)
This avoids patching the version file once per Debian upload.
Original version file is saved and restored.
(cherry picked from commit 2938a98bf4c4abe0426caee4555d889d655bc0df)

debian/rules

index a4b526c1a148b4c23c274d68f2fd0e47432e5241..985fbc5ff05946e320f36c6bc50b3d3c8b22f146 100755 (executable)
@@ -1,11 +1,18 @@
 #!/usr/bin/make -f
 
+VERSION=$(shell dpkg-parsechangelog | sed -n 's/^Version:\([^-]*\)/\1/p')
+
 %:
        dh $@
 
 override_dh_auto_configure:
+       cp version debian/version.pre-build
+       echo $(VERSION) > version
        dh_auto_configure -- --emacslispdir=/usr/share/emacs/site-lisp/notmuch
 
+override_dh_auto_clean:
+       -mv debian/version.pre-build version
+       dh_auto_clean
 override_dh_installdocs:
        dh_installdocs
        install -m644 vim/README debian/notmuch/usr/share/doc/notmuch/README.vim