The following commit has been merged in the master branch:
commit d5a241efa43d36cda2c234f0946978e7a04c078f
Author: Russ Allbery <r...@debian.org>
Date:   Sat Dec 27 00:50:40 2008 -0800

    Check specifically for shlibs with unversioned SONAMEs
    
    * checks/shared-libs{,.desc}:
      + [RA] Remove special shlibs exception for NSS modules.  libc6 now
        includes shlibs entries for them.
      + [RA] Report a more specialized tag for shared libraries with SONAMEs
        that have no version and exclude them from the shlibs and symbols
        file tests since they cannot be represented there.  Reported by
        Raphael Hertzog.  (Closes: #506673)

diff --git a/checks/shared-libs b/checks/shared-libs
index f8e4a9e..2b3033d 100644
--- a/checks/shared-libs
+++ b/checks/shared-libs
@@ -244,7 +244,21 @@ $provides = Dep::parse($provides);
 my %shlibs_control;
 my %symbols_control;
 
-...@shlibs = grep { !m,^lib/libnss_[^.]+\.so(\.[0-9]+)$, } keys %SONAME;
+# Libraries with no version information can't be represented by the shlibs and
+# symbols format and are on their own, but we can warn about that if they
+# appear in public directories.  If they're in private directories, assume
+# they're plugins and ignore them.
+my %unversioned_shlibs;
+for (keys %SONAME) {
+    my $soname = $SONAME{$_};
+    if ($soname !~ /\.so\.[0-9]+/ and $soname !~ /.+-\w[\w\.]*\.so$/) {
+       $unversioned_shlibs{$_} = 1;
+       tag 'shlib-without-versioned-soname', $_, $soname
+           if $ldconfig_dirs->known(dirname($_));
+    }
+}
+...@shlibs = grep { !$unversioned_shlibs{$_} } keys %SONAME;
+
 if ($#shlibs == -1) {
     # no shared libraries included in package, thus shlibs control file should
     # not be present
diff --git a/checks/shared-libs.desc b/checks/shared-libs.desc
index f42075a..8217c97 100644
--- a/checks/shared-libs.desc
+++ b/checks/shared-libs.desc
@@ -33,6 +33,26 @@ Info: The listed shared libraries contain object code that 
was compiled
  case, follow the procedure outlined in Policy and then please document
  the exception by adding a lintian override to this package.
 
+Tag: shlib-without-versioned-soname
+Severity: normal
+Certainty: possible
+Ref: policy 10.2, policy 8.6
+Info: The listed shared library in a public library directory has an
+ SONAME that does not contain any versioning information, either after the
+ <tt>.so</tt> or before it and set off by a hyphen.  It cannot therefore
+ be represented in the shlibs system, and if linked by binaries its
+ interface cannot safely change.  There is no backward-compatible way to
+ migrate programs linked against it to a new ABI.
+ .
+ Normally, this means the shared library is a private library for a
+ particular application and is not meant for general use.  Policy
+ recommends that such libraries be installed in a subdirectory of
+ <tt>/usr/lib</tt> rather than in a public shared library directory.
+ .
+ There are some special stub libraries or special-purpose shared objects
+ for which an ABI version is not meaningful.  If this is one of those
+ cases, please add an override.
+
 Tag: ldconfig-symlink-missing-for-shlib
 Severity: important
 Certainty: certain
diff --git a/debian/changelog b/debian/changelog
index 2fb12b5..a7e6f7d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,7 @@ lintian (2.1.3) UNRELEASED; urgency=low
       - debian-watch-file-specifies-wrong-upstream-version
       - debian-watch-file-specifies-old-upstream-version
       - extended-description-is-probably-too-short
+      - shlib-without-versioned-soname
 
   * checks/description{,.desc}:
     + [RA] Check for extended descriptions shorter than three lines; they
@@ -28,6 +29,13 @@ lintian (2.1.3) UNRELEASED; urgency=low
       - Detect watch files specifying an upstream version for an older
         changelog entry when the current changelog entry has a newer
         upstream version.
+  * checks/shared-libs{,.desc}:
+    + [RA] Remove special shlibs exception for NSS modules.  libc6 now
+      includes shlibs entries for them.
+    + [RA] Report a more specialized tag for shared libraries with SONAMEs
+      that have no version and exclude them from the shlibs and symbols
+      file tests since they cannot be represented there.  Reported by
+      Raphael Hertzog.  (Closes: #506673)
   * checks/version-substvars:
     + [RA] Skip version substvar checks when the dependency is on a
       package whose name is formed by expanding substvars at build time.
diff --git a/testset/libbaz/Makefile b/testset/libbaz/Makefile
index b388b8c..1025aaf 100644
--- a/testset/libbaz/Makefile
+++ b/testset/libbaz/Makefile
@@ -11,7 +11,8 @@ ifneq ($(DEB_HOST_ARCH),i386)
 NOPICOBJS = $(SHOBJS)
 endif
 
-all: libbaz1.a libbaz2.a libbaz1.so.1.0.3b libbaz2.so libbaz3.so.1.0.3b
+all: libbaz1.a libbaz2.a libbaz1.so.1.0.3b libbaz2.so libbaz3.so.1.0.3b \
+       libbaz.so
 
 libbaz2.so: libbaz2.so.1.0
        ln -sf $^ $@
@@ -29,6 +30,10 @@ libbaz2.so.1.0.3b: $(SHOBJS)
 libbaz3.so.1.0.3b: $(NOPICOBJS)
        $(CC) -o $@ -shared -Wl,-soname,libbaz3.so.1 $^ -lc
 
+# Non-versioned SONAME.
+libbaz.so: $(SHOBJS)
+       $(CC) -o $@ -shared -Wl,-soname,libbaz.so $^ -lc
+
 #%.o-noreentrant: %.c
 #      $(CC) $(CFLAGS) -o $@ -c $<
 
diff --git a/testset/libbaz/debian/rules b/testset/libbaz/debian/rules
index ad4be16..8ed2bb0 100755
--- a/testset/libbaz/debian/rules
+++ b/testset/libbaz/debian/rules
@@ -74,6 +74,9 @@ binary-arch: build binary-correct
        ln -s libfoo.so.0.9.1 $(lib_tmp)/usr/lib/libfoo.so.0.9
        # And a plain .so (wrong, TODO)
        touch $(lib_tmp)/usr/lib/libbar2.so
+       # And a non-versioned SONAME.
+       install -m644 libbaz.so $(lib_tmp)/usr/lib/libbaz.so
+       strip --remove-section=.comment --strip-unneeded 
$(lib_tmp)/usr/lib/libbaz.so
        # Pretend to be a Perl module to test a lack of Perl dependencies.
        install -d $(lib_tmp)/usr/lib/perl5/auto/Foo
        install -m 644 libbaz2.so.1.0.3b 
$(lib_tmp)/usr/lib/perl5/auto/Foo/Foo.so
diff --git a/testset/tags.libbaz b/testset/tags.libbaz
index 825afd9..f9c3c39 100644
--- a/testset/tags.libbaz
+++ b/testset/tags.libbaz
@@ -45,10 +45,11 @@ W: libbaz source: substvar-source-version-is-deprecated 
libbaz2-dev
 W: libbaz1-dev: dev-package-should-be-section-libdevel libbaz1-dev
 W: libbaz1: missing-depends-line
 W: libbaz1: new-package-should-close-itp-bug
-W: libbaz1: package-name-doesnt-match-sonames libbaz2-1.0 libbaz3-1
+W: libbaz1: package-name-doesnt-match-sonames libbaz libbaz2-1.0 libbaz3-1
 W: libbaz1: postinst-should-not-set-usr-doc-link
 W: libbaz1: shlib-missing-in-symbols-control-file libbaz2 1.0 for 
usr/lib/libfoo2.so.1.0.3b
 W: libbaz1: shlib-missing-in-symbols-control-file libbaz3 1 for 
usr/lib/libbaz3.so.1.0.3b
+W: libbaz1: shlib-without-versioned-soname usr/lib/libbaz.so libbaz.so
 W: libbaz1: shlibs-declares-dependency-on-other-package libbaz1 (>> 1-1)
 W: libbaz1: shlibs-declares-dependency-on-other-package libbaz2
 W: libbaz1: symbols-file-contains-debian-revision on symbol foo

-- 
Debian package checker


-- 
To UNSUBSCRIBE, email to debian-lint-maint-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to