From: joey <joey>
Date: Tue, 17 Aug 1999 04:41:45 +0000 (+0000)
Subject: r45: Initial Import
X-Git-Tag: debian_version_0_1~183
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=94f1df06050aa3c512fd8af6e67690f482fbcd5a;p=debhelper.git

r45: Initial Import
---

diff --git a/debian/changelog b/debian/changelog
index 75e03da..15b91d4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+debhelper (0.51) unstable; urgency=low
+
+  * dh_fixperms: make shared libraries non-executable, in accordance with
+    policy. (#16644)
+  * dh_makeshlibs: introduced a -V flag, which allows you to specify explicit
+    version requirements in the shlibs file.
+  * dh_{installdirs,installdocs,installexamples,suidregister,undocumented}:
+    Added a -A flag, which makes any files/directories specified on the
+    command line apply to ALL packages acted on.
+  * Updated Standards-Version to latest.
+
+ -- Joey Hess <joeyh@master.debian.org>  Mon,  5 Jan 1998 16:15:01 -0500
+
 debhelper (0.50) unstable; urgency=low
 
   * dh_makeshlibs: added -m parameter, which can force the major number
diff --git a/debian/control b/debian/control
index e22d969..6883f62 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: debhelper
 Section: devel
 Priority: optional
 Maintainer: Joey Hess <joeyh@master.debian.org>
-Standards-Version: 2.1.1.0
+Standards-Version: 2.3.0.1
 
 Package: debhelper
 Architecture: all
diff --git a/dh_fixperms b/dh_fixperms
index 0534549..32c9dbe 100755
--- a/dh_fixperms
+++ b/dh_fixperms
@@ -26,9 +26,15 @@ for PACKAGE in $DH_DOPACKAGES; do
 		doit "chmod 755 $files"
 	fi
 
-	# Executable man pages are a bad thing.
+	# Executable man pages are a bad thing..
 	files=`find $TMP/usr/man/ $TMP/usr/X11*/man/ -type f 2>/dev/null | tr "\n" " "` || true
 	if [ "$files" ]; then
 		doit "chmod 644 $files"
 	fi
+
+	# ..so are executable shared libraries.
+	files=`find $TMP -perm -5 -type f -name "*.so*" | tr "\n" " "` || true
+	if [ "$files" ]; then
+		doit "chmod a-X $files"
+	fi
 done
diff --git a/dh_fixperms.1 b/dh_fixperms.1
index c403836..1fac26c 100644
--- a/dh_fixperms.1
+++ b/dh_fixperms.1
@@ -12,6 +12,7 @@ dh_fixperms makes all files in usr/doc in the package build directory
 (excluding files in the examples/ directory) be mode 644. It also changes 
 the permissions of all man pages to mode 644. It makes all files be owned by 
 root, and it removes group and other write permission from all files.
+Finally, it removes execute permissions from any libraries that have it set.
 .SH OPTIONS
 .TP
 .B \-v
@@ -43,6 +44,6 @@ Enables verbose mode
 .SH "SEE ALSO"
 .BR /usr/doc/debhelper/README
 .SH "CONFORMS TO"
-Debian policy, version 2.3.0.0
+Debian policy, version 2.3.0.1
 .SH AUTHOR
 Joey Hess <joeyh@master.debian.org>
diff --git a/dh_installdirs b/dh_installdirs
index 51ef2ce..1ef311e 100755
--- a/dh_installdirs
+++ b/dh_installdirs
@@ -19,7 +19,8 @@ for PACKAGE in $DH_DOPACKAGES; do
 		dirs=`tr "\n" " " < debian/${EXT}dirs`
 	fi
 
-	if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then
+	if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \
+	     -a "$*" ]; then
 		dirs="$* $dirs"
 	fi
 
diff --git a/dh_installdirs.1 b/dh_installdirs.1
index fc5c8d6..0fba87d 100644
--- a/dh_installdirs.1
+++ b/dh_installdirs.1
@@ -3,7 +3,7 @@
 dh_installdirs \- create subdirectories in package build directories
 .SH SYNOPSIS
 .B dh_installdirs
