From 3a2286f874b17e06c2ab2271135117953f284530 Mon Sep 17 00:00:00 2001 From: kytv Date: Wed, 4 Jan 2012 00:57:54 +0000 Subject: [PATCH] Debian: EXTRA is now assigned dymanically Before there was a patch to add the -deb1 to the RouterVersion.java file, but it needed me to update the deb#. With my newly budding regex skills, I'm now manipulating it using sed and determining the number according to the debian version number. --- debian/patches/debian-version.patch | 13 ------------- debian/patches/series | 1 - debian/rules | 10 +++++++++- 3 files changed, 9 insertions(+), 15 deletions(-) delete mode 100644 debian/patches/debian-version.patch diff --git a/debian/patches/debian-version.patch b/debian/patches/debian-version.patch deleted file mode 100644 index 5aa0a862a..000000000 --- a/debian/patches/debian-version.patch +++ /dev/null @@ -1,13 +0,0 @@ -Add debian package vesion to the EXTRA version field - ---- a/router/java/src/net/i2p/router/RouterVersion.java -+++ b/router/java/src/net/i2p/router/RouterVersion.java -@@ -21,7 +21,7 @@ - public final static long BUILD = 0; - - /** for example "-test" */ -- public final static String EXTRA = ""; -+ public final static String EXTRA = "deb1"; - public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA; - public static void main(String args[]) { - System.out.println("I2P Router version: " + FULL_VERSION); diff --git a/debian/patches/series b/debian/patches/series index 530acf515..a289a6ae1 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,4 +1,3 @@ 0001-path-substitution.patch 0002-jbigi-soname.patch 0003-renaming-jcpuid.patch -debian-version.patch diff --git a/debian/rules b/debian/rules index f127e1b25..34c804eef 100755 --- a/debian/rules +++ b/debian/rules @@ -26,7 +26,12 @@ build: JAVA_HOME=/usr/lib/jvm/default-java I2P=$(CURDIR)/pkg-temp +ROUTERVERSION=$(CURDIR)/router/java/src/net/i2p/router/RouterVersion.java + +# I2P's version will be displayed in the router console as "$I2PVERSION-$EXTRAPREFIX$DEBIANVERSION", eg. 0.8.12-0-deb1 +export EXTRAPREFIX := deb export JAVA_HOME I2P +export DEBIANVERSION := $(shell dpkg-parsechangelog |awk -F' ' '/Version/{print $$2}' |sed 's/.*-\([[:digit:]]\{1,\}\).*$$/\1/') #export DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) %: @@ -35,6 +40,7 @@ export JAVA_HOME I2P clean: createcopyright override_dh_auto_clean: + -[ -r $(CURDIR)/debian/routerversion.java.bak ] && mv -f $(CURDIR)/debian/routerversion.java.bak $(ROUTERVERSION) dh_auto_clean ant distclean # The next line is used by KYTV when building from source packages @@ -48,6 +54,9 @@ override_dh_auto_build: binary-indep: build-indep build-indep: dh_prep + cp -f $(ROUTERVERSION) $(CURDIR)/debian/routerversion.java.bak + sed -e "s/\(.*EXTRA\ =\ \)[^ ]*\"\(.*\)\"/\1\"\2-$$EXTRAPREFIX$$DEBIANVERSION\"/" < $(ROUTERVERSION) > $(ROUTERVERSION).tmp + mv -f $(ROUTERVERSION).tmp $(ROUTERVERSION) # The next line is used by KYTV when building from source packages #[ -r jetty/jetty-5.1.15.tgz ] && ln -sf $(CURDIR)/jetty/jetty-5.1.15.tgz $(CURDIR)/apps/jetty/jetty-5.1.15.tgz ant preppkg-unix javadoc @@ -76,7 +85,6 @@ createcopyright: @/bin/echo -e "at http://www.i2p2.de/newdevelopers#getting-the-i2p-code\n\n\n" >> $(CURDIR)/debian/copyright @/bin/cat $(CURDIR)/LICENSE.txt >> $(CURDIR)/debian/copyright - override_dh_compress: dh_compress -X.xsl -X.xml