vdr/vdr/debian patchlevel.sh changelog rules vdr-dev.install

Tobias Grimm pkg-vdr-dvb-changes@lists.alioth.debian.org
Wed, 10 Nov 2004 22:56:53 +0000


Update of /cvsroot/pkg-vdr-dvb/vdr/vdr/debian
In directory haydn:/tmp/cvs-serv18107

Modified Files:
	changelog rules vdr-dev.install 
Added Files:
	patchlevel.sh 
Log Message:
extracted patchlevel code for reuse by plugin packages

Index: changelog
===================================================================
RCS file: /cvsroot/pkg-vdr-dvb/vdr/vdr/debian/changelog,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- changelog	6 Nov 2004 18:25:29 -0000	1.60
+++ changelog	10 Nov 2004 22:56:50 -0000	1.61
@@ -2,6 +2,8 @@
 
   * Thomas Günther <tom@toms-cafe.de>
     - new (optional) plugin check (with "vdr -V -P plugin")
+    - Extracted patchlevel code to patchlevel.sh 
+    - Installing patchlevel.sh into vdr-dev package
   * Tobias Grimm <tg@e-tobi.net> 
     - fixed small bug in vdr-recordingaction
     - moved PLUGIN_DIR, PLUGIN_PREFIX, CFG_DIR, PLUGIN_CFG_DIR,

Index: vdr-dev.install
===================================================================
RCS file: /cvsroot/pkg-vdr-dvb/vdr/vdr/debian/vdr-dev.install,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- vdr-dev.install	6 Nov 2004 18:25:29 -0000	1.4
+++ vdr-dev.install	10 Nov 2004 22:56:51 -0000	1.5
@@ -6,3 +6,5 @@
 vdr-newplugin			usr/bin/
 
 debian/lintian/vdr-dev		usr/share/lintian/overrides/
+
+debian/patchlevel.sh            usr/lib/vdr-dev/

--- NEW FILE: patchlevel.sh ---
#!/bin/sh
set -e
case "$*" in
    "make")
        # scan patches in 00list and write to patchlevel file
        echo -n "Patches: "
        for p in $(grep "^opt-[0-9][0-9]_" debian/patches/00list | cut -d"_" -f2-); do
            echo -n "$p "
            PATCHES="$PATCHES $p"
        done
        echo
        echo "patchlevel=$PATCHES" > patchlevel
        ;;
    "clean")
        # remove patchlevel file
        rm -f patchlevel
        ;;
    "subst")
        # read patchlevel file and write contents to *.substvars
        if [ -r patchlevel ]; then
            # main vdr package
            PATCHES=$(cat patchlevel)
        else
            # vdr-plugin package
            PATCHES=$(cat /usr/include/vdr/patchlevel)
        fi
        # write *.substvars only if patchlevel not empty
	if [ "$PATCHES" != "patchlevel=" ]; then
            # scan control for packages
            for p in $(dh_listpackages); do
                echo "$PATCHES" >> debian/$p.substvars
            done
        fi
        ;;
    *)
        echo >&2 "$0: script expects make|clean|subst as argument"
        exit 1
        ;;
esac
exit 0

Index: rules
===================================================================
RCS file: /cvsroot/pkg-vdr-dvb/vdr/vdr/debian/rules,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- rules	6 Nov 2004 19:37:37 -0000	1.34
+++ rules	10 Nov 2004 22:56:51 -0000	1.35
@@ -63,11 +63,8 @@
 	touch build-stamp
 
 patchlevel:
-	@echo -n "Patches: "
-	@for i in `grep -e "^opt-[0-9][0-9]_.*" debian/patches/00list | cut -d"_" -f2-` ; do\
-	  echo -n "$$i "; PATCHES="$$PATCHES $$i";\
-	done ; [ -z $$PATCHES ] || echo "patchlevel=$$PATCHES" > debian/patchlevel
-	@echo ""
+	chmod +x debian/patchlevel.sh
+	debian/patchlevel.sh make
 
 clean: clean-patched unpatch
 
@@ -82,8 +79,8 @@
 
 	rm -f vdr-kbd vdr-daemon vdr-lirc vdr-rcu
 	rm -rf PLUGINS/lib
-	rm -f debian/patchlevel
 	rm -f vdr-newplugin
+	sh debian/patchlevel.sh clean
 	
 	dh_clean
 
@@ -116,15 +113,7 @@
 	dh_compress -i 
 	dh_fixperms -i
 	dh_installdeb -i
-
-# VDR can be customized with quite a lot of different patches, which can make
-# the plugins binary incompatible.
-# Although Debian will not provide different binary packages for VDR, we
-# will include a patchlevel info, which is created at compile time and can
-# be checked before a plugin is loaded.
-#	[ -r debian/patchlevel ] || echo 'patchlevel=' >> debian/vdr.substvars
-	[ ! -r debian/patchlevel ] || cat debian/patchlevel >> debian/vdr.substvars
-
+	debian/patchlevel.sh subst
 	dh_gencontrol -i
 	dh_md5sums -i
 	dh_builddeb -i