From 3349162e16183bf52e59082138c63fde18b4cfb8 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 21 Aug 2012 23:01:00 +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/csc.pm | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 9033867..aecbebc 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/csc.pm || \ + (echo "Wrong version in lib/csc.pm" && exit 2) mkdir -p pro/etc/ngcp-www-csc pro/etc/apache2/sites-available mkdir -p ce/etc/ngcp-www-csc ce/etc/apache2/sites-available tpage --define PRO=true etc/csc.conf > pro/etc/ngcp-www-csc/csc.conf.tt2 @@ -44,6 +47,7 @@ ngcp-www-csc: 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-csc/lib/csc.pm dh_installexamples -p$@ -P$(b)/$@ dh_installman -p$@ -P$(b)/$@ dh_link -p$@ -P$(b)/$@ diff --git a/lib/csc.pm b/lib/csc.pm index 4adf5c7..cfb155b 100644 --- a/lib/csc.pm +++ b/lib/csc.pm @@ -21,7 +21,7 @@ use Catalyst qw/ConfigLoader Static::Simple Unicode I18N Session Session::Store::FastMmap Session::State::Cookie /; -our $VERSION = '3'; +our $VERSION = 'UNRELEASED'; # Configure the application. #