From 0287a9cbf507569b92fa157fb002a4ead079bbdb Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:58:44 +0000 Subject: [PATCH] r116: Initial Import --- debian/changelog | 18 ++++++++++++++++++ debian/rules | 19 +++++++------------ dh_installchangelogs | 5 +++++ dh_installchangelogs.1 | 9 ++++++++- dh_shlibdeps | 42 +++++++++++++++++++++++------------------- dh_testdir | 17 +++++++++-------- dh_testdir.1 | 2 -- dh_testroot | 13 +++++++------ 8 files changed, 77 insertions(+), 48 deletions(-) diff --git a/debian/changelog b/debian/changelog index f1a479e..b124f13 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,21 @@ +debhelper (1.1.10) unstable; urgency=low + + * It's come to my attention that a few packages use filename globbing in + debian/{docs,examples,whatever} files and expect that to work. It used + to work before the perl conversion, but it was never _documented_, or + intented to work. If you use this in your packages, they are broken and + need fixing (and will refuse to build with current versions of debhelper). + I apologize for the inconvenience. + + * dh_clean: fixed a bug, intorduced in version 1.1.8, where it didn't + remove debian/files properly. + * dh_shlibdeps, dh_testdir, dh_testroot, dh_testversion: converted to perl. + * Encode the version of debhelper in a sepererate file, so dh_testversion + doesn't have to be generated when a new version of debhelper is built. + * Removed bogus menu file. + + -- Joey Hess Mon, 17 Aug 1998 14:15:17 -0700 + debhelper (1.1.9) unstable; urgency=low * dh_fixperms: has been removing the +x bits of all doc/*/examples/* files diff --git a/debian/rules b/debian/rules index 8572498..94af868 100755 --- a/debian/rules +++ b/debian/rules @@ -8,35 +8,30 @@ export DH_AUTOSCRIPTDIR=autoscripts # Figure out the current debhelper version. -VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null`" : \ - '.*Version: \(.*\).*Distribution:') +VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null |grep Version:`" : '.*Version: \(.*\)') export DH_VERBOSE=1 -test_files=dh_lib - build: - ./dh_testdir $(test_files) - sed "s/#DEBHELPER_VERSION#/$(VERSION)/" < dh_testversion.in \ - > dh_testversion - chmod 755 dh_testversion +# Nothing to do. clean: - ./dh_testdir $(test_files) + ./dh_testdir ./dh_testroot - ./dh_clean dh_testversion + ./dh_clean # Build architecture-dependent files here. binary-arch: build -# We have nothing to do by default. +# Nothing to do. # Build architecture-independent files here. binary-indep: build - ./dh_testdir $(test_files) + ./dh_testdir ./dh_testroot ./dh_clean -k ./dh_installdirs usr/bin usr/lib/debhelper + echo -e "package Dh_Version;\n\$$version='$(VERSION)';" > debian/tmp/usr/lib/debhelper/Dh_Version.pm find . -perm +111 -maxdepth 1 -type f -not -name "*.pl" \ -exec install -p {} debian/tmp/usr/bin \; cp -a dh_lib dh_getopt.pl *.pm debian/tmp/usr/lib/debhelper diff --git a/dh_installchangelogs b/dh_installchangelogs index 0024fc1..97e057b 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -43,5 +43,10 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { if ($upstream) { doit("install","-p","-m644",$upstream,"$TMP/usr/doc/$PACKAGE/changelog"); + if ($dh{K_FLAG}) { + # Install symlink to original name of the upstream changelog file. + # Use basename in case original file was in a subdirectory or something. + doit("ln","-sf","changelog","$TMP/usr/doc/$PACKAGE/".Dh_Lib::basename($upstream)); + } } } diff --git a/dh_installchangelogs.1 b/dh_installchangelogs.1 index 9a579a6..815c2dd 100644 --- a/dh_installchangelogs.1 +++ b/dh_installchangelogs.1 @@ -3,7 +3,7 @@ dh_installchangelogs \- install changelogs into package build directories .SH SYNOPSIS .B dh_installchangelogs -.I "[debhelper options] [upstream]" +.I "[debhelper options] [-k] [upstream]" .SH "DESCRIPTION" dh_installchangelogs is a debhelper program that is responsible for installing changelogs into package build directories. @@ -25,6 +25,13 @@ See .BR debhelper (1) for a list of options common to all debhelper commands. .TP +.B \-k, \--keep +Keep the original name of the upstream changelog. This will be accomplished +by installing the upstream changelog as "changelog", and making a symlink from +that to the original name of the changelog file. This can be useful if the +upstream changelog has an unusual name, or if other documentation in the +package refers to the changelog file. +.TP .B upstream Install this file as the upstream changelog. .SH NOTES diff --git a/dh_shlibdeps b/dh_shlibdeps index e30c4a5..f7ac601 100755 --- a/dh_shlibdeps +++ b/dh_shlibdeps @@ -1,24 +1,28 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Find dependancies. Simple dpkg-shlibdeps wrapper. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - EXT=`pkgext $PACKAGE` +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $EXT=pkgext($PACKAGE); - # Run dpkg-shlibdeps to generate dependancies. - filelist="" - for file in `find $TMP -type f \( -perm +111 -or -name "*.so*" \) | tr "\n" " "` ; do - case "`file $file`" in - *ELF*) - filelist="$file $filelist" - ;; - esac - done - if [ "$filelist" ]; then - doit "dpkg-shlibdeps -Tdebian/${EXT}substvars $DH_U_PARAMS $filelist" - fi -done + my @filelist; + my $ff; + + # Generate a list of all ELF binaries in the package. + foreach $file (split(/\n/,`find $TMP -type f \\( -perm +111 -or -name "*.so*" \\)`)) { + # TODO: this is slow, optimize. Ie, file can run once on multiple files.. + $ff=`file $file`; + if ($ff=~m/ELF/) { + push @filelist,$file; + } + } + + if (@filelist) { + doit("dpkg-shlibdeps","-Tdebian/$EXT\substvars",@{$dh{U_PARAMS}},@filelist); + } +} diff --git a/dh_testdir b/dh_testdir index 4e482fc..0cb95c1 100755 --- a/dh_testdir +++ b/dh_testdir @@ -1,14 +1,15 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Checks to make sure we are building the package in the right directory. # Tests for the existance of debian/control, and for the existance # of any other files you specify on the command line. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -for file in debian/control $@; do - if [ ! -e "$file" ] ; then - error "\"$file\" not found. Are you sure you are in the correct directory?" - fi -done +foreach $file ('debian/control',@ARGV) { + if (! -e $file) { + error("\"$file\" not found. Are you sure you are in the correct directory?"); + } +} diff --git a/dh_testdir.1 b/dh_testdir.1 index 309a7d9..43c7439 100644 --- a/dh_testdir.1 +++ b/dh_testdir.1 @@ -24,7 +24,5 @@ See for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) -.SH BUGS -Files with spaces in their names will not be processed correctly. .SH AUTHOR Joey Hess diff --git a/dh_testroot b/dh_testroot index c704109..629b8f8 100755 --- a/dh_testroot +++ b/dh_testroot @@ -1,12 +1,13 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Checks to make sure you are root. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); # Test for uid = 0, not username of root, becuase # some people rename root. -if [ "`id -u`" != 0 ]; then - error "You must run this as root." -fi +if ($< != 0) { + error("You must run this as root."); +} -- 2.39.5