Use pyparted to check for bootflag [Closes: issue1248]
[grml2usb.git] / debian / rules
index c3e0d94..0ba3486 100755 (executable)
@@ -9,6 +9,8 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+VERSION:=$(shell dpkg-parsechangelog | awk '/Version: / { print $$2 }')
+
 build: build-arch build-indep
 build-arch: build-stamp
 build-indep: build-stamp
@@ -16,7 +18,7 @@ build-indep: build-stamp
 build-stamp:
        dh_testdir
 
-       # Add here commands to compile the package.
+       egrep -q "PROG_VERSION = '\*\*\*UNRELEASED\*\*\*'" grml2usb || (echo "PROG_VERSION in grml2usb wrong." && exit 2)
        $(MAKE)
        cd mbr && $(MAKE) && cd ..
        touch build-stamp
@@ -39,6 +41,7 @@ install: build
 
        # Add here commands to install the package into debian/grml2usb.
        install -m 755 grml2usb               debian/grml2usb/usr/sbin/grml2usb
+       sed -i -e "s/PROG_VERSION = '\*\*\*UNRELEASED\*\*\*'/PROG_VERSION = '$(VERSION)'/" debian/grml2usb/usr/sbin/grml2usb
        install -m 755 grml2iso               debian/grml2usb/usr/sbin/grml2iso
        install -m 644 mbr/mbrmgr             debian/grml2usb/usr/share/grml2usb/mbr/mbrmgr
        install -m 644 mbr/mbrldr             debian/grml2usb/usr/share/grml2usb/mbr/mbrldr
@@ -46,10 +49,6 @@ install: build
 
 # Build architecture-dependent files here.
 binary-arch: build-arch install
-# We have nothing to do by default.
-
-# Build architecture-independent files here.
-binary-indep: build-indep install
        dh_testdir
        dh_testroot
        dh_installchangelogs
@@ -64,5 +63,9 @@ binary-indep: build-indep install
        dh_md5sums
        dh_builddeb
 
+# Build architecture-independent files here.
+binary-indep: build-indep install
+# Nothing to do.
+
 binary: binary-indep binary-arch
 .PHONY: build clean binary-indep binary-arch binary install