diff -Nru /tmp/fileWVHuCa/debhelper-4.1.74/Debian/Debhelper/Dh_Lib.pm /tmp/fileSIhV2a/debhelper-4.1.74/Debian/Debhelper/Dh_Lib.pm --- /tmp/fileWVHuCa/debhelper-4.1.74/Debian/Debhelper/Dh_Lib.pm 2003-08-22 14:47:52.000000000 -0400 +++ /tmp/fileSIhV2a/debhelper-4.1.74/Debian/Debhelper/Dh_Lib.pm 2003-09-27 17:00:13.000000000 -0400 @@ -13,7 +13,7 @@ @EXPORT=qw(&init &doit &complex_doit &verbose_print &error &warning &tmpdir &pkgfile &pkgext &pkgfilename &isnative &autoscript &filearray &filedoublearray &GetPackages &basename &dirname &xargs %dh - &compat &addsubstvar &delsubstvar &excludefile); + &compat &addsubstvar &delsubstvar &excludefile &Get64Packages); my $max_compat=4; @@ -72,6 +72,17 @@ $dh{NO_ACT}=1; } + my $lib64_arch=`dpkg-libinfo -qDEB_LIB64_ARCH`; + $dh{LIB64_ARCH}=$lib64_arch; + + my $libname=`dpkg-libinfo -qDEB_LIBNAME`; + chomp $libname; + $dh{LIBNAME}=$libname; + + my $libdir=`dpkg-libinfo -qDEB_LIBDIR`; + chomp $libdir; + $dh{LIBDIR}=$libdir; + my @allpackages=GetPackages(); # Get the name of the main binary package (first one listed in # debian/control). Only if the main package was not set on the @@ -89,6 +100,12 @@ push @{$dh{DOPACKAGES}},@allpackages; } + my %dualPackages=GetDualPackages(); + # Get dual packages of 64 bit packages. + if (! defined $dh{DUALPACKAGES} || ! @{$dh{DUALPACKAGES}}) { + %{$dh{DUALPACKAGES}}=%dualPackages; + } + # Check to see if -P was specified. If so, we can only act on a single # package. if ($dh{TMPDIR} && $#{$dh{DOPACKAGES}} > 0) { @@ -304,6 +321,9 @@ elsif ($package eq $dh{MAINPACKAGE} && -f "debian/$filename") { return "debian/$filename"; } + elsif (defined($dh{DUALPACKAGES}{$dh{MAINPACKAGE}}) && $package eq $dh{DUALPACKAGES}{$dh{MAINPACKAGE}} && -f "debian/$filename") { + return "debian/$filename"; + } else { return ""; } @@ -475,11 +495,15 @@ sub filedoublearray { my $file=shift; my $globdir=shift; + my $libname=$dh{LIBNAME}; + my $libdir=$dh{LIBDIR}; my @ret; open (DH_FARRAY_IN, $file) || error("cannot read $file: $1"); while () { my @line; + $_ =~ s/\${libname}/$libname/g; + $_ =~ s/\${libdir}/$libdir/g; # Only do glob expansion in v3 mode. # # The tricky bit is that the glob expansion is done @@ -545,9 +569,11 @@ } my $package=""; + my $package64=""; my $arch=""; my @list=(); my %seen; + my $lib64_arch=`dpkg-libinfo -qDEB_LIB64_ARCH`; open (CONTROL, 'debian/control') || error("cannot read debian/control: $!\n"); while () { @@ -563,6 +589,9 @@ error("debian/control has a duplicate entry for $package"); } } + if (/^Package.64:\s*(.*)/) { + $package64=$1; + } if (/^Architecture:\s*(.*)/) { $arch=$1; } @@ -573,8 +602,13 @@ ($type eq 'arch' && $arch ne 'all') || ($type eq 'same' && ($arch eq 'any' || $arch =~ /\b$buildarch\b/)) || ! $type)) { - push @list, $package; + if ($package64 && $lib64_arch) { + push @list, $package64; + } else { + push @list, $package; + } $package=""; + $package64=""; $arch=""; } } @@ -584,4 +618,43 @@ return @list; } +# Returns a hash of the dual packages of the 64 bit packages in the +# control file. +sub GetDualPackages { + my $package=""; + my $package64=""; + my %dualPackages; + my %seen; + open (CONTROL, 'debian/control') || + error("cannot read debian/control: $!\n"); + while () { + chomp; + s/\s+$//; + if (/^Package:\s*(.*)/) { + $package=$1; + # Detect duplicate package names in the same control file. + if (! $seen{$package}) { + $seen{$package}=1; + } + else { + error("debian/control has a duplicate entry for $package"); + } + } + if (/^Package.64:\s*(.*)/) { + $package64=$1; + } + + if (!$_ or eof) { # end of stanza. + if ($package && $package64) { + $dualPackages{$package64} = $package; + $package=""; + $package64=""; + } + } + } + close CONTROL; + + return %dualPackages; +} + 1 diff -Nru /tmp/fileWVHuCa/debhelper-4.1.74/debian/changelog /tmp/fileSIhV2a/debhelper-4.1.74/debian/changelog --- /tmp/fileWVHuCa/debhelper-4.1.74/debian/changelog 2003-09-21 18:56:54.000000000 -0400 +++ /tmp/fileSIhV2a/debhelper-4.1.74/debian/changelog 2003-09-27 17:00:40.000000000 -0400 @@ -1,3 +1,9 @@ +debhelper (4.1.74-lib64.1) unstable; urgency=low + + * applied Gerhard Tonn's lib64 parch. + + -- Bart Trojanowski Sat, 27 Sep 2003 17:00:37 -0400 + debhelper (4.1.74) unstable; urgency=low * Only list dh_installman once in example rules.indep. Closes: #211567 diff -Nru /tmp/fileWVHuCa/debhelper-4.1.74/dh_install /tmp/fileSIhV2a/debhelper-4.1.74/dh_install --- /tmp/fileWVHuCa/debhelper-4.1.74/dh_install 2003-08-03 11:34:21.000000000 -0400 +++ /tmp/fileSIhV2a/debhelper-4.1.74/dh_install 2003-09-27 16:57:30.000000000 -0400 @@ -109,6 +109,11 @@ foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); my $file=pkgfile($package,"install"); +# my $libname=$dh{LIBNAME}; + + if ($dh{LIB64_ARCH} && defined($dh{DUALPACKAGES}{$package})) { + $file=pkgfile($dh{DUALPACKAGES}{$package},"install"); + } my @install; if ($file) { @@ -131,8 +136,10 @@ if (! defined $dh{AUTODEST} && @$set > 1) { $dest=pop @$set; +# $dest =~ s/\${libname}/${libname}/; } # glob now, relative to srcdir +# foreach my $src (map { s/\${libname}/${libname}/; glob "$srcdir/$_"} @$set) { foreach my $src (map { glob "$srcdir/$_" } @$set) { next if excludefile($src); diff -Nru /tmp/fileWVHuCa/debhelper-4.1.74/dh_installdirs /tmp/fileSIhV2a/debhelper-4.1.74/dh_installdirs --- /tmp/fileWVHuCa/debhelper-4.1.74/dh_installdirs 2003-07-28 15:28:03.000000000 -0400 +++ /tmp/fileSIhV2a/debhelper-4.1.74/dh_installdirs 2003-09-27 16:57:30.000000000 -0400 @@ -53,6 +53,10 @@ my $tmp=tmpdir($package); my $file=pkgfile($package,"dirs"); + if ($dh{LIB64_ARCH} && defined($dh{DUALPACKAGES}{$package})) { + $file=pkgfile($dh{DUALPACKAGES}{$package},"dirs"); + } + if (! -e $tmp) { doit("install","-d",$tmp); } diff -Nru /tmp/fileWVHuCa/debhelper-4.1.74/dh_link /tmp/fileSIhV2a/debhelper-4.1.74/dh_link --- /tmp/fileWVHuCa/debhelper-4.1.74/dh_link 2003-08-22 12:48:15.000000000 -0400 +++ /tmp/fileSIhV2a/debhelper-4.1.74/dh_link 2003-09-27 16:57:30.000000000 -0400 @@ -81,6 +81,11 @@ foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); my $file=pkgfile($package,"links"); +# my $libname=$dh{LIBNAME}; + + if ($dh{LIB64_ARCH} && defined($dh{DUALPACKAGES}{$package})) { + $file=pkgfile($dh{DUALPACKAGES}{$package},"links"); + } my @links; if ($file) { @@ -128,6 +133,9 @@ my $dest=pop @links; my $src=pop @links; +# $dest =~ s/\${libname}/${libname}/; +# $src =~ s/\${libname}/${libname}/; + # Relavatize src and dest. $src=~s:^/::; $dest=~s:^/::; diff -Nru /tmp/fileWVHuCa/debhelper-4.1.74/dh_movefiles /tmp/fileSIhV2a/debhelper-4.1.74/dh_movefiles --- /tmp/fileWVHuCa/debhelper-4.1.74/dh_movefiles 2003-07-28 15:27:07.000000000 -0400 +++ /tmp/fileSIhV2a/debhelper-4.1.74/dh_movefiles 2003-09-27 16:57:30.000000000 -0400 @@ -74,6 +74,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); my $files=pkgfile($package,"files"); +# my $libname=$dh{LIBNAME}; my $sourcedir="debian/tmp"; if ($dh{SOURCEDIR}) { @@ -87,6 +88,10 @@ error("$sourcedir does not exist."); } + if ($dh{LIB64_ARCH} && defined($dh{DUALPACKAGES}{$package})) { + $files=pkgfile($dh{DUALPACKAGES}{$package},"files"); + } + my @tomove; # debian/files has a different purpose, so ignore it. @@ -126,6 +131,7 @@ doit("rm","-f","debian/movelist"); foreach (@tomove) { my $file=$_; +# $file =~ s/\$libname/$libname/; if (! -e $file && ! -l $file && ! $dh{NO_ACT}) { $ret=1; warning("$file not found (supposed to put it in $package)"); diff -Nru /tmp/fileWVHuCa/debhelper-4.1.74/dh_prep /tmp/fileSIhV2a/debhelper-4.1.74/dh_prep --- /tmp/fileWVHuCa/debhelper-4.1.74/dh_prep 1969-12-31 19:00:00.000000000 -0500 +++ /tmp/fileSIhV2a/debhelper-4.1.74/dh_prep 2003-09-27 16:57:30.000000000 -0400 @@ -0,0 +1,47 @@ +#! /usr/bin/perl + +=head1 NAME + +dh_prep - preprocesses debhelper files + +=cut + +use strict; +use Debian::Debhelper::Dh_Lib; + +=head1 SYNOPSIS + +B + +=head1 DESCRIPTION + +dh_prep is a debhelper program that preprocesses debhelper files. + +dh_prep parses all .files.in, .dirs.in, .link.in and .install.in files +in the debian subdirectory, substitutes the variables ${libname} and +${libdir} by the actual values provided by dpkg-libinfo and writes the +preprocessed source to the appropriate .files, .dirs, .link and .install +files. + +=cut + +use File::Basename; + +init(); + +my $libname=$dh{LIBNAME}; +my $libdir=$dh{LIBDIR}; + +foreach my $file (`ls debian/*.files.in debian/*.dirs.in debian/*.links.in debian/*.install.in 2>/dev/null`) { + my $basefile = basename($file, ".in"); + open(DHFIN,"< $file") || die "$file: $!"; + open(DHF,"> debian/$basefile") || die "debian/$basefile: $!"; + while () { + chomp; + s/\${libname}/$libname/g; + s/\${libdir}/$libdir/g; + print(DHF "$_\n"); + } + close DHF; + close DHFIN; +}