From 545d1076eaa077a36a86aaa9b5db2a752f307afe Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 21 Aug 2012 23:29:42 +0000 Subject: [PATCH] Adjust VERSION string on the fly during package build Adjusting version strings manually is known to be error prone and annoying, so lets set the version string during package builds so the version matches exactly the Debian package version. Acked-by: Daniel Tiefnig From: Michael Prokop --- debian/rules | 4 ++++ lib/admin.pm | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 4a973de..7fcdebb 100755 --- a/debian/rules +++ b/debian/rules @@ -10,11 +10,14 @@ # export DH_VERBOSE=1 b=$(CURDIR)/debian/build +VERSION:=$(shell dpkg-parsechangelog | awk '/Version: / { print $$2 }') build: build-stamp build-stamp: dh_testdir + egrep -q "VERSION = 'UNRELEASED'" lib/admin.pm || \ + (echo "Wrong version in lib/csc.pm" && exit 2) mkdir -p pro/etc/ngcp-www-admin pro/etc/apache2/sites-available mkdir -p ce/etc/ngcp-www-admin ce/etc/apache2/sites-available tpage --define PRO=true etc/admin.conf > pro/etc/ngcp-www-admin/admin.conf.tt2 @@ -44,6 +47,7 @@ ngcp-www-admin: dh_installdocs -p$@ -P$(b)/$@ dh_installchangelogs -p$@ -P$(b)/$@ dh_install -p$@ -P$(b)/$@ + sed -i -e "s/VERSION = 'UNRELEASED'/VERSION = '$(VERSION)'/" $(b)/$@/usr/share/ngcp-www-admin/lib/admin.pm dh_installexamples -p$@ -P$(b)/$@ dh_installman -p$@ -P$(b)/$@ # drop svn files: diff --git a/lib/admin.pm b/lib/admin.pm index e2fac7c..2f0814d 100644 --- a/lib/admin.pm +++ b/lib/admin.pm @@ -21,7 +21,7 @@ use Catalyst qw/-Debug ConfigLoader Static::Simple Unicode Session Session::Store::FastMmap Session::State::Cookie /; -our $VERSION = '3'; +our $VERSION = 'UNRELEASED'; # Configure the application. #