[Pkg-octave-commit] rev 74 - trunk/packages/octave2.1/debian

Rafael Laboissiere rafael@costa.debian.org
Sun, 20 Feb 2005 22:02:05 +0100


Author: rafael
Date: 2005-02-20 22:02:04 +0100 (Sun, 20 Feb 2005)
New Revision: 74

Added:
   trunk/packages/octave2.1/debian/octave2.1-emacsen.postinst.in
   trunk/packages/octave2.1/debian/octave2.1-emacsen.prerm.in
   trunk/packages/octave2.1/debian/octave2.1-headers.postinst.in
   trunk/packages/octave2.1/debian/octave2.1-headers.prerm.in
   trunk/packages/octave2.1/debian/octave2.1.lintian.in
   trunk/packages/octave2.1/debian/octave2.1.postinst.in
   trunk/packages/octave2.1/debian/octave2.1.prerm.in
Removed:
   trunk/packages/octave2.1/debian/control,v
   trunk/packages/octave2.1/debian/octave2.1-emacsen.postinst
   trunk/packages/octave2.1/debian/octave2.1-emacsen.prerm
   trunk/packages/octave2.1/debian/octave2.1-headers.postinst
   trunk/packages/octave2.1/debian/octave2.1-headers.prerm
   trunk/packages/octave2.1/debian/octave2.1.lintian
   trunk/packages/octave2.1/debian/octave2.1.postinst
   trunk/packages/octave2.1/debian/octave2.1.prerm
   trunk/packages/octave2.1/debian/rules,v
Modified:
   trunk/packages/octave2.1/debian/changelog
   trunk/packages/octave2.1/debian/rules
Log:
* Some postinst and prerm scripts are now automatically generated by
  debian/rules, with *.in files being put now under SVN control.  This will
  avoid changes in these files at every new upstream version of Octave.
* Removed obsolete RCS files control,v and rules,v.


Modified: trunk/packages/octave2.1/debian/changelog
===================================================================
--- trunk/packages/octave2.1/debian/changelog	2005-02-20 13:40:22 UTC (rev 73)
+++ trunk/packages/octave2.1/debian/changelog	2005-02-20 21:02:04 UTC (rev 74)
@@ -6,6 +6,18 @@
 
   * New upstream release 2.1.65 released 24 hours ago
 