-.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [dir ...]"
+.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-A] [dir ...]"
 .SH "DESCRIPTION"
 dh_installdirs is a debhelper program that is responsible for creating
 subdirectories in package build directories.
@@ -37,9 +37,13 @@ Create directories for the package named "package".
 .B \-Ptmpdir
 Use "tmpdir" for package build directory. 
 .TP
+.B \-A
+Create any directories specified by command line parameters in ALL packages
+acted on.
+.TP
 .B dir ...
 Create these directories in the package build directory of the first package
-acted on.
+acted on. (Or in all packages if -A is specified.)
 .SH NOTES
 The
 .B \-a
diff --git a/dh_installdocs b/dh_installdocs
index 1101422..f345a28 100755
--- a/dh_installdocs
+++ b/dh_installdocs
@@ -20,7 +20,8 @@ for PACKAGE in $DH_DOPACKAGES; do
 		docs=`tr "\n" " " < debian/${EXT}docs`
 	fi
 
-	if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then
+	if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \
+	     -a "$*" ]; then
 		docs="$* $docs"
 	fi
 
diff --git a/dh_installdocs.1 b/dh_installdocs.1
index 86195b7..ab9ed47 100644
--- a/dh_installdocs.1
+++ b/dh_installdocs.1
@@ -3,7 +3,7 @@
 dh_installdocs \- install documentation into package build directories
 .SH SYNOPSIS
 .B dh_installdocs
-.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [file ...]"
+.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-A] [file ...]"
 .SH "DESCRIPTION"
 dh_installdocs is a debhelper program that is responsible for installing
 documentation into usr/doc/package in package build directories.
@@ -43,8 +43,13 @@ Install files for the package named "package".
 .B \-Ptmpdir
 Use "tmpdir" for package build directory. 
 .TP
+.B \-A
+Install all files specified by command line parameters in ALL packages
+acted on.
+.TP
 .B file ...
-Install these files as documentation into the first package acted on.
+Install these files as documentation into the first package acted on. (Or in
+all packages if -A is specified).
 .SH NOTES
 The
 .B \-a
diff --git a/dh_installexamples b/dh_installexamples
index 98a752d..423c647 100755
--- a/dh_installexamples
+++ b/dh_installexamples
@@ -16,7 +16,8 @@ for PACKAGE in $DH_DOPACKAGES; do
 		examples=`tr "\n" " " < debian/${EXT}examples`
 	fi
 
-	if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then
+	if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \
+	     -a "$*" ]; then
 		examples="$* $examples"
 	fi
 
diff --git a/dh_installexamples.1 b/dh_installexamples.1
index f70b98c..e46ed82 100644
--- a/dh_installexamples.1
+++ b/dh_installexamples.1
@@ -3,7 +3,7 @@
 dh_installexamples \- install example files into package build directories
 .SH SYNOPSIS
 .B dh_installexamples
-.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [file ...]"
+.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-A] [file ...]"
 .SH "DESCRIPTION"
 dh_installexamples is a debhelper program that is responsible for installing
 examples into usr/doc/package/examples in package build directories.
@@ -33,8 +33,13 @@ Install files for the package named "package".
 .B \-Ptmpdir
 Use "tmpdir" for package build directory. 
 .TP
+.B \-A
+Install any files specified by command line parameters in ALL packages
+acted on.
+.TP
 .B file ...
-Install these files as examples into the first package acted on.
+Install these files as examples into the first package acted on. (Or into all
+packages if -A is specified.)
 .SH NOTES
 The
 .B \-a
diff --git a/dh_lib b/dh_lib
index 2c2b995..39dae2a 100644
--- a/dh_lib
+++ b/dh_lib
@@ -10,6 +10,7 @@ doit() {
 	eval '$@'
 }
 
