summaryrefslogtreecommitdiffstats
path: root/t/recipes/checks/libraries/shared/trigger/ldconfig
diff options
context:
space:
mode:
Diffstat (limited to 't/recipes/checks/libraries/shared/trigger/ldconfig')
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/changelog.in6
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/compat.in1
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/control58
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/copyright8
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/dev.postinst4
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/dev.prerm4
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.postinst10
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.prerm7
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.shlibs8
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.symbols3
-rwxr-xr-xt/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/rules121
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/source.lintian-overrides1
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/fill-values6
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/Makefile55
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/baz.c6
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/extra.c0
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/desc2
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/hints1
-rwxr-xr-xt/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/post-test4
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.install2
-rwxr-xr-xt/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.postinst6
-rwxr-xr-xt/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.postrm6
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.triggers1
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/compat.in1
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/control.in47
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.install1
-rwxr-xr-xt/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.preinst6
-rwxr-xr-xt/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.prerm6
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.symbols3
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.install1
-rwxr-xr-xt/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.postinst8
-rwxr-xr-xt/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.postrm8
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.symbols3
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.install1
-rwxr-xr-xt/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.postrm8
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.symbols3
-rwxr-xr-xt/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/rules21
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/fill-values5
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/Makefile22
-rwxr-xr-xt/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/app2
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/code.c15
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/eval/desc2
-rw-r--r--t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/eval/hints2
43 files changed, 485 insertions, 0 deletions
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/changelog.in b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/changelog.in
new file mode 100644
index 0000000..91a6bb5
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/changelog.in
@@ -0,0 +1,6 @@
+libbaz ([% $version %]) [% $distribution %]; urgency=low
+
+ * Initial setup
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org> Tue, 30 Jan 2001 15:23:59 -0800
+
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/compat.in
new file mode 100644
index 0000000..640a566
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/compat.in
@@ -0,0 +1 @@
+[% $dh_compat_level %]
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/control b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/control
new file mode 100644
index 0000000..1506687
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/control
@@ -0,0 +1,58 @@
+Source: libbaz
+Section: libs
+Priority: optional
+Maintainer: Lintian Maintainer <lintian-maint@debian.org>
+Build-depends: debhelper (>=4)
+Standards-Version: 3.2.1
+
+Package: libbaz1
+Architecture: any
+Provides: libbaz
+Description: test handling of library packages
+ Regression test for lintian's handling of libraries.
+ .
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package.
+
+Package: libbaz1-dev
+Architecture: any
+Depends: libbaz1 (= ${source:Version}), perlapi-5.8.8
+Description: development package
+ Regression test for lintian's handling of libraries (dev).
+ .
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package.
+
+Package: libbaz2
+Architecture: any
+Depends: ${shlibs:Depends}, libssl0.9.8
+Description: test handling of library packages (good)
+ Regression test for lintian's handling of libraries (good).
+ .
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package.
+
+Package: libbaz2-dev
+Architecture: any
+Depends: ${shlibs:Depends}, libbaz2 (= ${source:Version})
+Description: development package (good)
+ Regression test for lintian's handling of libraries (dev good).
+ .
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package.
+
+Package: libbaz2-dbg
+Architecture: any
+Depends: libbaz2 (= ${binary:Version})
+Priority: optional
+Description: debugging package
+ Regression test for lintian's handling of libraries (debug).
+ .
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package.
+
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/copyright b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/copyright
new file mode 100644
index 0000000..a874c87
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/copyright
@@ -0,0 +1,8 @@
+This package is released under public domain. This is distributed in the hope
+that it will be useful, but without any warranty; without even the implied
+warranty of merchantability or fitness for a particular purpose.
+
+A reference to /usr/share/common-licenses/GPL-2 to make it look like this
+package is under the GPL and trigger the OpenSSL warning.
+
+However, this has an OpenSSL exception.
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/dev.postinst b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/dev.postinst
new file mode 100644
index 0000000..683e3cc
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/dev.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh -e
+
+$PKG=libbaz1-dev
+
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/dev.prerm b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/dev.prerm
new file mode 100644
index 0000000..683e3cc
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/dev.prerm
@@ -0,0 +1,4 @@
+#!/bin/sh -e
+
+$PKG=libbaz1-dev
+
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.postinst b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.postinst
new file mode 100644
index 0000000..ec0b98a
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.postinst
@@ -0,0 +1,10 @@
+#!/bin/sh -e
+
+$PKG=libbaz1
+
+if [ "$1" = "configure" ]; then
+ if [ -d /usr/doc -a ! -e /usr/doc/$PKG -a -d /usr/share/doc/$PKG ]
+; then
+ ln -sf ../share/doc/$PKG /usr/doc/$PKG
+ fi
+fi
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.prerm b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.prerm
new file mode 100644
index 0000000..50e37c3
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.prerm
@@ -0,0 +1,7 @@
+#!/bin/sh -e
+
+$PKG=libbaz1
+
+if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/$PKG ]; then
+ rm -f /usr/doc/$PKG
+fi
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.shlibs b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.shlibs
new file mode 100644
index 0000000..b88e288
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.shlibs
@@ -0,0 +1,8 @@
+libdoesntexist2 1.0 libbaz1
+libdoesntexist2 1.0 libbaz1
+libbaz2 1.1 libbaz
+libbaz3 1 libbaz1 (>> 1-1)
+libbaz4 1 libbaz1 (= 1-1)
+libbaz5 1 libbaz2
+udeb: libdoesntexist2 1.0 libbaz2
+udeb: libdoesntexist2 1.0 libbaz2
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.symbols b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.symbols
new file mode 100644
index 0000000..72f9d8a
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.symbols
@@ -0,0 +1,3 @@
+libbaz.so.2 libbaz1 #MINVER#
+ pw 1-1
+ foo 1.1-1
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/rules b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/rules
new file mode 100755
index 0000000..fa99bc8
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/rules
@@ -0,0 +1,121 @@
+#!/usr/bin/make -f
+
+lib_tmp=debian/tmp-lib
+dev_tmp=debian/tmp-dev
+
+LIB=libbaz1
+DEV=libbaz1-dev
+
+VENDORARCH := $(shell perl -MConfig -wE'say substr($$Config{vendorarch},1)')
+
+build-arch:
+ $(MAKE)
+
+build-indep:
+
+build: build-arch build-indep
+
+clean:
+ $(MAKE) clean
+ dh_clean -plibbaz2 -plibbaz2-dev
+ rm -f debian/files debian/substvars
+ rm -rf $(lib_tmp) $(dev_tmp)
+
+# Now the correct libbaz2-dev package
+binary-correct:
+ install -d debian/libbaz2-dev/usr/lib
+ cp -a libbaz2.a libbaz2.so debian/libbaz2-dev/usr/lib
+ # usually, I'd also include some .h files to /usr/include
+
+ # Now the correct libbaz2 package
+ install -d debian/libbaz2/usr/lib
+ cp -a libbaz2.so.* debian/libbaz2/usr/lib
+ chmod a-x debian/libbaz2/usr/lib/*
+
+ # General stuff that is tested in other testsets:
+ dh_installdocs -plibbaz2 -plibbaz2-dev -plibbaz2-dbg
+ dh_compress -plibbaz2 -plibbaz2-dev -plibbaz2-dbg
+
+ # Mess up the libbaz2 changelog files to test the symlink handling.
+ ln -s /usr/share/doc/lintian/changelog.gz \
+ debian/libbaz2/usr/share/doc/libbaz2/changelog.gz
+ install -m 644 debian/changelog \
+ debian/libbaz2-dev/usr/share/doc/libbaz2-dev/foo
+ ln -s foo debian/libbaz2-dev/usr/share/doc/libbaz2-dev/changelog
+
+ # Okay, if either line is omitted, it should be noted
+ dh_strip --dbg-package=libbaz2-dbg -plibbaz2 -plibbaz2-dev
+ dh_makeshlibs -plibbaz2 -plibbaz2-dev -plibbaz2-dbg
+ dh_shlibdeps -plibbaz2 -plibbaz2-dev -plibbaz2-dbg
+
+ # and again, regular packaging stuff
+ dh_installdeb -plibbaz2 -plibbaz2-dev -plibbaz2-dbg
+ echo udeb: libbaz2 1.0 libbaz2 >> debian/libbaz2/DEBIAN/shlibs
+ dh_gencontrol -plibbaz2 -plibbaz2-dev -plibbaz2-dbg
+ dh_builddeb -plibbaz2 -plibbaz2-dev -plibbaz2-dbg
+
+# and the incorrect one
+binary-arch: build-arch binary-correct
+ # first, the lib package
+ install -d $(lib_tmp)/usr/lib
+ # resp. no soname (check), wrong soname (check), and no-pic (check)
+ cp -a libbaz1.so.1.0* $(lib_tmp)/usr/lib
+ cp -a libbaz2.so.1.0.3b $(lib_tmp)/usr/lib/libfoo2.so.1.0.3b
+ install -m644 libbaz3.so.1.0.3b $(lib_tmp)/usr/lib/libbaz3.so.1.0.3b
+ # let's include the .a in the non-dev too (TODO)
+ # Also, libbaz1.a hasn't a symbol table (TODO)
+ cp -a *.a $(lib_tmp)/usr/lib
+ # And a wrong .so symlink (wrong, only in -dev, TODO)
+ ln -s libfoo3.so.0.9 $(lib_tmp)/usr/lib/libfoo3.so
+ # And a wrong .so.X symlink (wrong, should point to a real existing
+ # shlib, TODO)
+ 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)/$(VENDORARCH)/auto/Foo
+ install -m 644 libbaz2.so.1.0.3b $(lib_tmp)/$(VENDORARCH)/auto/Foo/Foo.so
+ strip $(lib_tmp)/$(VENDORARCH)/auto/Foo/Foo.so
+
+ install -d $(lib_tmp)/usr/share/doc/$(LIB)
+ install -m 644 debian/copyright $(lib_tmp)/usr/share/doc/$(LIB)
+ install -m 644 debian/changelog $(lib_tmp)/usr/share/doc/$(LIB)
+ gzip -n -9 $(lib_tmp)/usr/share/doc/$(LIB)/changelog
+ install -d $(lib_tmp)/DEBIAN
+ install -m 755 debian/lib.postinst $(lib_tmp)/DEBIAN/postinst
+ install -m 755 debian/lib.prerm $(lib_tmp)/DEBIAN/prerm
+ touch $(lib_tmp)/usr/share/doc/README.Debian
+ #dpkg-shlibdeps $(lib_tmp)/usr/lib/libbaz.so.1.0
+ install -m 755 debian/lib.shlibs $(lib_tmp)/DEBIAN/shlibs
+ install -m 755 debian/lib.symbols $(lib_tmp)/DEBIAN/symbols
+ dpkg-gencontrol -isp -p$(LIB) -P$(lib_tmp)
+ dpkg --build $(lib_tmp) ..
+
+ # now the -dev package
+ install -d $(dev_tmp)/usr/include
+ install -d $(lib_tmp)/usr/lib
+ # let's also install the .so at the same time... (wrong, TODO)
+ cp -a *.a *.so.* $(lib_tmp)/usr/lib
+ # and fuck up permission (TODO)
+ chmod a+x $(lib_tmp)/usr/lib/*.a
+ # Pretend to be a Perl module to test a lack of Perl dependencies.
+ install -d $(dev_tmp)/$(VENDORARCH)/auto/Foo
+ install -m 644 libbaz2.so.1.0.3b $(dev_tmp)/$(VENDORARCH)/auto/Foo/Foo.so
+ strip $(dev_tmp)/$(VENDORARCH)/auto/Foo/Foo.so
+ install -d $(dev_tmp)/usr/share/doc
+ ln -s $(LIB) $(dev_tmp)/usr/share/doc/$(DEV)
+ install -d $(dev_tmp)/DEBIAN
+ install -m 755 debian/dev.postinst $(dev_tmp)/DEBIAN/postinst
+ install -m 755 debian/dev.prerm $(dev_tmp)/DEBIAN/prerm
+ dpkg-gencontrol -isp -p$(DEV) -P$(dev_tmp)
+ dpkg --build $(dev_tmp) ..
+
+
+binary: binary-arch
+
+# The mention of binary-indep here should be sufficient to suppress the
+# warning that it's not present.
+.PHONY: build-arch build-indep build binary-arch binary-indep binary clean
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/source.lintian-overrides b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/source.lintian-overrides
new file mode 100644
index 0000000..6008d27
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/source.lintian-overrides
@@ -0,0 +1 @@
+libbaz source: maintainer-script-lacks-debhelper-token
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/fill-values b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/fill-values
new file mode 100644
index 0000000..7effe4f
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/fill-values
@@ -0,0 +1,6 @@
+Skeleton: upload-non-native
+Testname: legacy-libbaz
+Source: libbaz
+Version: 1-1
+Default-Build-Depends: debhelper (>= 9.20151004~)
+Description: Legacy test "libbaz"
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/Makefile
new file mode 100644
index 0000000..657dc2a
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/Makefile
@@ -0,0 +1,55 @@
+# This is the correct way to build a lib
+
+CC=gcc
+CFLAGS=-g -Wall -Winline -O2
+LDFLAGS=-Wl,--no-as-needed
+
+OBJS=baz.o extra.o
+SHOBJS=baz.sho extra.sho
+NOPICOBJS = $(SHOBJS)
+
+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 $^ $@
+libbaz2.so.1.0: libbaz2.so.1.0.3b
+ ln -sf $^ $@
+
+# Oops, forget the soname altogether
+libbaz1.so.1.0.3b: $(NOPICOBJS)
+ $(CC) $(LDFLAGS) -o $@ -shared $^ -lc
+
+libbaz2.so.1.0.3b: $(SHOBJS)
+ $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libbaz2.so.1.0 $^ -lc
+
+# Non-PIC. We can't test this on all architectures
+libbaz3.so.1.0.3b: $(NOPICOBJS)
+ $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libbaz3.so.1 $^ -lc
+
+# Non-versioned SONAME.
+libbaz.so: $(SHOBJS)
+ $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libbaz.so $^ -lc
+
+#%.o-noreentrant: %.c
+# $(CC) $(LDFLAGS) $(CFLAGS) -o $@ -c $<
+
+%.sho: %.c
+ $(CC) $(LDFLAGS) $(CFLAGS) -D_REENTRANT -fPIC -o $@ -c $<
+
+%.o: %.c
+ $(CC) $(LDFLAGS) $(CFLAGS) -D_REENTRANT -o $@ -c $<
+
+libbaz2.a: $(OBJS)
+ ar cq $@ $(OBJS)
+ strip --strip-unneeded --remove-section=.comment \
+ --remove-section=-note $@
+ ranlib $@
+
+# The pic one in the .a (wrong), no archive table
+libbaz1.a: $(SHOBJS)
+ ar cqS $@ $^
+ strip --strip-unneeded --remove-section=.comment \
+ --remove-section=-note $@
+clean:
+ rm -f *.a *.o *.so* *.sho
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/baz.c b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/baz.c
new file mode 100644
index 0000000..4d5fc45
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/baz.c
@@ -0,0 +1,6 @@
+#include <math.h>
+
+double pw(double p)
+{
+ return exp(p);
+}
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/extra.c b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/extra.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/extra.c
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/desc b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/desc
new file mode 100644
index 0000000..201d68d
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/desc
@@ -0,0 +1,2 @@
+Testname: legacy-libbaz
+Check: libraries/shared/trigger/ldconfig
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/hints b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/hints
new file mode 100644
index 0000000..2e33583
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/hints
@@ -0,0 +1 @@
+libbaz1 (binary): lacks-ldconfig-trigger usr/lib/libbaz.so usr/lib/libbaz3.so.1.0.3b usr/lib/libfoo2.so.1.0.3b
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/post-test b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/post-test
new file mode 100755
index 0000000..29dc3f4
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/post-test
@@ -0,0 +1,4 @@
+/: hardening-.*/ d
+s/\(current is ([0-9]+\.)+[0-9]\)/(current is CURRENT)/
+s,usr/lib/([^\/]*/)?perl[0-9]*(/[0-9]*\.[0-9]*)?/,usr/lib/ma-dir/perl/version/,g
+/: file-references-package-build-path / d
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.install b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.install
new file mode 100644
index 0000000..fe6951d
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.install
@@ -0,0 +1,2 @@
+app usr/lib/app
+
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.postinst b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.postinst
new file mode 100755
index 0000000..3e67b7e
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.postinst
@@ -0,0 +1,6 @@
+#!/bin/sh
+set -e
+
+ldconfig
+
+#DEBHELPER#
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.postrm b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.postrm
new file mode 100755
index 0000000..eaeb28d
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.postrm
@@ -0,0 +1,6 @@
+#!/bin/sh
+set -e
+
+if [ "$1" = remove ] ; then ldconfig ; fi
+
+#DEBHELPER#
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.triggers b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.triggers
new file mode 100644
index 0000000..dd86603
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.triggers
@@ -0,0 +1 @@
+activate-noawait ldconfig
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/compat.in
new file mode 100644
index 0000000..640a566
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/compat.in
@@ -0,0 +1 @@
+[% $dh_compat_level %]
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/control.in b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/control.in
new file mode 100644
index 0000000..9960ee9
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/control.in
@@ -0,0 +1,47 @@
+Source: [% $source %]
+Priority: optional
+Section: libs
+Maintainer: [% $author %]
+Standards-Version: [% $standards_version %]
+Build-Depends: [% $build_depends %]
+Rules-Requires-Root: no
+
+Package: libfoo1
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: [% $description %] (missing ldc)
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package.
+ .
+ Checks for missing ldconfig in scripts.
+
+Package: libfish1
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: [% $description %] (preinst/rm ldc)
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package.
+ .
+ Checks for ldconfig in preinst/prerm scripts.
+
+Package: libuns1
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: [% $description %] (unsafe ldc)
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package.
+ .
+ Checks for unsafe ldconfig usage scripts.
+
+Package: app
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: [% $description %] (useless ldc)
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package.
+ .
+ Checks for useless ldconfig usage in scripts.
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.install b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.install
new file mode 100644
index 0000000..b1c4ec9
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.install
@@ -0,0 +1 @@
+usr/lib/libfish*
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.preinst b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.preinst
new file mode 100755
index 0000000..3e67b7e
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.preinst
@@ -0,0 +1,6 @@
+#!/bin/sh
+set -e
+
+ldconfig
+
+#DEBHELPER#
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.prerm b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.prerm
new file mode 100755
index 0000000..3e67b7e
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.prerm
@@ -0,0 +1,6 @@
+#!/bin/sh
+set -e
+
+ldconfig
+
+#DEBHELPER#
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.symbols b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.symbols
new file mode 100644
index 0000000..2c5a075
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.symbols
@@ -0,0 +1,3 @@
+libfish.so.1 libfish1 #MINVER#
+ e@Base 1.0
+ energy@Base 0.9
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.install b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.install
new file mode 100644
index 0000000..f3a3a05
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.install
@@ -0,0 +1 @@
+usr/lib/libfoo*
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.postinst b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.postinst
new file mode 100755
index 0000000..2615bf9
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.postinst
@@ -0,0 +1,8 @@
+#!/bin/sh
+set -e
+
+# No ldconfig
+if false ; then true ; fi
+
+# -- we will remove all debhelper stuff later.
+#DEBHELPER#
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.postrm b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.postrm
new file mode 100755
index 0000000..9b2f636
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.postrm
@@ -0,0 +1,8 @@
+#!/bin/sh
+set -e
+
+if false ; then true ; fi
+
+
+# -- we will remove all debhelper stuff later.
+#DEBHELPER#
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.symbols b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.symbols
new file mode 100644
index 0000000..a1f052b
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.symbols
@@ -0,0 +1,3 @@
+libfoo.so.1 libfoo1 #MINVER#
+ e@Base 1.0
+ energy@Base 0.9
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.install b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.install
new file mode 100644
index 0000000..b91d5ff
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.install
@@ -0,0 +1 @@
+usr/lib/libuns*
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.postrm b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.postrm
new file mode 100755
index 0000000..acc5d15
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.postrm
@@ -0,0 +1,8 @@
+#!/bin/sh
+set -e
+
+ldconfig
+
+
+# -- we will remove all debhelper stuff later.
+#DEBHELPER#
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.symbols b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.symbols
new file mode 100644
index 0000000..d91149f
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.symbols
@@ -0,0 +1,3 @@
+libuns.so.1 libuns1 #MINVER#
+ e@Base 1.0
+ energy@Base 0.9
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/rules b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/rules
new file mode 100755
index 0000000..b1c71a9
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/rules
@@ -0,0 +1,21 @@
+#!/usr/bin/make -f
+
+export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+
+%:
+ dh $@
+
+override_dh_builddeb:
+ for P in $$(dh_listpackages) ; do \
+ for S in postinst postrm preinst prerm ; do \
+ if [ -f debian/$${P}.$${S} ] ; then \
+ cp -af debian/$${P}.$${S} debian/$${P}/DEBIAN/$${S} ; \
+ chmod 0755 debian/$${P}/DEBIAN/$${S} ; \
+ sed -i '/#DEBHELPER#/ d' debian/$${P}/DEBIAN/$${S} ; \
+ fi ; \
+ done ; \
+ done
+ # Work around debhelper adding triggers instead of explicit
+ # ldconfig calls
+ rm -f debian/libfoo1/DEBIAN/triggers
+ dh_builddeb
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/fill-values b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/fill-values
new file mode 100644
index 0000000..2159596
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/fill-values
@@ -0,0 +1,5 @@
+Skeleton: upload-native
+Testname: shared-libs-ldconfig-scripts
+Default-Build-Depends: debhelper (>= 9.20151004~)
+Dh-Compat-Level: 9
+Description: Test checks related to ldconfig in scripts
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/Makefile
new file mode 100644
index 0000000..4d3c286
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/Makefile
@@ -0,0 +1,22 @@
+CC=gcc
+CFLAGS+= -fPIC
+
+SONAMES:= libfoo.so.1 libfish.so.1 libuns.so.1
+LIBFILES:= $(patsubst %,%.0.1, $(SONAMES))
+
+all: $(LIBFILES)
+
+$(LIBFILES): code.o
+ $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lm
+
+clean:
+ rm -f *.a *.o *.so*
+
+install: all
+ install -m 0755 -d $(DESTDIR)/usr/lib
+ install -m 0644 *.so* $(DESTDIR)/usr/lib
+ for FILE in $(SONAMES) ; do \
+ ln -s $${FILE}.0.1 $(DESTDIR)/usr/lib/$$FILE ; \
+ done
+
+.PHONY: install clean
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/app b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/app
new file mode 100755
index 0000000..04f1961
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/app
@@ -0,0 +1,2 @@
+#!/bin/sh
+echo Hello World
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/code.c b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/code.c
new file mode 100644
index 0000000..0ed08e0
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/code.c
@@ -0,0 +1,15 @@
+#include <stdlib.h>
+#include <math.h>
+
+double e(void (*f)(char *)){
+ char tmp[10];
+ double x;
+ f(tmp);
+ x = atof(tmp);
+ return exp(x);
+}
+
+double energy(double mass){
+ return pow(10.0, 8.0) * pow(3.0, 2.0) * mass;
+}
+
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/eval/desc b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/eval/desc
new file mode 100644
index 0000000..a55b281
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/eval/desc
@@ -0,0 +1,2 @@
+Testname: shared-libs-ldconfig-scripts
+Check: libraries/shared/trigger/ldconfig
diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/eval/hints b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/eval/hints
new file mode 100644
index 0000000..92986ce
--- /dev/null
+++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/eval/hints
@@ -0,0 +1,2 @@
+libfoo1 (binary): lacks-ldconfig-trigger usr/lib/libfoo.so.1.0.1
+app (binary): package-has-unnecessary-activation-of-ldconfig-trigger