From 80dd80f38b8028cf888412271ea2ca6332211e32 Mon Sep 17 00:00:00 2001 From: Valentin Vidic Date: Thu, 6 Nov 2008 10:26:48 +0100 Subject: [PATCH] Make doc and src use the version from changelog. --- .gitignore | 1 + debian/rules | 14 ++++++++++++-- doc/{carnet-upgrade.sgml => carnet-upgrade-src.sgml} | 2 +- src/cn-upgrade | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) rename doc/{carnet-upgrade.sgml => carnet-upgrade-src.sgml} (99%) diff --git a/.gitignore b/.gitignore index a903ecd..36b2ca7 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ debian/files doc/carnet-upgrade.html doc/carnet-upgrade.pdf doc/carnet-upgrade.txt +doc/carnet-upgrade.sgml diff --git a/debian/rules b/debian/rules index 9beafcd..b7a9059 100755 --- a/debian/rules +++ b/debian/rules @@ -14,12 +14,17 @@ ifeq ($(wildcard /usr/share/perl5/DebianDoc_SGML/Locale/hr_HR.UTF-8),) perlenv = PERL5LIB=../debian/perl5 endif +PKG_VERSION = $(shell dpkg-parsechangelog|sed -n 's/^Version: \(.*:\|\)//p') build: build-stamp -build-stamp: doc/carnet-upgrade.sgml +build-stamp: doc/carnet-upgrade-src.sgml dh_testdir + # Update package version in documentation + sed -e 's/%PKG_VERSION%/$(PKG_VERSION)/g' doc/carnet-upgrade-src.sgml \ + > doc/carnet-upgrade.sgml + # Build txt docs (cd doc; $(perlenv) debiandoc2text -l hr_HR.UTF-8 carnet-upgrade.sgml) @@ -44,7 +49,7 @@ clean: rm -f build-stamp # Clean up after the build process. - rm -rf doc/carnet-upgrade.{txt,html,pdf,tpt} + rm -rf doc/carnet-upgrade.{txt,html,pdf,tpt,sgml} dh_clean @@ -64,6 +69,11 @@ binary-indep: build install dh_installdocs dh_installexamples dh_install + # Update package version in source + sed -i -e 's/%PKG_VERSION%/$(PKG_VERSION)/g' \ + debian/carnet-upgrade/usr/share/carnet-upgrade/cn-upgrade + # Remove documentation template + rm -f debian/carnet-upgrade/usr/share/doc/carnet-upgrade/carnet-upgrade-src.sgml # dh_installmenu dh_installdebconf # dh_installlogrotate diff --git a/doc/carnet-upgrade.sgml b/doc/carnet-upgrade-src.sgml similarity index 99% rename from doc/carnet-upgrade.sgml rename to doc/carnet-upgrade-src.sgml index 44a615a..f12c44f 100644 --- a/doc/carnet-upgrade.sgml +++ b/doc/carnet-upgrade-src.sgml @@ -8,7 +8,7 @@ Grupa za izradu paketa paketi@carnet.hr - Verzija 4.0.6 + Verzija %PKG_VERSION% CARNet Debian etch je treća generacija CARNet Debian diff --git a/src/cn-upgrade b/src/cn-upgrade index 778b6ba..4c53764 100755 --- a/src/cn-upgrade +++ b/src/cn-upgrade @@ -2,7 +2,7 @@ # last update: 2005-01-07 # Zoran 'jelly' Dzelajlija # Ivan 'ico' Rako -version="4.0.6" +version="%PKG_VERSION%" # restart upgrade under script for logging purposes if [ "$1" == "--no-script" ]; then -- 1.7.10.4