Author: rra
Date: 2008-03-04 22:20:41 +0100 (Tue, 04 Mar 2008)
New Revision: 1248

Added:
   trunk/data/shared-libs/
   trunk/data/shared-libs/ldconfig-dirs
Modified:
   trunk/checks/shared-libs
   trunk/debian/changelog
Log:
* checks/shared-libs:
  + [RA] Move the default ld.so search path into data.  Drop obsolete
    /usr/lib/libg++-dbg, /usr/X11R6/lib/Xaw3d, and libc5 compatibility
    directories in the process.
* data/shared-libs/ldconfig-dirs:
  + [RA] New file listing directories searched by ld.so.

Modified: trunk/checks/shared-libs
===================================================================
--- trunk/checks/shared-libs    2008-03-04 21:13:58 UTC (rev 1247)
+++ trunk/checks/shared-libs    2008-03-04 21:20:41 UTC (rev 1248)
@@ -20,30 +20,16 @@
 
 package Lintian::shared_libs;
 use strict;
+
+use File::Basename;
+
+use Lintian::Data;
 use Dep;
 use Tags;
-use File::Basename;
 use Util;
 
 sub run {
 
-my %ldso_dir = map { $_ => 1 }
-    qw( lib
-       lib32
-       lib64
-        usr/lib
-       usr/lib32
-       usr/lib64
-        usr/lib/libg++-dbg
-        usr/X11R6/lib/Xaw3d
-        usr/local/lib
-        usr/X11R6/lib
-        usr/lib/libc5-compat
-        lib/libc5-compat
-       emul/ia32-linux/lib
-       emul/ia32-linux/usr/lib
-      );
-
 # Libraries that should only be used in the presence of certain capabilities
 # may be located in subdirectories of the standard ldconfig search path with
 # one of the following names.
@@ -63,6 +49,7 @@
        sparc
       );
 
+my $ldconfig_dirs = Lintian::Data->new('shared-libs/ldconfig-dirs');
 my $file;
 my $must_call_ldconfig;
 my $postrm = "control/postrm";
@@ -198,7 +185,7 @@
            $last = $1;
        } while ($last && $hwcap_dir{$last});
        $dirname .= "/$last" if $last;
-       if (exists $ldso_dir{$dirname}) {
+       if ($ldconfig_dirs->known($dirname)) {
            # yes! so postinst must call ldconfig
            $must_call_ldconfig = $real_file;
        }
@@ -219,9 +206,9 @@
                tag "shlib-with-executable-stack", $cur_file;
            }
        }
-    } elsif (exists $objsomething{$cur_file} &&
-            exists $ldso_dir{dirname($cur_file)} &&
-            exists $sharedobject{$cur_file}) {
+    } elsif (exists $objsomething{$cur_file}
+            && $ldconfig_dirs->known(dirname($cur_file))
+            && exists $sharedobject{$cur_file}) {
        tag "sharedobject-in-library-directory-missing-soname", "$cur_file";
     }
 }
@@ -238,7 +225,7 @@
     my ($dir, $shlib_name) = $shlib_file =~ m,(.*)/([^/]+)$,;
 
     # not a public shared library, skip it
-    next unless defined $ldso_dir{$dir};
+    next unless $ldconfig_dirs->known($dir);
 
     # symlink found?
     my $link_file = "$dir/$SONAME{$shlib_file}";
@@ -313,7 +300,7 @@
        if ($type ne 'udeb') {
            for my $shlib (@shlibs) {
                # skip it if it's not a public shared library
-               next unless defined $ldso_dir{dirname($shlib)};
+               next unless $ldconfig_dirs->known(dirname($shlib));
                tag "no-shlibs-control-file", "$shlib";
            }
        }
@@ -357,7 +344,7 @@
            $shlibs_control_used{"udeb: ".$shlib_name} = 1;
            unless (exists $shlibs_control{$shlib_name}) {
                # skip it if it's not a public shared library
-               next unless defined $ldso_dir{dirname($shlib)};
+               next unless $ldconfig_dirs->known(dirname($shlib));
                # no!!
                tag "shlib-missing-in-control-file", $shlib_name, 'for', $shlib;
            }

Added: trunk/data/shared-libs/ldconfig-dirs
===================================================================
--- trunk/data/shared-libs/ldconfig-dirs                                (rev 0)
+++ trunk/data/shared-libs/ldconfig-dirs        2008-03-04 21:20:41 UTC (rev 
1248)
@@ -0,0 +1,31 @@
+# The list of directories searched by default by the dynamic linker.
+# Packages installing shared libraries into these directories must call
+# ldconfig, must have shlibs files, and must ensure those libraries have
+# proper SONAMEs.
+#
+# Directories listed here must not have leading slashes.
+
+# Standard library directories.
+lib
+usr/lib
+usr/local/lib
+
+# For 32-bit/64-bit multiarch support.
+lib32
+lib64
+usr/lib32
+usr/lib64
+
+# Used by the Debian amd64 port for 32-bit libraries.
+emul/ia32-linux/lib
+emul/ia32-linux/usr/lib
+
+# This is now obsolete, but is still in the standard ld.so.conf.
+usr/X11R6/lib
+
+# We intentionally do not include the multiarch directories like
+# /lib/i486-linux-gnu since libraries installed there may be only for
+# cross-compilation and not intended for the host operating system.  To
+# determine whether they're for the host, we'd need to apply more complex
+# logic to map the architecture of the Debian package to the appropriate
+# multiarch directory name.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2008-03-04 21:13:58 UTC (rev 1247)
+++ trunk/debian/changelog      2008-03-04 21:20:41 UTC (rev 1248)
@@ -2,7 +2,14 @@
 
   * checks/scripts:
     + [RA] Attempt to quash some Perl warnings.
+  * checks/shared-libs:
+    + [RA] Move the default ld.so search path into data.  Drop obsolete
+      /usr/lib/libg++-dbg, /usr/X11R6/lib/Xaw3d, and libc5 compatibility
+      directories in the process.
 
+  * data/shared-libs/ldconfig-dirs:
+    + [RA] New file listing directories searched by ld.so.
+
  -- Russ Allbery <[EMAIL PROTECTED]>  Tue, 04 Mar 2008 13:07:18 -0800
 
 lintian (1.23.46) unstable; urgency=low


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to