+
 # This is an identical command to doit, except the parameter passed to it
 # are evaled with double quotes. This version can handle compound commands.
 complex_doit() {
@@ -52,6 +53,7 @@ pkgext() {
 }
 
 # Returns 1 if the package is a native debian package, null otherwise.
+# As a side effect, sets $VERSION to the version of this package.
 # Caches return code so it only needs to run dpkg-parsechangelog once.
 isnative() {
 	if [ -z "$DH_ISNATIVE" ]; then
@@ -141,7 +143,7 @@ get_arch_indep_packages() {
 # Argument processing and global variable initialization is below.
 
 # Parse command line.
-set -- `getopt xvidrnakp:P:u:m: $*`
+set -- `getopt xvidrnakVAp:P:u:m: $*`
 
 for i; do
 	case "$i"
@@ -202,6 +204,14 @@ for i; do
 			shift
 			shift
 			;;
+		-V)
+			DH_V_FLAG=1
+			shift
+			;;
+		-A)
+			DH_PARAMS_ALL=1
+			shift
+			;;
 		--)
 			shift
 			break
diff --git a/dh_makeshlibs b/dh_makeshlibs
index 6cf9c80..f96c327 100755
--- a/dh_makeshlibs
+++ b/dh_makeshlibs
@@ -14,9 +14,9 @@ for PACKAGE in $DH_DOPACKAGES; do
 
 	for file in `find $TMP -type f -name "*.so*" | tr "\n" " "` ; do
 		LIBRARY=`expr $file : ".*/\(.*\)\.so\..*"` || true
-		VERSION=`expr $file : ".*/.*\.so\.\(.*\)"` || true
+		LIB_VERSION=`expr $file : ".*/.*\.so\.\(.*\)"` || true
 		if [ -z "$DH_M_PARAMS" ]; then
-			MAJOR=`expr $VERSION : "\([0-9]*\)\."` || true
+			MAJOR=`expr $LIB_VERSION : "\([0-9]*\)\."` || true
 		else
 			MAJOR="$DH_M_PARAMS"
 		fi
@@ -24,6 +24,16 @@ for PACKAGE in $DH_DOPACKAGES; do
 		if [ ! -d "$TMP/DEBIAN" ] ; then
 			doit "install -d $TMP/DEBIAN"
 		fi
+		if [ "$DH_V_FLAG" ]; then
+			if [ "$*" ]; then
+				PACKAGE="$*"
+			else
+				# Call isnative becuase it sets $VERSION
+				# as a side effect.
+				isnative
+				PACKAGE="$PACKAGE (>= $VERSION)"
+			fi
+		fi
 		complex_doit "echo '$LIBRARY $MAJOR $PACKAGE' >>$TMP/DEBIAN/shlibs"
 	done
 
diff --git a/dh_makeshlibs.1 b/dh_makeshlibs.1
index 02c7ea8..056cc0f 100644
--- a/dh_makeshlibs.1
+++ b/dh_makeshlibs.1
@@ -3,7 +3,7 @@
 dh_makeshlibs \- automatically create shlibs file
 .SH SYNOPSIS
 .B dh_makeshlibs
-.I "[-v] [-a] [-i] [-mmajor] [-Ptmpdir] [-ppackage]"
+.I "[-v] [-a] [-i] [-mmajor] [-Ptmpdir] [-ppackage] [-mmajor] [-V [dependancies]]"
 .SH "DESCRIPTION"
 dh_makeshlibs is a debhelper program that automatically scans for shared
 libraries, and generates a shlibs file for the libraries it finds.
@@ -30,6 +30,31 @@ Use "tmpdir" for package build directory.
 .B \-mmajor
 Instead of trying to guess the major number of the library from the filename
 of the library, use the major number specified after the -m parameter.
+.TP
+.B \-V [dependancies]
+By default, the shlibs file generated by this program does not make packages
+depend on any particular version of the package containing the shared
+library. It may be necessary for you to add some version dependancy
+information to the shlibs file. If -V is specified with no dependancy
+information, the current version of the package is plugged into a dependancy
+that looks like "packagename (>= packageversion)". If -V is specified with
+parameters, the parameters can be used to specify the exact dependancy
+information needed (be sure to include the package name).
+.SH EXAMPLES
+.TP
+.B dh_makeshlibs
+Assuming this is a package named libfoobar1, generates a shlibs file that
+looks something like:
+  libfoobar 1 libfoobar1
+.TP
+.B dh_makeshlibs \-V
+Assuming the current version of the package is 1.0-3, generates a shlibs
+file that looks something like:
+  libfoobar 1 libfoobar1 (>= 1.0-3)
+.TP
+.B dh_makeshlibs \-V "libfoobar1 (>= 1.0)"
+Generates a shlibs file that looks something like:
+  libfoobar 1 libfoobar1 (>= 1.0)
 .SH NOTES
 The
 .B \-a
