]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_makeshlibs
r1655: * Added udeb support, as pioneered by di-packages-build. Understands
[debhelper.git] / dh_makeshlibs
index 01dd082f82a8a668ec3cc0b4b7610aaca3ffb579..1d57b01eb0842c603d6c62a09abc131a96c900b2 100755 (executable)
@@ -11,7 +11,7 @@ use Debian::Debhelper::Dh_Lib;
 
 =head1 SYNOPSIS
 
-  dh_makeshlibs [debhelper options] [-mmajor] [-V[dependancies]] [-n] [-Xitem]
+B<dh_makeshlibs> [S<I<debhelper options>>] [B<-m>I<major>] [B<-V>I<[dependancies]>] [B<-n>] [B<-X>I<item>]
 
 =head1 DESCRIPTION
 
@@ -19,8 +19,7 @@ dh_makeshlibs is a debhelper program that automatically scans for shared
 libraries, and generates a shlibs file for the libraries it finds.
 
 It also adds a call to ldconfig in the postinst and postrm scripts (in
-DH_COMPAT=3 mode and above only) to any packages which it finds shared
-libraries in.
+V3 mode and above only) to any packages which it finds shared libraries in.
 
 =head1 OPTIONS
 
@@ -58,8 +57,8 @@ Do not modify postinst/postrm scripts.
 
 =item B<-X>I<item>, B<--exclude=>I<item>
 
-Exclude files that contain "item" anywhere in their filename from
-being treated as shared libraries.
+Exclude files that contain "item" anywhere in their filename or directory 
+from being treated as shared libraries.
 
 =back
 
@@ -87,6 +86,8 @@ Generates a shlibs file that looks something like:
 init();
 
 foreach my $package (@{$dh{DOPACKAGES}}) {
+       next if is_udeb($package);
+       
        my $tmp=tmpdir($package);
 
        my %seen;
@@ -105,7 +106,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
        if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
                $exclude="! \\( $dh{EXCLUDE_FIND} \\) ";
        }
-       open (FIND, "find $tmp -type f -name '*.so*' $exclude |");
+       open (FIND, "find $tmp -type f \\( -name '*.so' -or -name '*.so.*' \\) $exclude |");
        while (<FIND>) {
                my ($library, $major);
                my $objdump=`objdump -p $_`;
@@ -136,7 +137,14 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                                # Call isnative becuase it sets $dh{VERSION}
                                # as a side effect.
                                isnative($package);
-                               $deps="$package (>= $dh{VERSION})";
+                               my $version = $dh{VERSION};
+                               # Old compatability levels include the
+                               # debian revision, while new do not.
+                               if (! compat(3)) {
+                                       # Remove debian version, if any.
+                                       $version =~ s/-[^-]+$//;
+                               }
+                               $deps="$package (>= $version)";
                        }
                }
                if (defined($library) && defined($major) && defined($deps) &&
@@ -160,13 +168,13 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 
        if (-e "$tmp/DEBIAN/shlibs") {
                doit("chmod",644,"$tmp/DEBIAN/shlibs");
-               doit("chown","0.0","$tmp/DEBIAN/shlibs");
+               doit("chown","0:0","$tmp/DEBIAN/shlibs");
        }
 }
 
 =head1 SEE ALSO
 
-L<debhelper(1)>
+L<debhelper(7)>
 
 This program is a part of debhelper.