+  +++ Changes by Rafael Laboissiere
+  
+  * debian/*.postinst.in, debian/*.prerm.in: Moved these files from the
+    original *.postinst and *. prerm ones
+  * debian/octave2.1.lintian.in: Idem from octave2.1.lintian
+  * debian/rules: 
+    - (configure-stamp) Generate *.postinst, *.prerm, and *.lintian by
+      replacing the  @VERSION@ string with the current Octave version number
+    - (clean) Remove the *.postinst, *.prerm, *.lintian files generated
+      automatically 
+  * debian/control,v, debian/rules,v: Removed these obsolete files
+
   +++ Changes by Adam Conrad:
 
   * Add logic to debian/rules and debian/control to make sure that

Deleted: trunk/packages/octave2.1/debian/control,v

Deleted: trunk/packages/octave2.1/debian/octave2.1-emacsen.postinst

Copied: trunk/packages/octave2.1/debian/octave2.1-emacsen.postinst.in (from rev 73, trunk/packages/octave2.1/debian/octave2.1-emacsen.postinst)
===================================================================
--- trunk/packages/octave2.1/debian/octave2.1-emacsen.postinst	2005-02-20 13:40:22 UTC (rev 73)
+++ trunk/packages/octave2.1/debian/octave2.1-emacsen.postinst.in	2005-02-20 21:02:04 UTC (rev 74)
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# postinst script for the Debian GNU/Linux octave package
+#
+# Initial version written by Andrew D. Fernandes <adfernan@cnd.mcgill.ca>
+# This version written by Dirk Eddelbuettel <edd@debian.org>   
+
+set -e
+
+#DEBHELPER#
+
+# The current Octave version, known to debian/rules at build time
+VERSION=@VERSION@
+
+case "$1" in
+    configure)     
+	#
+	# update-alternatives for multiple Octave versions
+	update-alternatives --install /usr/bin/otags  otags  \
+				    /usr/bin/otags-$VERSION 10 \
+			    --slave /usr/share/man/man1/otags.1.gz \
+				    otags.1.gz \
+				    /usr/share/man/man1/otags-$VERSION.1.gz
+       ;;
+    abort-upgrade|abort-remove|abort-deconfigure)
+        ;;
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        ;;
+esac
+
+exit 0                 

Deleted: trunk/packages/octave2.1/debian/octave2.1-emacsen.prerm

Copied: trunk/packages/octave2.1/debian/octave2.1-emacsen.prerm.in (from rev 73, trunk/packages/octave2.1/debian/octave2.1-emacsen.prerm)
===================================================================
--- trunk/packages/octave2.1/debian/octave2.1-emacsen.prerm	2005-02-20 13:40:22 UTC (rev 73)
+++ trunk/packages/octave2.1/debian/octave2.1-emacsen.prerm.in	2005-02-20 21:02:04 UTC (rev 74)
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# prerm script for the Debian GNU/Linux octave package
+#
+# Written by Dirk Eddelbuettel <edd@debian.org>   
+
+set -e
+
+#DEBHELPER# 
+
+# The current Octave version, known to debian/rules at build time
+VERSION=@VERSION@
+
+case "$1" in
+    remove|upgrade|deconfigure)
+	#
+	# update-alternatives for multiple Octave versions
+	update-alternatives --remove otags /usr/bin/otags-$VERSION
+	;;
+    failed-upgrade)
+	;;
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 0
+    ;;
+esac                                     
+
+
+

Deleted: trunk/packages/octave2.1/debian/octave2.1-headers.postinst

Copied: trunk/packages/octave2.1/debian/octave2.1-headers.postinst.in (from rev 73, trunk/packages/octave2.1/debian/octave2.1-headers.postinst)
===================================================================
--- trunk/packages/octave2.1/debian/octave2.1-headers.postinst	2005-02-20 13:40:22 UTC (rev 73)
+++ trunk/packages/octave2.1/debian/octave2.1-headers.postinst.in	2005-02-20 21:02:04 UTC (rev 74)
@@ -0,0 +1,33 @@
+#!/bin/sh -e
+#
+# postinst script for the Debian GNU/Linux octave2.0-headers package
+#
+# This version written by Dirk Eddelbuettel <edd@debian.org>   
+
+#DEBHELPER#
+
+# The current Octave version, known to debian/rules at build time
+VERSION=@VERSION@
+
+case "$1" in
+    configure)     
+	#
+	# update-alternatives for multiple Octave versions
+	update-alternatives --install /usr/bin/mkoctfile  mkoctfile  \
+				    /usr/bin/mkoctfile-$VERSION 15 \
+# 	update-alternatives --install /usr/bin/mkoctfile  mkoctfile  \
+# 				    /usr/bin/mkoctfile-$VERSION 15 \
+# 			    --slave /usr/share/man/man1/mkoctfile.1.gz \
+# 				    mkoctfile.1.gz \
+# 				    /usr/share/man/man1/mkoctfile-$VERSION.1.gz
+	update-alternatives --install /usr/include/octave octave-include  \
+				    /usr/include/octave-$VERSION 15 \
+       ;;
+    abort-upgrade|abort-remove|abort-deconfigure)
+        ;;
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        ;;
+esac
+
+exit 0                 

Deleted: trunk/packages/octave2.1/debian/octave2.1-headers.prerm

Copied: trunk/packages/octave2.1/debian/octave2.1-headers.prerm.in (from rev 73, trunk/packages/octave2.1/debian/octave2.1-headers.prerm)
===================================================================
--- trunk/packages/octave2.1/debian/octave2.1-headers.prerm	2005-02-20 13:40:22 UTC (rev 73)
+++ trunk/packages/octave2.1/debian/octave2.1-headers.prerm.in	2005-02-20 21:02:04 UTC (rev 74)
@@ -0,0 +1,28 @@
+#!/bin/sh -e
+#
+# prerm script for the Debian GNU/Linux octave2.0-headers package
+#
+# Written by Dirk Eddelbuettel <edd@debian.org>   
+
+#DEBHELPER# 
+
+# The current Octave version, known to debian/rules at build time
+VERSION=@VERSION@
+
+case "$1" in
+    remove|upgrade|deconfigure)
+	#
+	# update-alternatives for multiple Octave versions
+	update-alternatives --remove mkoctfile /usr/bin/mkoctfile-$VERSION
+	update-alternatives --remove octave-include /usr/include/octave-$VERSION
+	;;
+    failed-upgrade)
+	;;
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 0
+    ;;
+esac                                     
+
+
+

Deleted: trunk/packages/octave2.1/debian/octave2.1.lintian

Copied: trunk/packages/octave2.1/debian/octave2.1.lintian.in (from rev 73, trunk/packages/octave2.1/debian/octave2.1.lintian)
===================================================================
--- trunk/packages/octave2.1/debian/octave2.1.lintian	2005-02-20 13:40:22 UTC (rev 73)
+++ trunk/packages/octave2.1/debian/octave2.1.lintian.in	2005-02-20 21:02:04 UTC (rev 74)
@@ -0,0 +1,5 @@
+octave2.1: binary-or-shlib-defines-rpath ./usr/bin/octave-@VERSION@ /usr/lib/octave-@VERSION@
+octave2.1: binary-or-shlib-defines-rpath ./usr/lib/octave-@VERSION@/liboctave.so.@VERSION@ /usr/lib/octave-@VERSION@
+octave2.1: package-contains-hardlink 
+octave2.1: package-has-a-duplicate-relation atlas2-base | blas | blas2, atlas2-base | lapack | lapack2
+octave2.1: menu-command-not-in-package /usr/lib/menu/octave2.1:4 /usr/bin/octave2.1

Deleted: trunk/packages/octave2.1/debian/octave2.1.postinst

Copied: trunk/packages/octave2.1/debian/octave2.1.postinst.in (from rev 73, trunk/packages/octave2.1/debian/octave2.1.postinst)
===================================================================
--- trunk/packages/octave2.1/debian/octave2.1.postinst	2005-02-20 13:40:22 UTC (rev 73)
+++ trunk/packages/octave2.1/debian/octave2.1.postinst.in	2005-02-20 21:02:04 UTC (rev 74)
@@ -0,0 +1,58 @@
+#!/bin/sh -e
+#
+# postinst script for the Debian GNU/Linux octave2.0 package
+#
+# Initial version written by Andrew D. Fernandes <adfernan@cnd.mcgill.ca>
+# This version written by Dirk Eddelbuettel <edd@debian.org>   
+
+#DEBHELPER#
+
+# The current Octave version, known to debian/rules at build time
+VERSION=@VERSION@
+
+case "$1" in
+    configure)     
+	#
+	# create /usr/local/ directory, if we may
+	install -d /usr/local/share/octave/site-m \
+	        -m 2775 -o root -g staff             2>/dev/null || true
+	#
+	# if it exists, update the ls-R database for kpathsea
+	if [ -d /usr/local/share/octave/ ]
+	then 
+	    ls -LR /usr/lib/octave/ /usr/share/octave \
+		    /usr/local/share/octave > /usr/share/octave/ls-R
+	else
+	    ls -LR /usr/lib/octave/ /usr/share/octave > /usr/share/octave/ls-R
+	fi 
+	#
+	# update-alternatives for multiple Octave versions
+	update-alternatives --install /usr/bin/octave  octave  \
+				    /usr/bin/octave-$VERSION 30 \
+			    --slave /usr/share/man/man1/octave.1.gz \
+				    octave.1.gz \
+				    /usr/share/man/man1/octave-$VERSION.1.gz
+	update-alternatives --install /usr/bin/octave2.1  octave2.1  \
+				    /usr/bin/octave-$VERSION 30 \
+			    --slave /usr/share/man/man1/octave2.1.1.gz \
+				    octave2.1.1.gz \
+				    /usr/share/man/man1/octave-$VERSION.1.gz
+	update-alternatives --install /usr/bin/octave-bug  octave-bug  \
+				    /usr/bin/octave-bug-$VERSION 30 \
+			    --slave /usr/share/man/man1/octave-bug.1.gz \
+				    octave-bug.1.gz \
+				    /usr/share/man/man1/octave-bug-$VERSION.1.gz
+	update-alternatives --install /usr/bin/octave-config  octave-config  \
+				    /usr/bin/octave-config-$VERSION 30 \
+			    --slave /usr/share/man/man1/octave-config.1.gz \
+				    octave-config.1.gz \
+				    /usr/share/man/man1/octave-config-$VERSION.1.gz
+	;;
+    abort-upgrade|abort-remove|abort-deconfigure)
+        ;;
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        ;;
+esac
+
+exit 0                 

Deleted: trunk/packages/octave2.1/debian/octave2.1.prerm

Copied: trunk/packages/octave2.1/debian/octave2.1.prerm.in (from rev 73, trunk/packages/octave2.1/debian/octave2.1.prerm)
===================================================================
--- trunk/packages/octave2.1/debian/octave2.1.prerm	2005-02-20 13:40:22 UTC (rev 73)
+++ trunk/packages/octave2.1/debian/octave2.1.prerm.in	2005-02-20 21:02:04 UTC (rev 74)
@@ -0,0 +1,37 @@
+#!/bin/sh -e
+#
+# prerm script for the Debian GNU/Linux octave package
+#
+# Written by Dirk Eddelbuettel <edd@debian.org>   
+
+#DEBHELPER# 
+
+# The current Octave version, known to debian/rules at build time
+VERSION=@VERSION@
+
+case "$1" in
+    remove|upgrade|deconfigure)
+	#
+	# remove the /usr/local package, if we may
+	if [ -w /usr/local/share/octave/site-m ]
+	then 
+	    rmdir /usr/local/share/octave/site-m 2>/dev/null || true
+	    rmdir /usr/local/share/octave        2>/dev/null || true
+	fi
+	#
+	# update-alternatives for multiple Octave versions
+	update-alternatives --remove octave /usr/bin/octave-$VERSION
+	update-alternatives --remove octave2.1 /usr/bin/octave-$VERSION
+	update-alternatives --remove octave-bug /usr/bin/octave-bug-$VERSION
+	update-alternatives --remove octave-config /usr/bin/octave-config-$VERSION
+	;;
+    failed-upgrade)
+	;;
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 0
+    ;;
+esac                                     
+
+
+

Modified: trunk/packages/octave2.1/debian/rules
===================================================================
--- trunk/packages/octave2.1/debian/rules	2005-02-20 13:40:22 UTC (rev 73)
+++ trunk/packages/octave2.1/debian/rules	2005-02-20 21:02:04 UTC (rev 74)
@@ -116,15 +116,16 @@
 
         # prepare the postinst and prerm files for the given version number
 	@for i in octave2.1 octave2.1-headers octave2.1-emacsen; do \
-		perl -p -i -e "s/VERSION=.*/VERSION=$(version)/" \
-			debian/$${i}.postinst; \
-		perl -p -i -e "s/VERSION=.*/VERSION=$(version)/" \
-			debian/$${i}.prerm; \
+		for j in postinst prerm; do \
+			perl -p -e 's/@VERSION@/$(version)/' \
+				< debian/$${i}.$${j}.in > debian/$${i}.$${j}; \
+		done ; \
 	done
 
         # fix the lintian override and bring it up to date 
-	perl -p -i -e 's/2.1.\d\d/$(version)/g' debian/octave2.1.lintian
-
+	perl -p -e 's/@VERSION@/$(version)/g' < debian/octave2.1.lintian.in \
+		> debian/octave2.1.lintian
+		
 	touch configure-stamp
 
 make: configure-stamp make-stamp 
@@ -154,6 +155,12 @@
         ##doc/interpreter/octave.{dvi,ps} doc/faq/Octave-FAQ_*.html 
         ##scripts/DOCSTRINGS
 	test ! -f octave-bug.in.orig || mv octave-bug.in.orig octave-bug.in
+	for i in octave2.1 octave2.1-headers octave2.1-emacsen; do \
+		for j in postinst prerm; do \
+			rm -f $${i}.$${j} ; \
+		done ; \
+	done
+	rm -f octave2.1.lintian
 	dh_clean
 
 # install files

Deleted: trunk/packages/octave2.1/debian/rules,v