@@ -45,6 +70,14 @@ Enables verbose mode
 .SH "SEE ALSO"
 .BR /usr/doc/debhelper/README
 .SH BUGS
+Due to limitations in
+.BR getopt (1)
+, I had to fudge a bit on how the -V parameter really works. When -V is
+specified, it's really examining the rest of the command line for any text
+that isn't a switch, and using that for the dependancy information. This
+means that the -V switch and any dependancy parameters should come last on
+the command line.
+.P
 There is no guarantee that the program will get the shlibs file right. For
 example, it may not correctly guess the major number of your package. In
 cases like these (and perhaps in general, just to be safe), it is better to
diff --git a/dh_suidregister b/dh_suidregister
index 42e4d16..3f7622a 100755
--- a/dh_suidregister
+++ b/dh_suidregister
@@ -19,7 +19,8 @@ for PACKAGE in $DH_DOPACKAGES; do
 		files=`tr "\n" " " < debian/${EXT}suid`
 	fi
 
-	if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then
+	if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \
+	     -a "$*" ]; then
 		files="$* $files"
 	fi
 
diff --git a/dh_suidregister.1 b/dh_suidregister.1
index d374a4c..ef5b08d 100644
--- a/dh_suidregister.1
+++ b/dh_suidregister.1
@@ -3,7 +3,7 @@
 dh_suidregister \- set up package to register files with suidregister
 .SH SYNOPSIS
 .B dh_suidregister
-.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [file ...]"
+.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-A] [file ...]"
 .SH "DESCRIPTION"
 dh_suidregister is a debhelper program that is responsible for modifying the
 postinst and postrm scripts of a package so the package will register files
@@ -44,8 +44,14 @@ Register files for the package named "package".
 .B \-Ptmpdir
 Use "tmpdir" for package build directory. 
 .TP
+.B \-A
+Register any files specified by command line parameters in ALL packages
+acted on. I doubt anyone will find this useful, it's here for consitency
+with other debhelper programs.
+.TP
 .B file ...
-Register these files in the first package acted on.
+Register these files in the first package acted on. (Or in all packages if
+-A is specified.)
 .SH NOTES
 The
 .B \-a
diff --git a/dh_undocumented b/dh_undocumented
index e8ca0e0..31b2f98 100755
--- a/dh_undocumented
+++ b/dh_undocumented
@@ -19,7 +19,8 @@ for PACKAGE in $DH_DOPACKAGES; do
 		undoc=`tr "\n" " " < debian/${EXT}undocumented`
 	fi
 
-	if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then
+	if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \
+	     -a "$*" ]; then
 		undoc="$* $undoc"
 	fi
 
diff --git a/dh_undocumented.1 b/dh_undocumented.1
index 2bbf24a..9df8e31 100644
--- a/dh_undocumented.1
+++ b/dh_undocumented.1
@@ -3,7 +3,7 @@
 dh_undocumented \- make symlinks to undocumented.7.gz man page
 .SH SYNOPSIS
 .B dh_undocumented
-.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [manpage ...]"
+.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-A] [manpage ...]"
 .SH "DESCRIPTION"
 dh_undocumented is a debhelper program that is responsible for making
 symlinks to the
@@ -47,9 +47,15 @@ Install undocumented man page symlinks for the package named "package".
 .B \-Ptmpdir
 Use "tmpdir" for package build directory. 
 .TP
+.B \-A
+Install undocumented man page symlinks for any man pages specified by 
+command line parameters in ALL packages acted on. I doubt anyone will find
+this useful, it's here for consitency with other debhelper programs.
+.TP
 .B manpage ...
 Install undocumented man page symlinks for each of these man pages
-into the first package acted on.
+into the first package acted on. (Or in all packages acted on if -A is
+specified.)
 .SH NOTES
 The
 .B \-a