]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_makeshlibs
Don't add package name to libexecdir in v9
[debhelper.git] / dh_makeshlibs
index c52ef7d5e66dbff38632824f49fd92ee2c5d8ac9..9880211df100f02f71b7e95ba18a215a24a7bf26 100755 (executable)
@@ -21,6 +21,11 @@ libraries, and generates a shlibs file for the libraries it finds.
 It also adds a call to ldconfig in the F<postinst> and F<postrm> scripts (in
 v3 mode and above only) to any packages in which it finds shared libraries.
 
+In v9 mode and above, packages that support multiarch are detected, and
+a Pre-Dependency on multiarch-support is set in ${misc:Pre-Depends} ;
+you should make sure to put that token into an appropriate place in your
+debian/control file for packages supporting multiarch.
+
 =head1 FILES
 
 =over 4
@@ -41,7 +46,7 @@ to provide different symbols files for different architectures.
 
 =item B<-m>I<major>, B<--major=>I<major>
 
-Instead of trying to guess the major number of the library with /postobjdump,
+Instead of trying to guess the major number of the library with objdump,
 use the major number specified after the -m parameter. This is much less
 useful than it used to be, back in the bad old days when this program
 looked at library filenames rather than using objdump.
@@ -93,7 +98,7 @@ Pass I<params> to L<dpkg-gensymbols(1)>.
 
 =over 4
 
-=item B<dh_makeshlibsW
+=item B<dh_makeshlibs>
 
 Assuming this is a package named F<libfoobar1>, generates a shlibs file that
 looks something like:
@@ -121,6 +126,9 @@ init(options => {
        "add-udeb=s" => \$dh{SHLIBS_UDEB},
 });
 
+my $objdump=cross_command("objdump");
+my $multiarch=dpkg_architecture_value("DEB_HOST_MULTIARCH");
+
 foreach my $package (@{$dh{DOPACKAGES}}) {
        next if is_udeb($package);
        
@@ -128,6 +136,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 
        my %seen;
        my $need_ldconfig = 0;
+       my $is_multiarch = 0;
 
        doit("rm", "-f", "$tmp/DEBIAN/shlibs");
 
@@ -146,13 +155,16 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
        while (<FIND>) {
                my ($library, $major);
                push @lib_files, $_;
-               my $objdump=`objdump -p $_`;
-               if ($objdump=~m/\s+SONAME\s+(.+)\.so\.(.+)/) {
+               if (defined $multiarch && $multiarch ne '' && m,/$multiarch/,) {
+                       $is_multiarch=1;
+               }
+               my $ret=`$objdump -p $_`;
+               if ($ret=~m/\s+SONAME\s+(.+)\.so\.(.+)/) {
                        # proper soname format
                        $library=$1;
                        $major=$2;
                }
-               elsif ($objdump=~m/\s+SONAME\s+(.+)-(.+)\.so/) {
+               elsif ($ret=~m/\s+SONAME\s+(.+)-(.+)\.so/) {
                        # idiotic crap soname format
                        $library=$1;
                        $major=$2;
@@ -238,6 +250,9 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                        doit("rm", "-f", "$tmp/DEBIAN/symbols");
                }
        }
+       if ($is_multiarch) {
+               addsubstvar($package, "misc:Pre-Depends", "multiarch-support");
+       }
 }
 
 =head1 SEE ALSO