Make doc and src use the version from changelog.
authorValentin Vidic <Valentin.Vidic@CARNet.hr>
Thu, 6 Nov 2008 09:26:48 +0000 (10:26 +0100)
committerValentin Vidic <Valentin.Vidic@CARNet.hr>
Thu, 6 Nov 2008 09:26:48 +0000 (10:26 +0100)
.gitignore
debian/rules
doc/carnet-upgrade-src.sgml [moved from doc/carnet-upgrade.sgml with 99% similarity]
src/cn-upgrade

index a903ecd..36b2ca7 100644 (file)
@@ -8,3 +8,4 @@ debian/files
 doc/carnet-upgrade.html
 doc/carnet-upgrade.pdf
 doc/carnet-upgrade.txt
+doc/carnet-upgrade.sgml
index 9beafcd..b7a9059 100755 (executable)
@@ -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
similarity index 99%
rename from doc/carnet-upgrade.sgml
rename to doc/carnet-upgrade-src.sgml
index 44a615a..f12c44f 100644 (file)
@@ -8,7 +8,7 @@
         <name>Grupa za izradu paketa</name>
         <email>paketi@carnet.hr</email>
       </author>
-      <version>Verzija 4.0.6</version>
+      <version>Verzija %PKG_VERSION%</version>
 
       <abstract>
         CARNet Debian <em>etch</em> je treća generacija CARNet Debian
index 778b6ba..4c53764 100755 (executable)
@@ -2,7 +2,7 @@
 # last update: 2005-01-07
 # Zoran 'jelly' Dzelajlija <jelly@srce.hr>
 # Ivan 'ico' Rako <irako@srce.hr>
-version="4.0.6"
+version="%PKG_VERSION%"
 
 # restart upgrade under script for logging purposes
 if [ "$1" == "--no-script" ]; then