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.
+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
=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.
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
+library. It may be necessary for you to add some version dependency
information to the shlibs file. If B<-V> is specified with no dependency
information, the current upstream version of the package is plugged into a
-dependency that looks like "I<packagename> B<(=E<gt>> I<packageversion>B<)>". Note that in
+dependency that looks like "I<packagename> B<(E<gt>>= I<packageversion>B<)>". Note that in
debhelper compatibility levels before v4, the Debian part of the package
version number is also included. If B<-V> is specified with parameters, the
parameters can be used to specify the exact dependency information needed
"add-udeb=s" => \$dh{SHLIBS_UDEB},
});
-my $od = "objdump";
-# cross-compiling?
-if (dpkg_architecture_value("DEB_BUILD_GNU_TYPE")
- ne dpkg_architecture_value("DEB_HOST_GNU_TYPE")) {
- $od=dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "-objdump";
-}
+my $objdump=cross_command("objdump");
+my $multiarch=dpkg_architecture_value("DEB_HOST_MULTIARCH");
foreach my $package (@{$dh{DOPACKAGES}}) {
next if is_udeb($package);
my %seen;
my $need_ldconfig = 0;
+ my $is_multiarch = 0;
doit("rm", "-f", "$tmp/DEBIAN/shlibs");
# So, we look for files or links to existing files with names that
# match "*.so.*". And we only look at real files not
- # symlinks, so we don't accidentually add shlibs data to -dev
+ # symlinks, so we don't accidentally add shlibs data to -dev
# packages. This may have a few false positives, which is ok,
# because only if we can get a library name and a major number from
# objdump is anything actually added.
while (<FIND>) {
my ($library, $major);
push @lib_files, $_;
- my $objdump=`$od -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;
$deps=$dh{V_FLAG};
}
else {
- # Call isnative becuase it sets $dh{VERSION}
+ # Call isnative because it sets $dh{VERSION}
# as a side effect.
isnative($package);
my $version = $dh{VERSION};
doit("rm", "-f", "$tmp/DEBIAN/symbols");
}
}
+ if ($is_multiarch) {
+ addsubstvar($package, "misc:Pre-Depends", "multiarch-support");
+ }
}
=head1 SEE ALSO