diff options
Diffstat (limited to '')
282 files changed, 2738 insertions, 0 deletions
diff --git a/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/control.in new file mode 100644 index 0000000..1109beb --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/control.in @@ -0,0 +1,48 @@ +Source: [% $source %] +Priority: optional +Section: libs +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: mylibany +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] + 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: libany6gcc1v6 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] with gcc 6 version + 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. + . + It test if v6 string are correctly escaped + +Package: libany5gcc1v5 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] with gcc 5 version + 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. + . + It test if v5 string are correctly escaped + +Package: libanyq16-6 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] with Q16 version + 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. + . + It test if string are correctly escaped like for imagemagick. + . + library name is not libanyQ166
\ No newline at end of file diff --git a/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/libany5gcc1v5.install b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/libany5gcc1v5.install new file mode 100644 index 0000000..283bc61 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/libany5gcc1v5.install @@ -0,0 +1 @@ +/usr/lib/libany5gcc.*
\ No newline at end of file diff --git a/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/libany5gcc1v5.symbols b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/libany5gcc1v5.symbols new file mode 100644 index 0000000..a394502 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/libany5gcc1v5.symbols @@ -0,0 +1,2 @@ +libany5gcc.so.1 libany5gcc1v5 #MINVER# + e@Base 1.0 diff --git a/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/libany6gcc1v6.install b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/libany6gcc1v6.install new file mode 100644 index 0000000..9485e87 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/libany6gcc1v6.install @@ -0,0 +1 @@ +/usr/lib/libany6gcc.*
\ No newline at end of file diff --git a/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/libany6gcc1v6.symbols b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/libany6gcc1v6.symbols new file mode 100644 index 0000000..aee5f00 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/libany6gcc1v6.symbols @@ -0,0 +1,2 @@ +libany6gcc.so.1v6 libany6gcc1v6 #MINVER# + e@Base 1.0 diff --git a/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/libanyq16-6.install b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/libanyq16-6.install new file mode 100644 index 0000000..b4ecaea --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/libanyq16-6.install @@ -0,0 +1 @@ +/usr/lib/libanyQ16*
\ No newline at end of file diff --git a/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/libanyq16-6.symbols b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/libanyq16-6.symbols new file mode 100644 index 0000000..0f32f79 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/libanyq16-6.symbols @@ -0,0 +1,2 @@ +libanyQ16.so.1v6 libanyQ16-6 #MINVER# + e@Base 1.0 diff --git a/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/mylibany.install b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/mylibany.install new file mode 100644 index 0000000..5c86ce1 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/mylibany.install @@ -0,0 +1 @@ +/usr/lib/libany.*
\ No newline at end of file diff --git a/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/mylibany.symbols b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/mylibany.symbols new file mode 100644 index 0000000..9b6f454 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/debian/mylibany.symbols @@ -0,0 +1,2 @@ +libany.so.1 mylibany #MINVER# + e@Base 1.0 diff --git a/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/fill-values b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/fill-values new file mode 100644 index 0000000..523eb0b --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/fill-values @@ -0,0 +1,5 @@ +Skeleton: upload-native +Testname: binaries-doesnt-match-sonames +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test for library package that does not match SONAME diff --git a/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/orig/Makefile new file mode 100644 index 0000000..21a67b5 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/orig/Makefile @@ -0,0 +1,23 @@ +CC=gcc +MYCFLAGS=-Wall -Winline -O2 -fPIC +CFLAGS:=$(MYCFLAGS) $(CPPFLAGS) $(CFLAGS) + +SONAMES:= libany.so.1 libany6gcc.so.1v6 libany5gcc.so.1 libanyQ16.so.6 +LIBFILES:= $(patsubst %,%.0.1, $(SONAMES)) + +all: $(LIBFILES) + +$(LIBFILES): code.o + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc + +clean: + rm -f *.a *.o *.so* + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0755 *.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/debian/shlibs/binaries-doesnt-match-sonames/build-spec/orig/code.c b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/orig/code.c new file mode 100644 index 0000000..0c4f917 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/build-spec/orig/code.c @@ -0,0 +1,9 @@ +#include <string.h> +#include <stdio.h> + +void e(char *p, int i, void (*f)(char *)){ + char test[10]; + memcpy(test, p, i); + f(test); + printf("%s", test); +} diff --git a/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/eval/desc b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/eval/desc new file mode 100644 index 0000000..02d87f3 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/eval/desc @@ -0,0 +1,2 @@ +Testname: binaries-doesnt-match-sonames +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/eval/hints b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/eval/hints new file mode 100644 index 0000000..6cf925b --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-doesnt-match-sonames/eval/hints @@ -0,0 +1,4 @@ +mylibany (binary): symbols-file-missing-build-depends-package-field libany.so.1 [symbols] +libanyq16-6 (binary): symbols-file-missing-build-depends-package-field libanyQ16.so.6 [symbols] +libany6gcc1v6 (binary): symbols-file-missing-build-depends-package-field libany6gcc.so.1v6 [symbols] +libany5gcc1v5 (binary): symbols-file-missing-build-depends-package-field libany5gcc.so.1 [symbols] diff --git a/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/debian/control.in new file mode 100644 index 0000000..d8adb1b --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/debian/control.in @@ -0,0 +1,17 @@ +Source: [% $source %] +Priority: optional +Section: devel +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %], perl +Rules-Requires-Root: no + +Package: libbasic2 +Section: libs +Architecture: [% $package_architecture %] +Depends: some-pkg, ${misc:Depends}, ${shlib:Depends} +Description: [% $description %] + 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. It may + be an empty package. diff --git a/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/debian/libbasic2.symbols b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/debian/libbasic2.symbols new file mode 100644 index 0000000..0119bca --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/debian/libbasic2.symbols @@ -0,0 +1,4 @@ +libbasic.so.2 libbasic2 #MINVER# + lib_interface@Base 1.0 +libbasic++.so.2 libbasic2 #MINVER# + (c++)cxx_lib_interface@Base 1.0 diff --git a/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/debian/rules b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/debian/rules new file mode 100644 index 0000000..188f490 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/debian/rules @@ -0,0 +1,15 @@ +#!/usr/bin/make -f + +export DEB_BUILD_MAINT_OPTIONS=hardening=+all + +# Make sure the C++ library actually links to libc +export DEB_LDFLAGS_MAINT_APPEND=-Wl,--no-as-needed + +%: + dh $@ + +override_dh_gencontrol: + # Remove the shlib:Depends since it will contain libc + sed -i '/shlib:Depends=/ d' debian/libbasic2.substvars + echo "shlib:depends=" >> debian/libbasic2.substvars + dh_gencontrol diff --git a/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/fill-values b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/fill-values new file mode 100644 index 0000000..0f58398 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/fill-values @@ -0,0 +1,6 @@ +Skeleton: upload-native +Testname: binaries-missing-depends-on-libc +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test for missing libc depends +Package-Architecture: any diff --git a/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/orig/Makefile new file mode 100644 index 0000000..fcf25f4 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/orig/Makefile @@ -0,0 +1,14 @@ +all: + gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so.2 basic.c + g++ $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -fPIC -shared -Wl,-z,defs \ + -Wl,-soname,libbasic++.so.2 -olibbasic++.so.2 cpp.cxx + +install: + install -d $(DESTDIR)/usr/lib/ + install -m 644 -c -s libbasic.so.2 $(DESTDIR)/usr/lib/libbasic.so.2 + install -m 644 -c -s libbasic++.so.2 $(DESTDIR)/usr/lib/libbasic++.so.2 + +clean distclean: + rm -f libbasic.so.2 libbasic++.so.2 + +check test: diff --git a/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/orig/basic.c b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/orig/basic.c new file mode 100644 index 0000000..27e93fc --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/orig/basic.c @@ -0,0 +1,19 @@ +#include <stdio.h> +#include <string.h> + +static void +hardening_trigger(char *p, int i, void (*f)(char *)) +{ + char test[10]; + memcpy(test, p, i); + f(test); + printf("%s", test); +} + +int +lib_interface(void) +{ + printf("Hello world!\n"); + hardening_trigger(NULL, 0, NULL); + return 0; +} diff --git a/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/orig/cpp.cxx b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/orig/cpp.cxx new file mode 100644 index 0000000..1338e40 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/build-spec/orig/cpp.cxx @@ -0,0 +1,14 @@ +#include <iostream> +#include <vector> + +using namespace std; + +template <class T> T +cxx_lib_interface(vector<T> &v) +{ + cout << ":-) hello world" << endl; + return v[0]; +} + + + diff --git a/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/eval/desc b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/eval/desc new file mode 100644 index 0000000..368818c --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/eval/desc @@ -0,0 +1,2 @@ +Testname: binaries-missing-depends-on-libc +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/eval/hints b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/eval/hints new file mode 100644 index 0000000..7290044 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-missing-depends-on-libc/eval/hints @@ -0,0 +1,2 @@ +libbasic2 (binary): symbols-file-missing-build-depends-package-field libbasic.so.2 [symbols] +libbasic2 (binary): symbols-file-missing-build-depends-package-field libbasic++.so.2 [symbols] diff --git a/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/debian/control.in new file mode 100644 index 0000000..3b37179 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/debian/control.in @@ -0,0 +1,17 @@ +Source: [% $source %] +Priority: optional +Section: devel +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %], perl +Rules-Requires-Root: no + +Package: libbasic2 +Architecture: [% $package_architecture %] +Section: libs +Depends: ${misc:Depends}, ${shlib:Depends} +Description: [% $description %] + 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. It may + be an empty package. diff --git a/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/debian/libbasic2.symbols b/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/debian/libbasic2.symbols new file mode 100644 index 0000000..c2b8fb3 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/debian/libbasic2.symbols @@ -0,0 +1,2 @@ +libbasic.so.2 libbasic2 #MINVER# + lib_interface@Base 1.0 diff --git a/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/debian/rules b/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/debian/rules new file mode 100644 index 0000000..8a83255 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/debian/rules @@ -0,0 +1,10 @@ +#!/usr/bin/make -f + +export DEB_BUILD_MAINT_OPTIONS=hardening=+all + +%: + dh $@ + +override_dh_builddeb: + sed -i '/Depends:/ d' debian/libbasic2/DEBIAN/control + dh_builddeb diff --git a/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/fill-values b/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/fill-values new file mode 100644 index 0000000..b1caef8 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/fill-values @@ -0,0 +1,6 @@ +Skeleton: upload-native +Testname: binaries-missing-depends +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test for missing depends line +Package-Architecture: any diff --git a/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/orig/Makefile new file mode 100644 index 0000000..6fc3968 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/orig/Makefile @@ -0,0 +1,12 @@ +all: + gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so.2 basic.c + +install: + # install it under the correct triplet directory + install -d $(DESTDIR)/usr/lib/ + install -m 644 -c -s libbasic.so.2 $(DESTDIR)/usr/lib/libbasic.so.2 + +clean distclean: + rm -f libbasic.so.2 + +check test: diff --git a/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/orig/basic.c b/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/orig/basic.c new file mode 100644 index 0000000..27e93fc --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-missing-depends/build-spec/orig/basic.c @@ -0,0 +1,19 @@ +#include <stdio.h> +#include <string.h> + +static void +hardening_trigger(char *p, int i, void (*f)(char *)) +{ + char test[10]; + memcpy(test, p, i); + f(test); + printf("%s", test); +} + +int +lib_interface(void) +{ + printf("Hello world!\n"); + hardening_trigger(NULL, 0, NULL); + return 0; +} diff --git a/t/recipes/checks/debian/shlibs/binaries-missing-depends/eval/desc b/t/recipes/checks/debian/shlibs/binaries-missing-depends/eval/desc new file mode 100644 index 0000000..e3ef2c0 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-missing-depends/eval/desc @@ -0,0 +1,2 @@ +Testname: binaries-missing-depends +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/binaries-missing-depends/eval/hints b/t/recipes/checks/debian/shlibs/binaries-missing-depends/eval/hints new file mode 100644 index 0000000..d4e8830 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-missing-depends/eval/hints @@ -0,0 +1 @@ +libbasic2 (binary): symbols-file-missing-build-depends-package-field libbasic.so.2 [symbols] diff --git a/t/recipes/checks/debian/shlibs/binaries-multiarch-same/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/binaries-multiarch-same/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-multiarch-same/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/binaries-multiarch-same/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/binaries-multiarch-same/build-spec/debian/control.in new file mode 100644 index 0000000..2efaa33 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-multiarch-same/build-spec/debian/control.in @@ -0,0 +1,25 @@ +Source: [% $source %] +Priority: optional +Section: libs +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: libbasic2 +Architecture: [% $package_architecture %] +Pre-Depends: ${misc:Pre-Depends}, multiarch-support +Depends: ${misc:Depends}, ${shlibs:Depends} +Multi-Arch: same +Description: [% $description %] + 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. It may + be an empty package. + . + Note there is an explicitly pre-depends on multiarch-support, since + older versions of debhelper might not use it yet. dpkg-dev will + remove the duplicate entry (if any). + + + diff --git a/t/recipes/checks/debian/shlibs/binaries-multiarch-same/build-spec/debian/libbasic2.symbols b/t/recipes/checks/debian/shlibs/binaries-multiarch-same/build-spec/debian/libbasic2.symbols new file mode 100644 index 0000000..c2b8fb3 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-multiarch-same/build-spec/debian/libbasic2.symbols @@ -0,0 +1,2 @@ +libbasic.so.2 libbasic2 #MINVER# + lib_interface@Base 1.0 diff --git a/t/recipes/checks/debian/shlibs/binaries-multiarch-same/build-spec/fill-values b/t/recipes/checks/debian/shlibs/binaries-multiarch-same/build-spec/fill-values new file mode 100644 index 0000000..c508b75 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-multiarch-same/build-spec/fill-values @@ -0,0 +1,6 @@ +Skeleton: upload-native +Testname: binaries-multiarch-same +Package-Architecture: any +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test of multiarch same package with unsafe binaries diff --git a/t/recipes/checks/debian/shlibs/binaries-multiarch-same/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/binaries-multiarch-same/build-spec/orig/Makefile new file mode 100644 index 0000000..ad7783b --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-multiarch-same/build-spec/orig/Makefile @@ -0,0 +1,12 @@ + +all: + gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so.2 basic.c + +install: + install -d $(DESTDIR)/usr/lib/ + install -m 644 -c -s libbasic.so.2 $(DESTDIR)/usr/lib/libbasic.so.2 + +clean distclean: + rm -f libbasic.so.2 + +check test: diff --git a/t/recipes/checks/debian/shlibs/binaries-multiarch-same/build-spec/orig/basic.c b/t/recipes/checks/debian/shlibs/binaries-multiarch-same/build-spec/orig/basic.c new file mode 100644 index 0000000..27e93fc --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-multiarch-same/build-spec/orig/basic.c @@ -0,0 +1,19 @@ +#include <stdio.h> +#include <string.h> + +static void +hardening_trigger(char *p, int i, void (*f)(char *)) +{ + char test[10]; + memcpy(test, p, i); + f(test); + printf("%s", test); +} + +int +lib_interface(void) +{ + printf("Hello world!\n"); + hardening_trigger(NULL, 0, NULL); + return 0; +} diff --git a/t/recipes/checks/debian/shlibs/binaries-multiarch-same/eval/desc b/t/recipes/checks/debian/shlibs/binaries-multiarch-same/eval/desc new file mode 100644 index 0000000..cd079c8 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-multiarch-same/eval/desc @@ -0,0 +1,2 @@ +Testname: binaries-multiarch-same +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/binaries-multiarch-same/eval/hints b/t/recipes/checks/debian/shlibs/binaries-multiarch-same/eval/hints new file mode 100644 index 0000000..d4e8830 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-multiarch-same/eval/hints @@ -0,0 +1 @@ +libbasic2 (binary): symbols-file-missing-build-depends-package-field libbasic.so.2 [symbols] diff --git a/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/debian/control.in new file mode 100644 index 0000000..aa271ff --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/debian/control.in @@ -0,0 +1,21 @@ +Source: [% $source %] +Priority: optional +Section: libs +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: libbasic2 +Architecture: [% $package_architecture %] +Pre-Depends: ${misc:Pre-Depends}, multiarch-support +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: [% $description %] + 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. It may + be an empty package. + . + Note there is an explicitly pre-depends on multiarch-support, since + older versions of debhelper might not use it yet. dpkg-dev will + remove the duplicate entry (if any). diff --git a/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/debian/libbasic2.symbols b/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/debian/libbasic2.symbols new file mode 100644 index 0000000..c2b8fb3 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/debian/libbasic2.symbols @@ -0,0 +1,2 @@ +libbasic.so.2 libbasic2 #MINVER# + lib_interface@Base 1.0 diff --git a/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/debian/rules b/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/debian/rules new file mode 100644 index 0000000..249fe25 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/debian/rules @@ -0,0 +1,23 @@ +#!/usr/bin/make -f + +# Since dpkg in stable (Squeeze) does not support MULTIARCH we cannot use +# dpkg-architecture -qDEB_HOST_MULTIARCH +# Therefore this test is hardcoded to x86 and amd64 + +ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH) + +ifeq (i386,$(ARCH)) + TRIPLET = i386-linux-gnu +else + TRIPLET = x86_64-linux-gnu +endif + +export DEB_BUILD_MAINT_OPTIONS=hardening=+all + +%: + dh $@ + +override_dh_makeshlibs: + # dpkg-dev uses ld.so.conf so if we do not pass the lib directly + # this will fail on all x86 machines without with libc6 < 2.13-5 + dh_makeshlibs -- -edebian/libbasic2/usr/lib/$(TRIPLET)/libbasic.so.2 diff --git a/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/fill-values b/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/fill-values new file mode 100644 index 0000000..a521479 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/fill-values @@ -0,0 +1,6 @@ +Skeleton: upload-native +Testname: binaries-multiarch +Description: Test of a correct multiarch package +Package-Architecture: any +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 diff --git a/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/orig/Makefile new file mode 100644 index 0000000..979e366 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/orig/Makefile @@ -0,0 +1,26 @@ + +# Since dpkg in stable (Squeeze) does not support MULTIARCH we cannot use +# dpkg-architecture -qDEB_HOST_MULTIARCH +# Therefore this test is hardcoded to x86 and amd64 + +ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH) + +ifeq (i386,$(ARCH)) + TRIPLET = i386-linux-gnu +else + TRIPLET = x86_64-linux-gnu +endif + + +all: + gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -fPIC -shared -Wl,-z,defs -Wl,-soname,libbasic.so.2 -o libbasic.so.2 basic.c + +install: + # install it under the correct triplet directory + install -d $(DESTDIR)/usr/lib/$(TRIPLET) + install -m 644 -c -s libbasic.so.2 $(DESTDIR)/usr/lib/$(TRIPLET)/libbasic.so.2 + +clean distclean: + rm -f libbasic.so.2 + +check test: diff --git a/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/orig/basic.c b/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/orig/basic.c new file mode 100644 index 0000000..27e93fc --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-multiarch/build-spec/orig/basic.c @@ -0,0 +1,19 @@ +#include <stdio.h> +#include <string.h> + +static void +hardening_trigger(char *p, int i, void (*f)(char *)) +{ + char test[10]; + memcpy(test, p, i); + f(test); + printf("%s", test); +} + +int +lib_interface(void) +{ + printf("Hello world!\n"); + hardening_trigger(NULL, 0, NULL); + return 0; +} diff --git a/t/recipes/checks/debian/shlibs/binaries-multiarch/eval/desc b/t/recipes/checks/debian/shlibs/binaries-multiarch/eval/desc new file mode 100644 index 0000000..d50c6ad --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-multiarch/eval/desc @@ -0,0 +1,3 @@ +Testname: binaries-multiarch +Test-Architectures: i386 amd64 +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/binaries-multiarch/eval/hints b/t/recipes/checks/debian/shlibs/binaries-multiarch/eval/hints new file mode 100644 index 0000000..d4e8830 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-multiarch/eval/hints @@ -0,0 +1 @@ +libbasic2 (binary): symbols-file-missing-build-depends-package-field libbasic.so.2 [symbols] diff --git a/t/recipes/checks/debian/shlibs/binaries-multiarch/eval/post-test b/t/recipes/checks/debian/shlibs/binaries-multiarch/eval/post-test new file mode 100644 index 0000000..fdc0a20 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/binaries-multiarch/eval/post-test @@ -0,0 +1,2 @@ +s/i386-linux-gnu/x86_64-linux-gnu/ +s/is for i386/is for amd64/ diff --git a/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/debian/control.in new file mode 100644 index 0000000..addc2fc --- /dev/null +++ b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/debian/control.in @@ -0,0 +1,33 @@ +Source: [% $source %] +Priority: optional +Section: [% $section %] +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: libpublic1 +Section: libs +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends}, +Multi-Arch: same +Description: [% $description %] + 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. It may + be an empty package. + +Package: libpublic-dev +Section: libdevel +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends}, +Multi-Arch: foreign +Description: [% $description %] (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. It may + be an empty package. + . + Supposedly includes some headers. + + diff --git a/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/debian/libpublic-dev.install b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/debian/libpublic-dev.install new file mode 100644 index 0000000..012244d --- /dev/null +++ b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/debian/libpublic-dev.install @@ -0,0 +1 @@ +usr/lib/*/*.so diff --git a/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/debian/libpublic1.install b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/debian/libpublic1.install new file mode 100644 index 0000000..3de3b10 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/debian/libpublic1.install @@ -0,0 +1 @@ +usr/lib/*/*.so.* diff --git a/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/debian/libpublic1.symbols b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/debian/libpublic1.symbols new file mode 100644 index 0000000..d8226ca --- /dev/null +++ b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/debian/libpublic1.symbols @@ -0,0 +1,3 @@ +libexecbit.so.1 libexecbit1 #MINVER# + e@Base 1.0 + energy@Base 0.9 diff --git a/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/fill-values b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/fill-values new file mode 100644 index 0000000..2b7d50c --- /dev/null +++ b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/fill-values @@ -0,0 +1,5 @@ +Skeleton: upload-native +Testname: files-wrong-ma-foreign +Description: Test for wrong usage of Multi-Arch foreign +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 diff --git a/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/orig/Makefile new file mode 100644 index 0000000..ff58c3a --- /dev/null +++ b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/orig/Makefile @@ -0,0 +1,24 @@ +CC=gcc +CFLAGS+= -fPIC + +SONAMES:= libpublic.so.1 +LIBFILES:= $(patsubst %,%.0.1, $(SONAMES)) +LIBDIR := /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH) + +all: $(LIBFILES) + +$(LIBFILES): code.o + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc + +clean: + rm -f *.a *.o *.so* + +install: all + install -m 0755 -d $(DESTDIR)$(LIBDIR) + install -m 0644 *.so* $(DESTDIR)$(LIBDIR) + set -e ; for FILE in $(SONAMES) ; do \ + ln -s $${FILE}.0.1 $(DESTDIR)$(LIBDIR)/$$FILE ; \ + ln -s $${FILE}.0.1 $(DESTDIR)$(LIBDIR)/$$(echo $$FILE | perl -pe 's/\.so\K.*//') ; \ + done + +.PHONY: install clean diff --git a/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/orig/code.c b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/build-spec/orig/code.c new file mode 100644 index 0000000..0ed08e0 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/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/debian/shlibs/files-wrong-ma-foreign/eval/desc b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/eval/desc new file mode 100644 index 0000000..527b859 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/eval/desc @@ -0,0 +1,2 @@ +Testname: files-wrong-ma-foreign +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/eval/hints b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/eval/hints new file mode 100644 index 0000000..a157d77 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/files-wrong-ma-foreign/eval/hints @@ -0,0 +1 @@ +libpublic1 (binary): symbols-file-missing-build-depends-package-field libpublic.so.1 [symbols] diff --git a/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/debian/_symbols b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/debian/_symbols new file mode 100644 index 0000000..46e6af1 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/debian/_symbols @@ -0,0 +1,23 @@ + This line should flag a syntax error +# but this one shouldn't +| although this one should, but for a different reason + and so should this + +libhello.so.0 libhello0 #MINVER# +| libhello0c2 (>= 1.2) , libhelloc0c2 (<< 1.3) +| hello-dbg3| libhelloc0c3|foobar (= 1.2) |hello-dbg2 +| hello-dbg + hello@Base 1.0 +* Build-Dep-Foo: bar + hello2@Base 2.0 4 + hello3@Base 2.0 1 + hello3@Base 2.0 A + dummy + +libhello.so.2 libhello2 #MINVER# +* Build-Depends-Package: libbar +| libhello2 (>= 1:2.3) + hello@Base 2.0 + +libhello.so.0 libhello0 #MINVER# + duplicate@Base 1.0 diff --git a/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/debian/changelog.in b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/debian/changelog.in new file mode 100644 index 0000000..02da925 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/debian/changelog.in @@ -0,0 +1,13 @@ +debug ([% $version %]) [% $distribution %]; urgency=low + + * NMU. + (uploaded by the maintainer and with repeated version number) + + -- Russ Allbery <rra@debian.org> Tue, 4 Apr 2006 20:27:22 +0000 + +debug (1.0) unstable; urgency=low + + * Initial version. + + -- Russ Allbery <rra@debian.org> Sat, 4 Mar 2006 21:31:06 -0800 + diff --git a/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/debian/control b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/debian/control new file mode 100644 index 0000000..fcb2b86 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/debian/control @@ -0,0 +1,85 @@ +Source: debug +Section: utils +Priority: optional +Maintainer: Russ Allbery <rra@debian.org> +Build-Depends: debhelper (>= 5.0.0) +Build-Depends-Indep: not-debhelper (>= 0.4.3) +Standards-Version: 3.7.0 + +Package: hello +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Test for external debugging information + Lintian regression test for external debugging file handling. This test + contains the binary. + . + 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: hello-dbg +Priority: optional +Section: debug +Architecture: any +Depends: hello (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Description: Test for external debugging information (symbols) + Lintian regression test for external debugging file handling. This test + contains the binary symbols. + . + 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: libhello0 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Test for external debugging information (library) + Lintian regression test for external debugging file handling. This test + contains a library. + . + 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: libhello0-dbg +Section: debug +Priority: optional +Architecture: any +Depends: libhello (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Description: Test for external debugging information (library symbols) + Lintian regression test for external debugging file handling. This test + contains the library symbols. + . + 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: hi-dbg +Section: debug +Priority: optional +Architecture: any +Depends: foo-pkg, not-libhello0 +Description: Test for external debugging symbols + Lintian regression test for external debugging files handling. This test + contains the library symbols. + . + 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. It may + be an empty package. + +Package: hello-hello-dbg +Section: debug +Priority: optional +Architecture: any +Depends: foo-pkg, not-libhello0, hello +Description: Test for external debugging symbols - another try + Lintian regression test for external debugging files handling. This test + contains the library symbols. This package actually tests a combination of + the above. + . + 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. It may + be an empty package. diff --git a/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/debian/copyright b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/debian/copyright new file mode 100644 index 0000000..5d4f6c2 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/debian/copyright @@ -0,0 +1,4 @@ +Written Sat, 04 Mar 2006 21:30:01 -0800 by Russ Allbery <rra@debian.org>. + +Test for copyright in capital letters. (#464992) +COPYRIGHT RUSS ALLBERY 2006 diff --git a/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/debian/rules b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/debian/rules new file mode 100755 index 0000000..b659895 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/debian/rules @@ -0,0 +1,99 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# This file is public domain software, originally written by Joey Hess. + +# turn off PIE in CC in case we have a PIEful toolchain: +ifneq ($(findstring -no-pie,$(shell gcc -no-pie 2>&1)),) + CC := gcc +else + CC := gcc -fno-pie -no-pie +endif + +build-indep: + +build-arch: build-stamp + +build-stamp: + dh_testdir + $(CC) -D_REENTRANT -fPIC -c libhello.c + $(CC) -o libhello.so.0.0 -shared -Wl,-soname,libhello.so.0 libhello.o + ln -s libhello.so.0.0 libhello.so + $(CC) -o hello hello.c -L. -lhello + touch build-stamp + +build: build-arch build-indep + +clean: + dh_testdir + dh_testroot + rm -f build-stamp *.o libhello.so.0.0 libhello.so + dh_clean + +install: build-stamp + dh_testdir + dh_testroot + dh_clean -k + install -D hello $(CURDIR)/debian/hello/usr/bin/hello + install -D libhello.so.0.0 \ + $(CURDIR)/debian/libhello0/usr/lib/libhello.so.0.0 + ln -s libhello.so.0.0 \ + $(CURDIR)/debian/libhello0/usr/lib/libhello.so.0 + +# Build architecture-dependent files here. +export DH_OPTIONS +binary-arch: DH_OPTIONS=-a +binary-arch: build-stamp install + dh_testdir + dh_testroot + dh_installchangelogs -N hello-dbg + dh_installdocs + DH_OPTIONS= dh_strip -phello --dbg-package=hello-dbg + DH_OPTIONS= dh_strip -plibhello0 --dbg-package=libhello0-dbg + + # Now break a few things. Copy the debugging data into places it + # shouldn't be. + cp $(CURDIR)/debian/hello-dbg/usr/lib/debug/usr/bin/hello \ + $(CURDIR)/debian/hello/usr/bin/hello.dbg + cp $(CURDIR)/debian/libhello0-dbg/usr/lib/debug/usr/lib/libhello.so.0.0 \ + $(CURDIR)/debian/libhello0-dbg/usr/lib/libhello.so.dbg + + # Put a full copy of the library in libhello0-dbg in /usr/lib/debug, + # which is okay. + install -m 644 libhello.so.0.0 \ + $(CURDIR)/debian/libhello0-dbg/usr/lib/debug/libhello.so.0.0 + + # Also put it in /usr/lib/debug/lib, which isn't. + install -D -m 644 libhello.so.0.0 \ + $(CURDIR)/debian/libhello0-dbg/usr/lib/debug/lib/libhello.so.0.0 + + # Requires a versioned dependency. + dh_icons + + dh_link + dh_compress + dh_fixperms + dh_makeshlibs -X debug + dh_installdeb + dh_shlibdeps -X debug + + # We do this by hand as otherwise dpkg-gensymbols + # will error due to the broken symbols file + # and abort the build; similarly the file in + # the source tree is _symbols so that dpkg + # doesn't attempt to sanity check it + install -d $(CURDIR)/debian/libhello0/DEBIAN + install -m 644 $(CURDIR)/debian/_symbols \ + $(CURDIR)/debian/libhello0/DEBIAN/symbols + # hello doesn't contain any shlibs, but we + # make it contain a symbols file + install -d $(CURDIR)/debian/hello/DEBIAN + install -m 644 $(CURDIR)/debian/_symbols \ + $(CURDIR)/debian/hello/DEBIAN/symbols + + dh_gencontrol + dh_md5sums + dh_builddeb + +binary-indep: +binary: binary-indep binary-arch +.PHONY: build-arch build-indep build binary binary-indep binary-arch clean install diff --git a/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/fill-values b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/fill-values new file mode 100644 index 0000000..79eebf1 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/fill-values @@ -0,0 +1,6 @@ +Skeleton: upload-native +Testname: legacy-debug +Source: debug +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 7 +Description: Legacy test "debug" diff --git a/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/orig/hello.c b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/orig/hello.c new file mode 100644 index 0000000..76f8337 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/orig/hello.c @@ -0,0 +1,9 @@ +#include <stdlib.h> +#include "libhello.h" + +int +main(void) +{ + hello(); + exit(0); +} diff --git a/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/orig/libhello.c b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/orig/libhello.c new file mode 100644 index 0000000..e2f8409 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/orig/libhello.c @@ -0,0 +1,7 @@ +#include <stdio.h> + +void +hello(void) +{ + printf("Hello, World!\n"); +} diff --git a/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/orig/libhello.h b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/orig/libhello.h new file mode 100644 index 0000000..ef77476 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-debug/build-spec/orig/libhello.h @@ -0,0 +1 @@ +void hello(void); diff --git a/t/recipes/checks/debian/shlibs/legacy-debug/eval/desc b/t/recipes/checks/debian/shlibs/legacy-debug/eval/desc new file mode 100644 index 0000000..48b87f4 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-debug/eval/desc @@ -0,0 +1,3 @@ +Testname: legacy-debug +Check: debian/shlibs +Test-Against: symbols-file-missing-build-depends-package-field diff --git a/t/recipes/checks/debian/shlibs/legacy-debug/eval/hints b/t/recipes/checks/debian/shlibs/legacy-debug/eval/hints new file mode 100644 index 0000000..d9fdaff --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-debug/eval/hints @@ -0,0 +1,48 @@ +libhello0 (binary): unknown-meta-field-in-symbols-file Build-Dep-Foo (libhello.so.0) [symbols:11] +libhello0 (binary): syntax-error-in-symbols-file [symbols:4] +libhello0 (binary): syntax-error-in-symbols-file [symbols:3] +libhello0 (binary): syntax-error-in-symbols-file [symbols:1] +libhello0 (binary): syntax-error-in-symbols-file [symbols:19] +libhello0 (binary): syntax-error-in-symbols-file [symbols:15] +libhello0 (binary): syntax-error-in-symbols-file [symbols:11] +libhello0 (binary): symbols-for-undeclared-shared-library libhello 2 +libhello0 (binary): symbols-file-missing-build-depends-package-field libhello.so.0 [symbols] +libhello0 (binary): symbols-declares-dependency-on-other-package libhelloc0c3 (libhello.so.0) [symbols] +libhello0 (binary): symbols-declares-dependency-on-other-package libhelloc0c2 (<< 1.3) (libhello.so.0) [symbols] +libhello0 (binary): symbols-declares-dependency-on-other-package libhello2 (libhello.so.2) [symbols] +libhello0 (binary): symbols-declares-dependency-on-other-package libhello2 (>= 1:2.3) (libhello.so.2) [symbols] +libhello0 (binary): symbols-declares-dependency-on-other-package libhello0c2 (>= 1.2) (libhello.so.0) [symbols] +libhello0 (binary): symbols-declares-dependency-on-other-package hello-dbg3 (libhello.so.0) [symbols] +libhello0 (binary): symbols-declares-dependency-on-other-package hello-dbg2 (libhello.so.0) [symbols] +libhello0 (binary): symbols-declares-dependency-on-other-package hello-dbg (libhello.so.0) [symbols] +libhello0 (binary): symbols-declares-dependency-on-other-package foobar (= 1.2) (libhello.so.0) [symbols] +libhello0 (binary): surplus-shared-library-symbols libhello 2 [symbols] +libhello0 (binary): invalid-template-id-in-symbols-file should this [symbols:4] +libhello0 (binary): invalid-template-id-in-symbols-file A [symbols:14] +libhello0 (binary): invalid-template-id-in-symbols-file 4 [symbols:12] +libhello0 (binary): duplicate-entry-in-symbols-control-file (lines 6 22) libhello 0 [symbols] +hello (binary): unknown-meta-field-in-symbols-file Build-Dep-Foo (libhello.so.0) [symbols:11] +hello (binary): syntax-error-in-symbols-file [symbols:4] +hello (binary): syntax-error-in-symbols-file [symbols:3] +hello (binary): syntax-error-in-symbols-file [symbols:1] +hello (binary): syntax-error-in-symbols-file [symbols:19] +hello (binary): syntax-error-in-symbols-file [symbols:15] +hello (binary): syntax-error-in-symbols-file [symbols:11] +hello (binary): symbols-file-missing-build-depends-package-field libhello.so.0 [symbols] +hello (binary): symbols-declares-dependency-on-other-package libhelloc0c3 (libhello.so.0) [symbols] +hello (binary): symbols-declares-dependency-on-other-package libhelloc0c2 (<< 1.3) (libhello.so.0) [symbols] +hello (binary): symbols-declares-dependency-on-other-package libhello2 (libhello.so.2) [symbols] +hello (binary): symbols-declares-dependency-on-other-package libhello2 (>= 1:2.3) (libhello.so.2) [symbols] +hello (binary): symbols-declares-dependency-on-other-package libhello0c2 (>= 1.2) (libhello.so.0) [symbols] +hello (binary): symbols-declares-dependency-on-other-package libhello0 (libhello.so.0) [symbols] +hello (binary): symbols-declares-dependency-on-other-package hello-dbg3 (libhello.so.0) [symbols] +hello (binary): symbols-declares-dependency-on-other-package hello-dbg2 (libhello.so.0) [symbols] +hello (binary): symbols-declares-dependency-on-other-package hello-dbg (libhello.so.0) [symbols] +hello (binary): symbols-declares-dependency-on-other-package foobar (= 1.2) (libhello.so.0) [symbols] +hello (binary): surplus-shared-library-symbols libhello 2 [symbols] +hello (binary): surplus-shared-library-symbols libhello 0 [symbols] +hello (binary): invalid-template-id-in-symbols-file should this [symbols:4] +hello (binary): invalid-template-id-in-symbols-file A [symbols:14] +hello (binary): invalid-template-id-in-symbols-file 4 [symbols:12] +hello (binary): empty-shared-library-symbols [symbols] +hello (binary): duplicate-entry-in-symbols-control-file (lines 6 22) libhello 0 [symbols] diff --git a/t/recipes/checks/debian/shlibs/legacy-debug/eval/post-test b/t/recipes/checks/debian/shlibs/legacy-debug/eval/post-test new file mode 100644 index 0000000..fc97c5f --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-debug/eval/post-test @@ -0,0 +1,2 @@ +/: hardening-.*/ d +s/\(current is ([0-9]+\.)+[0-9]\)/(current is CURRENT)/ diff --git a/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/changelog.in b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/changelog.in new file mode 100644 index 0000000..91a6bb5 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/legacy-libbaz/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/control b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/control new file mode 100644 index 0000000..1506687 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/legacy-libbaz/build-spec/debian/copyright b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/copyright new file mode 100644 index 0000000..a874c87 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/legacy-libbaz/build-spec/debian/dev.postinst b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/dev.postinst new file mode 100644 index 0000000..683e3cc --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/dev.postinst @@ -0,0 +1,4 @@ +#!/bin/sh -e + +$PKG=libbaz1-dev + diff --git a/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/dev.prerm b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/dev.prerm new file mode 100644 index 0000000..683e3cc --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/dev.prerm @@ -0,0 +1,4 @@ +#!/bin/sh -e + +$PKG=libbaz1-dev + diff --git a/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/lib.postinst b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/lib.postinst new file mode 100644 index 0000000..ec0b98a --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/legacy-libbaz/build-spec/debian/lib.prerm b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/lib.prerm new file mode 100644 index 0000000..50e37c3 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/legacy-libbaz/build-spec/debian/lib.shlibs b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/lib.shlibs new file mode 100644 index 0000000..b88e288 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/legacy-libbaz/build-spec/debian/lib.symbols b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/lib.symbols new file mode 100644 index 0000000..72f9d8a --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/legacy-libbaz/build-spec/debian/rules b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/rules new file mode 100755 index 0000000..fa99bc8 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/legacy-libbaz/build-spec/debian/source.lintian-overrides b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/source.lintian-overrides new file mode 100644 index 0000000..6008d27 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/debian/source.lintian-overrides @@ -0,0 +1 @@ +libbaz source: maintainer-script-lacks-debhelper-token diff --git a/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/fill-values b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/fill-values new file mode 100644 index 0000000..7effe4f --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/legacy-libbaz/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/orig/Makefile new file mode 100644 index 0000000..657dc2a --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/legacy-libbaz/build-spec/orig/baz.c b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/orig/baz.c new file mode 100644 index 0000000..4d5fc45 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/legacy-libbaz/build-spec/orig/extra.c b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/orig/extra.c new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-libbaz/build-spec/orig/extra.c diff --git a/t/recipes/checks/debian/shlibs/legacy-libbaz/eval/desc b/t/recipes/checks/debian/shlibs/legacy-libbaz/eval/desc new file mode 100644 index 0000000..ad73840 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-libbaz/eval/desc @@ -0,0 +1,2 @@ +Testname: legacy-libbaz +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/legacy-libbaz/eval/hints b/t/recipes/checks/debian/shlibs/legacy-libbaz/eval/hints new file mode 100644 index 0000000..8e668dc --- /dev/null +++ b/t/recipes/checks/debian/shlibs/legacy-libbaz/eval/hints @@ -0,0 +1,20 @@ +libbaz2 (binary): no-symbols-control-file usr/lib/libbaz2.so.1.0.3b +libbaz1 (binary): symbols-for-undeclared-shared-library libbaz 2 +libbaz1 (binary): symbols-file-missing-build-depends-package-field libbaz.so.2 [symbols] +libbaz1 (binary): symbols-file-contains-debian-revision on symbol foo (libbaz.so.2) [symbols] +libbaz1 (binary): symbols-file-contains-current-version-with-debian-revision on symbol pw (libbaz.so.2) [symbols] +libbaz1 (binary): surplus-shared-library-symbols libbaz 2 [symbols] +libbaz1 (binary): ships-undeclared-shared-library libbaz2 1.0 for usr/lib/libfoo2.so.1.0.3b [shlibs] +libbaz1 (binary): shared-library-symbols-not-tracked libbaz3 1 for usr/lib/libbaz3.so.1.0.3b [symbols] +libbaz1 (binary): shared-library-symbols-not-tracked libbaz2 1.0 for usr/lib/libfoo2.so.1.0.3b [symbols] +libbaz1 (binary): shared-library-symbols-not-tracked libbaz.so for usr/lib/libbaz.so [symbols] +libbaz1 (binary): shared-library-not-shipped udeb: libdoesntexist2 1.0 [shlibs] +libbaz1 (binary): shared-library-not-shipped libdoesntexist2 1.0 [shlibs] +libbaz1 (binary): shared-library-not-shipped libbaz5 1 [shlibs] +libbaz1 (binary): shared-library-not-shipped libbaz4 1 [shlibs] +libbaz1 (binary): shared-library-not-shipped libbaz2 1.1 [shlibs] +libbaz1 (binary): shared-library-lacks-version usr/lib/libbaz.so libbaz.so +libbaz1 (binary): duplicate-in-shlibs (lines 7 8) udeb: libdoesntexist2 1.0 [shlibs] +libbaz1 (binary): duplicate-in-shlibs (lines 1 2) libdoesntexist2 1.0 [shlibs] +libbaz1 (binary): distant-prerequisite-in-shlibs libbaz2 [shlibs] +libbaz1 (binary): distant-prerequisite-in-shlibs libbaz1 (>> 1-1) [shlibs] diff --git a/t/recipes/checks/debian/shlibs/legacy-libbaz/eval/post-test b/t/recipes/checks/debian/shlibs/legacy-libbaz/eval/post-test new file mode 100755 index 0000000..29dc3f4 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/shared-libs-control-file/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/control.in new file mode 100644 index 0000000..a223c7e --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/control.in @@ -0,0 +1,57 @@ +Source: [% $source %] +Priority: optional +Section: libs +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: libnoshf1 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] (no shlibs file) + 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 shlibs file. + +Package: libeshf1 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] (empty shlibs file) + 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 empty shlibs file. + +Package: libunshf1 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] (unused entry) + 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 unused entry in shlibs file. + +Package: libfdshf1 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] (foreign dep) + 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 foreign dependency entry in shlibs file. + +Package: libdupshf1 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] (dup entry) + 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 duplicate entry in shlibs file. diff --git a/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libdupshf1.install b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libdupshf1.install new file mode 100644 index 0000000..7452fe1 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libdupshf1.install @@ -0,0 +1 @@ +usr/lib/libdupshf* diff --git a/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libdupshf1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libdupshf1.symbols new file mode 100644 index 0000000..166a346 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libdupshf1.symbols @@ -0,0 +1,3 @@ +libdupshf.so.1 libdupshf1 #MINVER# + e@Base 1.0 + energy@Base 0.9 diff --git a/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libeshf1.install b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libeshf1.install new file mode 100644 index 0000000..5ef4c2d --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libeshf1.install @@ -0,0 +1 @@ +usr/lib/libeshf* diff --git a/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libeshf1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libeshf1.symbols new file mode 100644 index 0000000..fdd0204 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libeshf1.symbols @@ -0,0 +1,3 @@ +libeshf.so.1 libeshf1 #MINVER# + e@Base 1.0 + energy@Base 0.9 diff --git a/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libfdshf1.install b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libfdshf1.install new file mode 100644 index 0000000..c01a368 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libfdshf1.install @@ -0,0 +1 @@ +usr/lib/libfdshf* diff --git a/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libfdshf1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libfdshf1.symbols new file mode 100644 index 0000000..4a18831 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libfdshf1.symbols @@ -0,0 +1,3 @@ +libfdshf.so.1 libfdshf1 #MINVER# + e@Base 1.0 + energy@Base 0.9 diff --git a/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libnoshf1.install b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libnoshf1.install new file mode 100644 index 0000000..175a915 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libnoshf1.install @@ -0,0 +1 @@ +usr/lib/libnoshf* diff --git a/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libnoshf1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libnoshf1.symbols new file mode 100644 index 0000000..fef945e --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libnoshf1.symbols @@ -0,0 +1,3 @@ +libnoshf.so.1 libnoshf1 #MINVER# + e@Base 1.0 + energy@Base 0.9 diff --git a/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libunshf1.install b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libunshf1.install new file mode 100644 index 0000000..dcdae56 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libunshf1.install @@ -0,0 +1 @@ +usr/lib/libunshf* diff --git a/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libunshf1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libunshf1.symbols new file mode 100644 index 0000000..737842d --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/libunshf1.symbols @@ -0,0 +1,3 @@ +libunshf.so.1 libunshf1 #MINVER# + e@Base 1.0 + energy@Base 0.9 diff --git a/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/rules b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/rules new file mode 100644 index 0000000..0cd4c15 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/debian/rules @@ -0,0 +1,19 @@ +#!/usr/bin/make -f + +DUPSHF:=debian/libdupshf1/DEBIAN/shlibs + +export DEB_BUILD_MAINT_OPTIONS=hardening=+all + +%: + dh $@ + +override_dh_builddeb: + # Work around "smart tools" that check the shlibs + # before installing them. + rm -f debian/libnoshf1/DEBIAN/shlibs + echo "# aloha" > debian/libeshf1/DEBIAN/shlibs + echo "libfoo 1 libunshf1 (> 0.1)" >> debian/libunshf1/DEBIAN/shlibs + sed -i 's/libfdshf1/libforeign1/' debian/libfdshf1/DEBIAN/shlibs + cat $(DUPSHF) $(DUPSHF) > $(DUPSHF).tmp + mv -f $(DUPSHF).tmp $(DUPSHF) + dh_builddeb diff --git a/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/fill-values b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/fill-values new file mode 100644 index 0000000..9336eee --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/fill-values @@ -0,0 +1,5 @@ +Skeleton: upload-native +Testname: shared-libs-control-file +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test checks related to shlibs files diff --git a/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/orig/Makefile new file mode 100644 index 0000000..37bef22 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/orig/Makefile @@ -0,0 +1,23 @@ +CC=gcc +CFLAGS+= -fPIC + +SONAMES:= libnoshf.so.1 libeshf.so.1 libunshf.so.1 libfdshf.so.1 \ + libdupshf.so.1 +LIBFILES:= $(patsubst %,%.0.1, $(SONAMES)) + +all: $(LIBFILES) + +$(LIBFILES): code.o + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc + +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/debian/shlibs/shared-libs-control-file/build-spec/orig/code.c b/t/recipes/checks/debian/shlibs/shared-libs-control-file/build-spec/orig/code.c new file mode 100644 index 0000000..0ed08e0 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-control-file/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/debian/shlibs/shared-libs-control-file/eval/desc b/t/recipes/checks/debian/shlibs/shared-libs-control-file/eval/desc new file mode 100644 index 0000000..9ccf196 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-control-file/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-control-file +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/shared-libs-control-file/eval/hints b/t/recipes/checks/debian/shlibs/shared-libs-control-file/eval/hints new file mode 100644 index 0000000..87f69e6 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-control-file/eval/hints @@ -0,0 +1,11 @@ +libunshf1 (binary): symbols-file-missing-build-depends-package-field libunshf.so.1 [symbols] +libunshf1 (binary): shared-library-not-shipped libfoo 1 [shlibs] +libunshf1 (binary): outdated-relation-in-shlibs libunshf1 (> 0.1) [shlibs] +libnoshf1 (binary): symbols-file-missing-build-depends-package-field libnoshf.so.1 [symbols] +libnoshf1 (binary): no-shlibs usr/lib/libnoshf.so.1.0.1 +libfdshf1 (binary): symbols-file-missing-build-depends-package-field libfdshf.so.1 [symbols] +libfdshf1 (binary): distant-prerequisite-in-shlibs libforeign1 [shlibs] +libeshf1 (binary): symbols-file-missing-build-depends-package-field libeshf.so.1 [symbols] +libeshf1 (binary): ships-undeclared-shared-library libeshf 1 for usr/lib/libeshf.so.1.0.1 [shlibs] +libdupshf1 (binary): symbols-file-missing-build-depends-package-field libdupshf.so.1 [symbols] +libdupshf1 (binary): duplicate-in-shlibs (lines 1 2) libdupshf 1 [shlibs] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/debian/control.in new file mode 100644 index 0000000..9ca1147 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/debian/control.in @@ -0,0 +1,27 @@ +Source: [% $source %] +Priority: optional +Section: libs +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: libfoo-1 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] + 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: libfoo-dev +Architecture: any +Section: libdevel +Depends: ${shlibs:Depends}, ${misc:Depends}, + libfoo-1 (= ${binary:Version}) +Description: [% $description %] - 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. + . + Dev package. diff --git a/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/debian/libfoo-1.install b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/debian/libfoo-1.install new file mode 100644 index 0000000..cb060ec --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/debian/libfoo-1.install @@ -0,0 +1,2 @@ +lib/libbar-1.so +usr/lib/libfoo-1.so diff --git a/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/debian/libfoo-1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/debian/libfoo-1.symbols new file mode 100644 index 0000000..910a1e5 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/debian/libfoo-1.symbols @@ -0,0 +1,7 @@ +libfoo-1.so libfoo-1 #MINVER# + e@Base 1.0 + energy@Base 0.9 + +libbar-1.so libfoo-1 #MINVER# + e@Base 1.0 + energy@Base 0.9 diff --git a/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/debian/libfoo-dev.install b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/debian/libfoo-dev.install new file mode 100644 index 0000000..ed7b146 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/debian/libfoo-dev.install @@ -0,0 +1,3 @@ +usr/include +usr/lib/libbar.so +usr/lib/libfoo.so diff --git a/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/fill-values b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/fill-values new file mode 100644 index 0000000..5240e59 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/fill-values @@ -0,0 +1,5 @@ +Testname: shared-libs-dev-symlink-fp +Skeleton: upload-non-native +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test against dev symlink fp diff --git a/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/orig/Makefile new file mode 100644 index 0000000..decdff1 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/orig/Makefile @@ -0,0 +1,27 @@ +CC=gcc +CFLAGS+= -fPIC + +SONAME:= libfoo-1.so +LSONAME:= libbar-1.so +devsymlink=$(shell echo $(1) | perl -pe 's:-[\d\.]*\.so$$:\.so:') +LIBFILES:=$(SONAME) $(LSONAME) + +all: $(LIBFILES) + +$(LIBFILES): code.o + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$@ $^ -lc + +clean: + rm -f *.a *.o *.so* + +install: all + install -m 0755 -d $(DESTDIR)/lib + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0755 -d $(DESTDIR)/usr/include + install -m 0644 $(LSONAME) $(DESTDIR)/lib + install -m 0644 $(SONAME) $(DESTDIR)/usr/lib + ln -s /lib/$(LSONAME) $(DESTDIR)/usr/lib/$(call devsymlink,$(LSONAME)) + ln -s $(SONAME) $(DESTDIR)/usr/lib/$(call devsymlink,$(SONAME)) + install -m 0644 code.h $(DESTDIR)/usr/include + +.PHONY: install clean diff --git a/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/orig/code.c b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/orig/code.c new file mode 100644 index 0000000..9a88735 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/orig/code.c @@ -0,0 +1,16 @@ +#include <stdlib.h> +#include <math.h> +#include "code.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/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/orig/code.h b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/orig/code.h new file mode 100644 index 0000000..570beae --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/build-spec/orig/code.h @@ -0,0 +1,8 @@ +#ifndef CODE_H_ +#define CODE_H_ + +double e(void (*f)(char *)); + +double energy(double mass); + +#endif diff --git a/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/eval/desc b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/eval/desc new file mode 100644 index 0000000..c26091f --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-dev-symlink-fp +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/eval/hints b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/eval/hints new file mode 100644 index 0000000..09ab005 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink-fp/eval/hints @@ -0,0 +1,2 @@ +libfoo-1 (binary): symbols-file-missing-build-depends-package-field libfoo-1.so [symbols] +libfoo-1 (binary): symbols-file-missing-build-depends-package-field libbar-1.so [symbols] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/debian/control.in new file mode 100644 index 0000000..dfba657 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/debian/control.in @@ -0,0 +1,27 @@ +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 %] + 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: libfoo-dev +Architecture: any +Section: libdevel +Depends: ${shlibs:Depends}, ${misc:Depends}, + libfoo1 (= ${binary:Version}) +Description: [% $description %] - 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. + . + Dev package. diff --git a/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/debian/libfoo-dev.install b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/debian/libfoo-dev.install new file mode 100644 index 0000000..e43b95c --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/debian/libfoo-dev.install @@ -0,0 +1 @@ +usr/include diff --git a/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/debian/libfoo1.install b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/debian/libfoo1.install new file mode 100644 index 0000000..08fa063 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/debian/libfoo1.install @@ -0,0 +1 @@ +usr/lib/libfoo.so.* diff --git a/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/debian/libfoo1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/debian/libfoo1.symbols new file mode 100644 index 0000000..a1f052b --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/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/debian/shlibs/shared-libs-dev-symlink/build-spec/fill-values b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/fill-values new file mode 100644 index 0000000..9c44aa5 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/fill-values @@ -0,0 +1,5 @@ +Testname: shared-libs-dev-symlink +Skeleton: upload-non-native +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test checks related to dev symlink diff --git a/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/orig/Makefile new file mode 100644 index 0000000..a7a50b9 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/orig/Makefile @@ -0,0 +1,24 @@ +CC=gcc +CFLAGS+= -fPIC + +SONAMES:= libfoo.so.1 +LIBFILES:= $(patsubst %,%.0.1, $(SONAMES)) + +all: $(LIBFILES) + +$(LIBFILES): code.o + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc + +clean: + rm -f *.a *.o *.so* + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0755 -d $(DESTDIR)/usr/include + install -m 0644 *.so* $(DESTDIR)/usr/lib + for FILE in $(SONAMES) ; do \ + ln -s $${FILE}.0.1 $(DESTDIR)/usr/lib/$$FILE ; \ + done + install -m 0644 code.h $(DESTDIR)/usr/include + +.PHONY: install clean diff --git a/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/orig/code.c b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/orig/code.c new file mode 100644 index 0000000..9a88735 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/orig/code.c @@ -0,0 +1,16 @@ +#include <stdlib.h> +#include <math.h> +#include "code.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/debian/shlibs/shared-libs-dev-symlink/build-spec/orig/code.h b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/orig/code.h new file mode 100644 index 0000000..570beae --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/build-spec/orig/code.h @@ -0,0 +1,8 @@ +#ifndef CODE_H_ +#define CODE_H_ + +double e(void (*f)(char *)); + +double energy(double mass); + +#endif diff --git a/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/eval/desc b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/eval/desc new file mode 100644 index 0000000..451ac80 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-dev-symlink +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/eval/hints b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/eval/hints new file mode 100644 index 0000000..a7f8c30 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-dev-symlink/eval/hints @@ -0,0 +1 @@ +libfoo1 (binary): symbols-file-missing-build-depends-package-field libfoo.so.1 [symbols] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/build-spec/debian/control.in new file mode 100644 index 0000000..86a2064 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/build-spec/debian/control.in @@ -0,0 +1,15 @@ +Source: [% $source %] +Priority: optional +Section: libs +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: libexecbit1 +Architecture: [% $package_architecture %] +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] + 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/debian/shlibs/shared-libs-exec-bit/build-spec/debian/libexecbit1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/build-spec/debian/libexecbit1.symbols new file mode 100644 index 0000000..d8226ca --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/build-spec/debian/libexecbit1.symbols @@ -0,0 +1,3 @@ +libexecbit.so.1 libexecbit1 #MINVER# + e@Base 1.0 + energy@Base 0.9 diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/build-spec/debian/rules b/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/build-spec/debian/rules new file mode 100644 index 0000000..9082f3f --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/build-spec/debian/rules @@ -0,0 +1,9 @@ +#!/usr/bin/make -f + +export DEB_BUILD_MAINT_OPTIONS=hardening=+all + +%: + dh $@ + +override_dh_fixperms: + # Do nothing, TYIA diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/build-spec/fill-values b/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/build-spec/fill-values new file mode 100644 index 0000000..0f19b1b --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/build-spec/fill-values @@ -0,0 +1,6 @@ +Skeleton: upload-native +Testname: shared-libs-exec-bit +Package-Architecture: any +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test checks related to libs with exec bit diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/build-spec/orig/Makefile new file mode 100644 index 0000000..0997289 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/build-spec/orig/Makefile @@ -0,0 +1,23 @@ +CC=gcc +CFLAGS+= -fPIC + +SONAMES:= libexecbit.so.1 libbadperm.so.1 +LIBFILES:= $(patsubst %,%.0.1, $(SONAMES)) + +all: $(LIBFILES) + +$(LIBFILES): code.o + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc + +clean: + rm -f *.a *.o *.so* + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0755 *execbit*.so* $(DESTDIR)/usr/lib + install -m 0600 *badperm*.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/debian/shlibs/shared-libs-exec-bit/build-spec/orig/code.c b/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/build-spec/orig/code.c new file mode 100644 index 0000000..0ed08e0 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/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/debian/shlibs/shared-libs-exec-bit/eval/desc b/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/eval/desc new file mode 100644 index 0000000..efef29f --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-exec-bit +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/eval/hints b/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/eval/hints new file mode 100644 index 0000000..b576dcd --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exec-bit/eval/hints @@ -0,0 +1,2 @@ +libexecbit1 (binary): symbols-file-missing-build-depends-package-field libexecbit.so.1 [symbols] +libexecbit1 (binary): symbols-file-missing-build-depends-package-field libbadperm.so.1 [symbols] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/build-spec/debian/control.in new file mode 100644 index 0000000..bd81464 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/build-spec/debian/control.in @@ -0,0 +1,15 @@ +Source: [% $source %] +Priority: optional +Section: libs +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: libexecstack1 +Architecture: [% $package_architecture %] +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] + 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/debian/shlibs/shared-libs-exec-stack/build-spec/debian/libexecstack1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/build-spec/debian/libexecstack1.symbols new file mode 100644 index 0000000..1cc72ae --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/build-spec/debian/libexecstack1.symbols @@ -0,0 +1,3 @@ +libexecstack.so.1 libexecstack1 #MINVER# + foo@Base 1.0 + get@Base 1.0 diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/build-spec/fill-values b/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/build-spec/fill-values new file mode 100644 index 0000000..7ca10e3 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/build-spec/fill-values @@ -0,0 +1,6 @@ +Skeleton: upload-native +Testname: shared-libs-exec-stack +Package-Architecture: any +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test checks related to libs with exec stack diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/build-spec/orig/Makefile new file mode 100644 index 0000000..1754891 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/build-spec/orig/Makefile @@ -0,0 +1,22 @@ +CC=gcc +CFLAGS+= -fPIC + +SONAMES:= libexecstack.so.1 +LIBFILES:= $(patsubst %,%.0.1, $(SONAMES)) + +all: $(LIBFILES) + +$(LIBFILES): foo.o get.o + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ + +clean: + rm -f *.a *.o *.so* + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0755 *.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/debian/shlibs/shared-libs-exec-stack/build-spec/orig/foo.c b/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/build-spec/orig/foo.c new file mode 100644 index 0000000..7f41799 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/build-spec/orig/foo.c @@ -0,0 +1,9 @@ +extern int get(int, int (*)(int)); + +int foo(int a) { + int b = a; + int bar(int a) { + return a + b; + } + return get(a, bar); +} diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/build-spec/orig/get.c b/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/build-spec/orig/get.c new file mode 100644 index 0000000..8207637 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/build-spec/orig/get.c @@ -0,0 +1,6 @@ +int get(int a, int (*f)(int)) { + return f(a); +} + +extern int foo(int); + diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/eval/desc b/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/eval/desc new file mode 100644 index 0000000..f2a5f21 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-exec-stack +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/eval/hints b/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/eval/hints new file mode 100644 index 0000000..57bd1d2 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exec-stack/eval/hints @@ -0,0 +1 @@ +libexecstack1 (binary): symbols-file-missing-build-depends-package-field libexecstack.so.1 [symbols] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/build-spec/debian/control.in new file mode 100644 index 0000000..86a2064 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/build-spec/debian/control.in @@ -0,0 +1,15 @@ +Source: [% $source %] +Priority: optional +Section: libs +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: libexecbit1 +Architecture: [% $package_architecture %] +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] + 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/debian/shlibs/shared-libs-exit-fork/build-spec/debian/libexecbit1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/build-spec/debian/libexecbit1.symbols new file mode 100644 index 0000000..0b26833 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/build-spec/debian/libexecbit1.symbols @@ -0,0 +1,2 @@ +libexecbit.so.1 libexecbit1 #MINVER# + e@Base 1.0 diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/build-spec/fill-values b/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/build-spec/fill-values new file mode 100644 index 0000000..8c30582 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/build-spec/fill-values @@ -0,0 +1,6 @@ +Skeleton: upload-native +Testname: shared-libs-exit-fork +Package-Architecture: any +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test checks related to libs invoking both exit(3) and fork(2) diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/build-spec/orig/Makefile new file mode 100644 index 0000000..68d5863 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/build-spec/orig/Makefile @@ -0,0 +1,22 @@ +CC=gcc +CFLAGS+= -fPIC + +SONAMES:= libexecbit.so.1 +LIBFILES:= $(patsubst %,%.0.1, $(SONAMES)) + +all: $(LIBFILES) + +$(LIBFILES): code.o + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc + +clean: + rm -f *.a *.o *.so* + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0755 *.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/debian/shlibs/shared-libs-exit-fork/build-spec/orig/code.c b/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/build-spec/orig/code.c new file mode 100644 index 0000000..df63394 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/build-spec/orig/code.c @@ -0,0 +1,12 @@ +#include <stdlib.h> +#include <unistd.h> + +double e(void (*f)(char *)){ + char tmp[10]; + double x; + f(tmp); + x = atof(tmp); + if (fork() != 0) + exit(1); + return x; +} diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/eval/desc b/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/eval/desc new file mode 100644 index 0000000..fc71c36 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-exit-fork +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/eval/hints b/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/eval/hints new file mode 100644 index 0000000..6105735 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exit-fork/eval/hints @@ -0,0 +1 @@ +libexecbit1 (binary): symbols-file-missing-build-depends-package-field libexecbit.so.1 [symbols] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exit/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/shared-libs-exit/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exit/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exit/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/shared-libs-exit/build-spec/debian/control.in new file mode 100644 index 0000000..86a2064 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exit/build-spec/debian/control.in @@ -0,0 +1,15 @@ +Source: [% $source %] +Priority: optional +Section: libs +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: libexecbit1 +Architecture: [% $package_architecture %] +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] + 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/debian/shlibs/shared-libs-exit/build-spec/debian/libexecbit1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-exit/build-spec/debian/libexecbit1.symbols new file mode 100644 index 0000000..0b26833 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exit/build-spec/debian/libexecbit1.symbols @@ -0,0 +1,2 @@ +libexecbit.so.1 libexecbit1 #MINVER# + e@Base 1.0 diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exit/build-spec/fill-values b/t/recipes/checks/debian/shlibs/shared-libs-exit/build-spec/fill-values new file mode 100644 index 0000000..99c4585 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exit/build-spec/fill-values @@ -0,0 +1,6 @@ +Skeleton: upload-native +Testname: shared-libs-exit +Package-Architecture: any +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test checks related to libs invoking exit(3) diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exit/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/shared-libs-exit/build-spec/orig/Makefile new file mode 100644 index 0000000..68d5863 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exit/build-spec/orig/Makefile @@ -0,0 +1,22 @@ +CC=gcc +CFLAGS+= -fPIC + +SONAMES:= libexecbit.so.1 +LIBFILES:= $(patsubst %,%.0.1, $(SONAMES)) + +all: $(LIBFILES) + +$(LIBFILES): code.o + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc + +clean: + rm -f *.a *.o *.so* + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0755 *.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/debian/shlibs/shared-libs-exit/build-spec/orig/code.c b/t/recipes/checks/debian/shlibs/shared-libs-exit/build-spec/orig/code.c new file mode 100644 index 0000000..297a4e8 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exit/build-spec/orig/code.c @@ -0,0 +1,13 @@ +#include <stdlib.h> + +double e(void (*f)(char *)){ + char tmp[10]; + double x; + f(tmp); + x = atof(tmp); + if (x < 0.0) { + exit(1); + } else { + return x; + } +} diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exit/eval/desc b/t/recipes/checks/debian/shlibs/shared-libs-exit/eval/desc new file mode 100644 index 0000000..cc20e73 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exit/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-exit +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/shared-libs-exit/eval/hints b/t/recipes/checks/debian/shlibs/shared-libs-exit/eval/hints new file mode 100644 index 0000000..6105735 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-exit/eval/hints @@ -0,0 +1 @@ +libexecbit1 (binary): symbols-file-missing-build-depends-package-field libexecbit.so.1 [symbols] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/build-spec/debian/control.in new file mode 100644 index 0000000..c20a449 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/build-spec/debian/control.in @@ -0,0 +1,15 @@ +Source: [% $source %] +Priority: optional +Section: libs +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: libfoo1 +Architecture: [% $package_architecture %] +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] + 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/debian/shlibs/shared-libs-ldconfig-not-symlink/build-spec/debian/libfoo1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/build-spec/debian/libfoo1.symbols new file mode 100644 index 0000000..a1f052b --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/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/debian/shlibs/shared-libs-ldconfig-not-symlink/build-spec/fill-values b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/build-spec/fill-values new file mode 100644 index 0000000..b000a7b --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/build-spec/fill-values @@ -0,0 +1,6 @@ +Testname: shared-libs-ldconfig-not-symlink +Package-Architecture: any +Skeleton: upload-non-native +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test ldconfig symlink not being a symlink diff --git a/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/build-spec/orig/Makefile new file mode 100644 index 0000000..2e3306e --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/build-spec/orig/Makefile @@ -0,0 +1,20 @@ +CC=gcc +CFLAGS+= -fPIC + +SONAMES:= libfoo.so.1 +LIBFILES:= $(patsubst %,%.0.1, $(SONAMES)) + +all: $(LIBFILES) + +$(LIBFILES): code.o + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc + +clean: + rm -f *.a *.o *.so* + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0644 *.so* $(DESTDIR)/usr/lib + install -T -m 0644 *.so* $(DESTDIR)/usr/lib/libfoo.so.1 + +.PHONY: install clean diff --git a/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/build-spec/orig/code.c b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/build-spec/orig/code.c new file mode 100644 index 0000000..0ed08e0 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/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/debian/shlibs/shared-libs-ldconfig-not-symlink/eval/desc b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/eval/desc new file mode 100644 index 0000000..56356db --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-ldconfig-not-symlink +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/eval/hints b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/eval/hints new file mode 100644 index 0000000..a7f8c30 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-not-symlink/eval/hints @@ -0,0 +1 @@ +libfoo1 (binary): symbols-file-missing-build-depends-package-field libfoo.so.1 [symbols] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/app.install b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/app.install new file mode 100644 index 0000000..fe6951d --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/app.install @@ -0,0 +1,2 @@ +app usr/lib/app + diff --git a/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/app.postinst b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/app.postinst new file mode 100755 index 0000000..3e67b7e --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/app.postrm b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/app.postrm new file mode 100755 index 0000000..eaeb28d --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/app.triggers b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/app.triggers new file mode 100644 index 0000000..dd86603 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/app.triggers @@ -0,0 +1 @@ +activate-noawait ldconfig diff --git a/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/control.in new file mode 100644 index 0000000..9960ee9 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.install b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.install new file mode 100644 index 0000000..b1c4ec9 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.install @@ -0,0 +1 @@ +usr/lib/libfish* diff --git a/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.preinst b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.preinst new file mode 100755 index 0000000..3e67b7e --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.prerm b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.prerm new file mode 100755 index 0000000..3e67b7e --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.symbols new file mode 100644 index 0000000..2c5a075 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.install b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.install new file mode 100644 index 0000000..f3a3a05 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.install @@ -0,0 +1 @@ +usr/lib/libfoo* diff --git a/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.postinst b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.postinst new file mode 100755 index 0000000..2615bf9 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.postrm b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.postrm new file mode 100755 index 0000000..9b2f636 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.symbols new file mode 100644 index 0000000..a1f052b --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.install b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.install new file mode 100644 index 0000000..b91d5ff --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.install @@ -0,0 +1 @@ +usr/lib/libuns* diff --git a/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.postrm b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.postrm new file mode 100755 index 0000000..acc5d15 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.symbols new file mode 100644 index 0000000..d91149f --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/rules b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/debian/rules new file mode 100755 index 0000000..b1c71a9 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/fill-values b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/fill-values new file mode 100644 index 0000000..2159596 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/orig/Makefile new file mode 100644 index 0000000..4d3c286 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/orig/app b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/orig/app new file mode 100755 index 0000000..04f1961 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/orig/app @@ -0,0 +1,2 @@ +#!/bin/sh +echo Hello World diff --git a/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/orig/code.c b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/build-spec/orig/code.c new file mode 100644 index 0000000..0ed08e0 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/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/debian/shlibs/shared-libs-ldconfig-scripts/eval/desc b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/eval/desc new file mode 100644 index 0000000..a05f43e --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-ldconfig-scripts +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/eval/hints b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/eval/hints new file mode 100644 index 0000000..67c138b --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-scripts/eval/hints @@ -0,0 +1,3 @@ +libuns1 (binary): symbols-file-missing-build-depends-package-field libuns.so.1 [symbols] +libfoo1 (binary): symbols-file-missing-build-depends-package-field libfoo.so.1 [symbols] +libfish1 (binary): symbols-file-missing-build-depends-package-field libfish.so.1 [symbols] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/build-spec/debian/control.in new file mode 100644 index 0000000..c20a449 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/build-spec/debian/control.in @@ -0,0 +1,15 @@ +Source: [% $source %] +Priority: optional +Section: libs +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: libfoo1 +Architecture: [% $package_architecture %] +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] + 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/debian/shlibs/shared-libs-ldconfig-wrong-file/build-spec/debian/libfoo1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/build-spec/debian/libfoo1.symbols new file mode 100644 index 0000000..a1f052b --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/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/debian/shlibs/shared-libs-ldconfig-wrong-file/build-spec/fill-values b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/build-spec/fill-values new file mode 100644 index 0000000..74b1f2a --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/build-spec/fill-values @@ -0,0 +1,6 @@ +Testname: shared-libs-ldconfig-wrong-file +Package-Architecture: any +Skeleton: upload-non-native +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test ldconfig symlink with wrong target diff --git a/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/build-spec/orig/Makefile new file mode 100644 index 0000000..373cbd2 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/build-spec/orig/Makefile @@ -0,0 +1,22 @@ +CC=gcc +CFLAGS+= -fPIC + +SONAMES:= libfoo.so.1 +LIBFILES:= $(patsubst %,%.0.1, $(SONAMES)) + +all: $(LIBFILES) + +$(LIBFILES): code.o + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc + +clean: + rm -f *.a *.o *.so* + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0644 *.so* $(DESTDIR)/usr/lib + echo "Strauss: Also Sprach Zarathustra" > \ + $(DESTDIR)/usr/lib/some-other-file + ln -s some-other-file $(DESTDIR)/usr/lib/libfoo.so.1 + +.PHONY: install clean diff --git a/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/build-spec/orig/code.c b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/build-spec/orig/code.c new file mode 100644 index 0000000..0ed08e0 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/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/debian/shlibs/shared-libs-ldconfig-wrong-file/eval/desc b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/eval/desc new file mode 100644 index 0000000..7cba095 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-ldconfig-wrong-file +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/eval/hints b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/eval/hints new file mode 100644 index 0000000..a7f8c30 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-ldconfig-wrong-file/eval/hints @@ -0,0 +1 @@ +libfoo1 (binary): symbols-file-missing-build-depends-package-field libfoo.so.1 [symbols] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/build-spec/debian/control.in new file mode 100644 index 0000000..86a2064 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/build-spec/debian/control.in @@ -0,0 +1,15 @@ +Source: [% $source %] +Priority: optional +Section: libs +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: libexecbit1 +Architecture: [% $package_architecture %] +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] + 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/debian/shlibs/shared-libs-missing-ldconfig-symlink/build-spec/debian/libexecbit1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/build-spec/debian/libexecbit1.symbols new file mode 100644 index 0000000..0b26833 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/build-spec/debian/libexecbit1.symbols @@ -0,0 +1,2 @@ +libexecbit.so.1 libexecbit1 #MINVER# + e@Base 1.0 diff --git a/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/build-spec/fill-values b/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/build-spec/fill-values new file mode 100644 index 0000000..50aa473 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/build-spec/fill-values @@ -0,0 +1,6 @@ +Skeleton: upload-native +Testname: shared-libs-missing-ldconfig-symlink +Package-Architecture: any +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test for missing ldconfig symlink for shared libs diff --git a/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/build-spec/orig/Makefile new file mode 100644 index 0000000..6de6868 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/build-spec/orig/Makefile @@ -0,0 +1,19 @@ +CC=gcc +CFLAGS+= -fPIC + +SONAMES:= libexecbit.so.1 +LIBFILES:= $(patsubst %,%.0.1, $(SONAMES)) + +all: $(LIBFILES) + +$(LIBFILES): code.o + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc + +clean: + rm -f *.a *.o *.so* + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0755 *.so* $(DESTDIR)/usr/lib + +.PHONY: install clean diff --git a/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/build-spec/orig/code.c b/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/build-spec/orig/code.c new file mode 100644 index 0000000..65887f3 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/build-spec/orig/code.c @@ -0,0 +1,10 @@ +#include <stdlib.h> +#include <math.h> + +double e(void (*f)(char *)){ + char tmp[10]; + double x; + f(tmp); + x = atof(tmp); + return exp(x); +} diff --git a/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/eval/desc b/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/eval/desc new file mode 100644 index 0000000..04a4305 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/eval/desc @@ -0,0 +1,3 @@ +Testname: shared-libs-missing-ldconfig-symlink +Check: debian/shlibs + diff --git a/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/eval/hints b/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/eval/hints new file mode 100644 index 0000000..6105735 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-missing-ldconfig-symlink/eval/hints @@ -0,0 +1 @@ +libexecbit1 (binary): symbols-file-missing-build-depends-package-field libexecbit.so.1 [symbols] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/build-spec/debian/control.in new file mode 100644 index 0000000..29d4c58 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/build-spec/debian/control.in @@ -0,0 +1,16 @@ +Source: [% $source %] +Priority: optional +Section: libs +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: libhallo1 +Architecture: [% $package_architecture %] +Depends: ${shlibs:Depends}, ${misc:Depends} +Multi-Arch: foreign +Description: [% $description %] + 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/debian/shlibs/shared-libs-multi-arch-foreign/build-spec/debian/libhallo1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/build-spec/debian/libhallo1.symbols new file mode 100644 index 0000000..4c27e3f --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/build-spec/debian/libhallo1.symbols @@ -0,0 +1,2 @@ +libhallo.so.1 libhallo1 #MINVER# + e@Base 1.0 diff --git a/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/build-spec/fill-values b/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/build-spec/fill-values new file mode 100644 index 0000000..de5d6cc --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/build-spec/fill-values @@ -0,0 +1,6 @@ +Skeleton: upload-native +Testname: shared-libs-multi-arch-foreign +Package-Architecture: any +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test for shared libs in m-a foreign pkgs diff --git a/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/build-spec/orig/Makefile new file mode 100644 index 0000000..ac55af7 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/build-spec/orig/Makefile @@ -0,0 +1,22 @@ +CC=gcc +CFLAGS+= -fPIC + +SONAMES:= libhallo.so.1 +LIBFILES:= $(patsubst %,%.0.1, $(SONAMES)) + +all: $(LIBFILES) + +$(LIBFILES): code.o + $(CC) $(LDFLAGS) -fPIC -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc + +clean: + rm -f *.a *.o *.so* + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0755 *.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/debian/shlibs/shared-libs-multi-arch-foreign/build-spec/orig/code.c b/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/build-spec/orig/code.c new file mode 100644 index 0000000..65887f3 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/build-spec/orig/code.c @@ -0,0 +1,10 @@ +#include <stdlib.h> +#include <math.h> + +double e(void (*f)(char *)){ + char tmp[10]; + double x; + f(tmp); + x = atof(tmp); + return exp(x); +} diff --git a/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/eval/desc b/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/eval/desc new file mode 100644 index 0000000..6dee0b4 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-multi-arch-foreign +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/eval/hints b/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/eval/hints new file mode 100644 index 0000000..8a5512d --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-multi-arch-foreign/eval/hints @@ -0,0 +1 @@ +libhallo1 (binary): symbols-file-missing-build-depends-package-field libhallo.so.1 [symbols] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/build-spec/debian/control.in new file mode 100644 index 0000000..c749732 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/build-spec/debian/control.in @@ -0,0 +1,15 @@ +Source: [% $source %] +Priority: optional +Section: libs +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: libhallo1 +Architecture: [% $package_architecture %] +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] + 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/debian/shlibs/shared-libs-no-gnu-stack/build-spec/debian/libhallo1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/build-spec/debian/libhallo1.symbols new file mode 100644 index 0000000..4c27e3f --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/build-spec/debian/libhallo1.symbols @@ -0,0 +1,2 @@ +libhallo.so.1 libhallo1 #MINVER# + e@Base 1.0 diff --git a/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/build-spec/fill-values b/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/build-spec/fill-values new file mode 100644 index 0000000..c238ab1 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/build-spec/fill-values @@ -0,0 +1,6 @@ +Skeleton: upload-native +Testname: shared-libs-no-gnu-stack +Package-Architecture: any +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test for shared libs without PT_GNU_STACK diff --git a/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/build-spec/orig/Makefile new file mode 100644 index 0000000..8d357a8 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/build-spec/orig/Makefile @@ -0,0 +1,23 @@ +CC=gcc +CFLAGS+= -fPIC + +SONAMES:= libhallo.so.1 +LIBFILES:= $(patsubst %,%.0.1, $(SONAMES)) + +all: $(LIBFILES) + +$(LIBFILES): code.o + $(CC) $(LDFLAGS) -fPIC -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc + ./erase-pt-gnu-stack $@ + +clean: + rm -f *.a *.o *.so* + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0755 *.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/debian/shlibs/shared-libs-no-gnu-stack/build-spec/orig/code.c b/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/build-spec/orig/code.c new file mode 100644 index 0000000..65887f3 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/build-spec/orig/code.c @@ -0,0 +1,10 @@ +#include <stdlib.h> +#include <math.h> + +double e(void (*f)(char *)){ + char tmp[10]; + double x; + f(tmp); + x = atof(tmp); + return exp(x); +} diff --git a/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/build-spec/orig/erase-pt-gnu-stack b/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/build-spec/orig/erase-pt-gnu-stack new file mode 100755 index 0000000..d3b7e59 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/build-spec/orig/erase-pt-gnu-stack @@ -0,0 +1,9 @@ +#!/usr/bin/perl -pi + +use strict; +use warnings; + +my $PT_GNU_STACK = 0x6474e551; +my $be = pack('L>', $PT_GNU_STACK); +my $le = pack('L<', $PT_GNU_STACK); +s/\Q$be\E|\Q$le\E/\0\0\0\0/g; diff --git a/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/eval/desc b/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/eval/desc new file mode 100644 index 0000000..cab1f1c --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-no-gnu-stack +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/eval/hints b/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/eval/hints new file mode 100644 index 0000000..8a5512d --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-no-gnu-stack/eval/hints @@ -0,0 +1 @@ +libhallo1 (binary): symbols-file-missing-build-depends-package-field libhallo.so.1 [symbols] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/build-spec/debian/control.in new file mode 100644 index 0000000..c20a449 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/build-spec/debian/control.in @@ -0,0 +1,15 @@ +Source: [% $source %] +Priority: optional +Section: libs +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: libfoo1 +Architecture: [% $package_architecture %] +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] + 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/debian/shlibs/shared-libs-no-shared-lib/build-spec/debian/libfoo1.install b/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/build-spec/debian/libfoo1.install new file mode 100644 index 0000000..1d2eaab --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/build-spec/debian/libfoo1.install @@ -0,0 +1 @@ +some-lib usr/lib diff --git a/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/build-spec/debian/libfoo1.shlibs b/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/build-spec/debian/libfoo1.shlibs new file mode 100644 index 0000000..f233a64 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/build-spec/debian/libfoo1.shlibs @@ -0,0 +1 @@ +libfoo 1 libfoo1 (>= 1.0) diff --git a/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/build-spec/debian/libfoo1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/build-spec/debian/libfoo1.symbols new file mode 100644 index 0000000..a1f052b --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/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/debian/shlibs/shared-libs-no-shared-lib/build-spec/fill-values b/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/build-spec/fill-values new file mode 100644 index 0000000..730c2cd --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/build-spec/fill-values @@ -0,0 +1,4 @@ +Skeleton: upload-native +Testname: shared-libs-no-shared-lib +Package-Architecture: any +Description: Test checks shlib without SO diff --git a/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/build-spec/orig/some-lib b/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/build-spec/orig/some-lib new file mode 100644 index 0000000..5707e12 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/build-spec/orig/some-lib @@ -0,0 +1 @@ +Aloah world diff --git a/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/eval/desc b/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/eval/desc new file mode 100644 index 0000000..1b13462 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-no-shared-lib +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/eval/hints b/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/eval/hints new file mode 100644 index 0000000..38aca0a --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-no-shared-lib/eval/hints @@ -0,0 +1 @@ +libfoo1 (binary): empty-shlibs [shlibs] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/build-spec/debian/control.in new file mode 100644 index 0000000..c20a449 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/build-spec/debian/control.in @@ -0,0 +1,15 @@ +Source: [% $source %] +Priority: optional +Section: libs +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: libfoo1 +Architecture: [% $package_architecture %] +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] + 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/debian/shlibs/shared-libs-non-dev-symlink/build-spec/debian/libfoo1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/build-spec/debian/libfoo1.symbols new file mode 100644 index 0000000..a1f052b --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/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/debian/shlibs/shared-libs-non-dev-symlink/build-spec/fill-values b/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/build-spec/fill-values new file mode 100644 index 0000000..cec22d9 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/build-spec/fill-values @@ -0,0 +1,6 @@ +Testname: shared-libs-non-dev-symlink +Package-Architecture: any +Skeleton: upload-non-native +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test checks related to dev symlink diff --git a/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/build-spec/orig/Makefile new file mode 100644 index 0000000..b62fa17 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/build-spec/orig/Makefile @@ -0,0 +1,21 @@ +CC=gcc +CFLAGS+= -fPIC + +SONAMES:= libfoo.so.1 +LIBFILES:= $(patsubst %,%.0.1, $(SONAMES)) + +all: $(LIBFILES) + +$(LIBFILES): code.o + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc + +clean: + rm -f *.a *.o *.so* + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0644 *.so* $(DESTDIR)/usr/lib + ln -s libfoo.so.1.0.1 $(DESTDIR)/usr/lib/libfoo.so.1 + ln -s libfoo.so.1.0.1 $(DESTDIR)/usr/lib/libfoo.so + +.PHONY: install clean diff --git a/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/build-spec/orig/code.c b/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/build-spec/orig/code.c new file mode 100644 index 0000000..0ed08e0 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/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/debian/shlibs/shared-libs-non-dev-symlink/eval/desc b/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/eval/desc new file mode 100644 index 0000000..905bf7f --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-non-dev-symlink +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/eval/hints b/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/eval/hints new file mode 100644 index 0000000..a7f8c30 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-non-dev-symlink/eval/hints @@ -0,0 +1 @@ +libfoo1 (binary): symbols-file-missing-build-depends-package-field libfoo.so.1 [symbols] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/Makefile.in b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/Makefile.in new file mode 100644 index 0000000..372897d --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/Makefile.in @@ -0,0 +1,110 @@ +# this makefile was adapted from the standard template to do just one thing: +# to ensure that no building takes place on architectures other than i386. +# +# dpkg-buildpackage croaks not only on build errors but also if there simply +# is nothing to do. source packages are nowadays permitted to create +# undeclared build artifacts. there is no way to tell when a build should +# or should not proceed (although the buildds use a heuristic based on the +# dsc). +# +# this makefile also touches the build product to make sure it exists. for +# historical reasons, the test runner check that (although perhaps it should +# not). +# +# more information may be available at Bug#949066. + +ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) + +package = [% $source %] +upstream_version = [% $upstream_version %] +type = [% $type %] + +packagedir = $(package)-$(upstream_version) + +origdata = $(ROOT_DIR)/orig +origtargz = $(package)_$(upstream_version).orig.tar.gz + +debiandata = $(ROOT_DIR)/debian +formatfile = $(debiandata)/source/format + +diffdata = $(ROOT_DIR)/diff + +private_key = $(ROOT_DIR)/upstream/private-key.asc + +pre_build = $(ROOT_DIR)/pre-build +post_build = $(ROOT_DIR)/post-build +pre_upstream = $(ROOT_DIR)/pre-upstream + +product = [% $build_product %] +upload_type = [% $upload_type %] + +ifeq ($(upload_type),source) +extraflags = -S +else +extraflags = +endif + +.DEFAULT_GOAL := $(product) + +ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH),i386) +$(product): $(origtargz) + if [ -r $(origtargz) -a -r $(private_key) ] ; then \ + tmpdir=$(shell mktemp -d) ; \ + gpg --homedir "$$tmpdir" --import $(private_key) ; \ + gpg --homedir "$$tmpdir" --batch --yes --armor --output $(origtargz).asc \ + --detach-sign $(origtargz) ; \ + gpg-connect-agent --homedir "$$tmpdir" KILLAGENT /bye ; \ + rm -rf "$$tmpdir" ; \ + fi + if [ -d $(diffdata)/. ] ; then \ + cp -rp $(diffdata)/. $(packagedir) ; \ + fi + if [ -d $(debiandata)/. ] ; then \ + cp -rp $(debiandata)/. $(packagedir)/debian ; \ + fi + + if [ -x $(pre_build) ] ; then \ + $(pre_build) $(shell realpath $(packagedir)) ; \ + fi + + cd $(packagedir) && dpkg-buildpackage -rfakeroot $(extraflags) -us -uc -d \ + -iNEVER_MATCH_ANYTHING -INEVER_MATCH_ANYTHING --source-option=--auto-commit + + if [ -x $(post_build) ] ; then \ + $(post_build) $(shell realpath $(packagedir)) ; \ + fi +else +$(product): + touch $(product) +endif + +ifeq ($(type),native) +$(origtargz): + -mkdir $(packagedir) + if [ -d $(origdata)/. ] ; then \ + cp -rp $(origdata)/. $(packagedir) ; \ + fi +else +$(origtargz): + -mkdir $(packagedir) + if [ -d $(origdata)/. ] ; then \ + cp -rp $(origdata)/. $(packagedir) ; \ + fi + + if [ -x $(pre_upstream) ] ; then \ + $(pre_upstream) $(shell realpath $(packagedir)) ; \ + fi + + tar czf $(origtargz) $(packagedir) + + if [ -f $(formatfile) ] && grep --quiet "^3\.. (quilt)$$" $(formatfile) ; then \ + rm -rf $(packagedir)/debian ; \ + fi +endif + +.PHONY: clean +clean: + rm -rf $(packagedir) + if [ "$(type)" = "native" ] ; then \ + rm -f $(origtargz) ; \ + fi diff --git a/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/debian/control.in new file mode 100644 index 0000000..47c51c7 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/debian/control.in @@ -0,0 +1,16 @@ +Source: [% $source %] +Priority: optional +Section: libs +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: libbaz3-1 +Architecture: [% $package_architecture %] +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] + 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/debian/shlibs/shared-libs-non-pic-i386/build-spec/debian/symbols b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/debian/symbols new file mode 100644 index 0000000..63ba04d --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/debian/symbols @@ -0,0 +1,3 @@ +libbaz3.so libbaz3-1 #MINVER# + pw@Base 1.0 + stackprotfix@Base 1.0 diff --git a/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/fill-values b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/fill-values new file mode 100644 index 0000000..cb0b316 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/fill-values @@ -0,0 +1,6 @@ +Skeleton: upload-native +Testname: shared-libs-non-pic-i386 +Package-Architecture: i386 +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test checks related to non-pic code diff --git a/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/orig/Makefile new file mode 100644 index 0000000..c5ec48c --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/orig/Makefile @@ -0,0 +1,26 @@ +CC=gcc + +NOPICOBJS=non-pic.o +SONAME:=libbaz3.so.1 + +NOPIC_CFLAGS = $(CFLAGS) -fno-PIE +NOPIC_LDFLAGS = $(LDFLAGS) -fno-PIE -fno-pie + +all: libbaz3.so.1.0.3b + +# Non-PIC. We can't test this on all architectures +libbaz3.so.1.0.3b: $(NOPICOBJS) + $(CC) $(NOPIC_LDFLAGS) -o $@ -shared -Wl,-soname,$(SONAME) $^ -lc + +%.o: %.c + $(CC) $(NOPIC_CFLAGS) $(CPPFLAGS) -o $@ -c $< + +clean: + rm -f *.a *.o *.so* *.sho + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0644 *.so* $(DESTDIR)/usr/lib + ln -s libbaz3.so.1.0.3b $(DESTDIR)/usr/lib/$(SONAME) + +.PHONY: install clean diff --git a/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/orig/non-pic.c b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/orig/non-pic.c new file mode 100644 index 0000000..f0fa719 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/build-spec/orig/non-pic.c @@ -0,0 +1,11 @@ +#include <math.h> +#include <string.h> + +double pw(double p){ + return exp(p); +} + +void stackprotfix(void (*f)(char *, size_t)) { + char buffer[10]; + f(buffer, sizeof(buffer)); +} diff --git a/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/eval/desc b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/eval/desc new file mode 100644 index 0000000..7d0d190 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/eval/desc @@ -0,0 +1,3 @@ +Testname: shared-libs-non-pic-i386 +Test-Architectures: i386 +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/eval/hints b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/eval/hints new file mode 100644 index 0000000..13e63f6 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/eval/hints @@ -0,0 +1 @@ +libbaz3-1 (binary): symbols-file-missing-build-depends-package-field libbaz3.so.1 [symbols] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/eval/post-test b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/eval/post-test new file mode 100755 index 0000000..11ad2c8 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-non-pic-i386/eval/post-test @@ -0,0 +1 @@ +/: hardening-.*/ d diff --git a/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/compat.in b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/control.in new file mode 100644 index 0000000..021518f --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/control.in @@ -0,0 +1,48 @@ +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 %] (deb revision) + 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 deb revisions in symbols files and other brokenness. + +Package: libsym1 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] (missing) + 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 symbol file. + + +Package: libesym1 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] (empty symbols) + 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 empty symbol file/missing shlib in symbols file. + +Package: nolibrary +Architecture: all +Depends: ${misc:Depends} +Description: [% $description %] (not a library) + 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. + . + Check for shipping a symbols file without a library. diff --git a/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/libesym1.install b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/libesym1.install new file mode 100644 index 0000000..750092c --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/libesym1.install @@ -0,0 +1 @@ +usr/lib/libesym* diff --git a/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/libfoo1.install b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/libfoo1.install new file mode 100644 index 0000000..f3a3a05 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/libfoo1.install @@ -0,0 +1 @@ +usr/lib/libfoo* diff --git a/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/libfoo1.symbols b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/libfoo1.symbols new file mode 100644 index 0000000..7b91609 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/libfoo1.symbols @@ -0,0 +1,10 @@ +libfoo.so.1 libfoo1 #MINVER# + e@Base 1.0-1 + energy@Base 0.9-1 + +# duplicate +# - e@Base has a bad index +# - energy@Base is a syntax error (missing version) +libfoo.so.1 libfoo1 #MINVER# + e@Base 1.0 1 + energy@Base diff --git a/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/libsym1.install b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/libsym1.install new file mode 100644 index 0000000..7faef4f --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/libsym1.install @@ -0,0 +1 @@ +usr/lib/libsym* diff --git a/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/nolibrary.install b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/nolibrary.install new file mode 100644 index 0000000..241d370 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/nolibrary.install @@ -0,0 +1 @@ +someconf.conf etc/ diff --git a/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/rules b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/rules new file mode 100644 index 0000000..9ef2bb2 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/debian/rules @@ -0,0 +1,17 @@ +#!/usr/bin/make -f + +export DEB_BUILD_MAINT_OPTIONS=hardening=+all + +%: + dh $@ + +override_dh_builddeb: + # Apparently some of the tools are too smart to install + # a redundant/empty symbols file in the package, so here + # is a non-empty useless symbols file! + echo "# Aloha!" > debian/libesym1/DEBIAN/symbols + echo "# Aloha!" > debian/nolibrary/DEBIAN/symbols + # ... they are also too smart to install slightly broken + # variants of symbols files + install -m 0644 debian/libfoo1.symbols debian/libfoo1/DEBIAN/symbols + dh_builddeb diff --git a/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/fill-values b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/fill-values new file mode 100644 index 0000000..63a0f65 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/fill-values @@ -0,0 +1,5 @@ +Testname: shared-libs-symbols-file +Skeleton: upload-non-native +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test checks related to symbols files diff --git a/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/orig/Makefile new file mode 100644 index 0000000..5ab4ec1 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/orig/Makefile @@ -0,0 +1,22 @@ +CC=gcc +CFLAGS+= -fPIC + +SONAMES:= libfoo.so.1 libsym.so.1 libesym.so.1 +LIBFILES:= $(patsubst %,%.0.1, $(SONAMES)) + +all: $(LIBFILES) + +$(LIBFILES): code.o + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lc + +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/debian/shlibs/shared-libs-symbols-file/build-spec/orig/code.c b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/orig/code.c new file mode 100644 index 0000000..0ed08e0 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/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/debian/shlibs/shared-libs-symbols-file/build-spec/orig/someconf.conf b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/orig/someconf.conf new file mode 100644 index 0000000..16940ea --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/build-spec/orig/someconf.conf @@ -0,0 +1,2 @@ +# Yada yada yada +Var=Val diff --git a/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/eval/desc b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/eval/desc new file mode 100644 index 0000000..a35e821 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-symbols-file +Check: debian/shlibs diff --git a/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/eval/hints b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/eval/hints new file mode 100644 index 0000000..d7b0307 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-symbols-file/eval/hints @@ -0,0 +1,9 @@ +nolibrary (binary): empty-shared-library-symbols [symbols] +libsym1 (binary): no-symbols-control-file usr/lib/libsym.so.1.0.1 +libfoo1 (binary): syntax-error-in-symbols-file [symbols:10] +libfoo1 (binary): symbols-file-missing-build-depends-package-field libfoo.so.1 [symbols] +libfoo1 (binary): symbols-file-contains-debian-revision on symbol energy@Base (libfoo.so.1) [symbols] +libfoo1 (binary): symbols-file-contains-current-version-with-debian-revision on symbol e@Base (libfoo.so.1) [symbols] +libfoo1 (binary): invalid-template-id-in-symbols-file 1 [symbols:9] +libfoo1 (binary): duplicate-entry-in-symbols-control-file (lines 1 8) libfoo 1 [symbols] +libesym1 (binary): shared-library-symbols-not-tracked libesym 1 for usr/lib/libesym.so.1.0.1 [symbols] diff --git a/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/debian/control.in b/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/debian/control.in new file mode 100644 index 0000000..d0e5f60 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/debian/control.in @@ -0,0 +1,15 @@ +Source: [% $source %] +Priority: optional +Section: libs +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: libfoo +Architecture: [% $package_architecture %] +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] + 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/debian/shlibs/shared-libs-unversioned/build-spec/debian/rules b/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/debian/rules new file mode 100755 index 0000000..f60e347 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/debian/rules @@ -0,0 +1,13 @@ +#!/usr/bin/make -f + +export DEB_BUILD_MAINT_OPTIONS=hardening=+all + +%: + dh $@ + +# Do this manually so it works with jessie's debhelper without +# breaking of stretch because we get two triggers. +# - This rules file can be removed once lintian requires +# debhelper/9.20160403 or newer. +override_dh_makeshlibs: + dh_makeshlibs -n diff --git a/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/debian/symbols b/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/debian/symbols new file mode 100644 index 0000000..76a969f --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/debian/symbols @@ -0,0 +1,2 @@ +libfoo.so libfoo #MINVER# + foo@Base 1.0 diff --git a/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/debian/triggers b/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/debian/triggers new file mode 100644 index 0000000..dd86603 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/debian/triggers @@ -0,0 +1 @@ +activate-noawait ldconfig diff --git a/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/fill-values b/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/fill-values new file mode 100644 index 0000000..8343487 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/fill-values @@ -0,0 +1,4 @@ +Skeleton: upload-native +Testname: shared-libs-unversioned +Package-Architecture: any +Description: Test handling of shared libraries without versioned SONAMEs diff --git a/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/orig/Makefile b/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/orig/Makefile new file mode 100644 index 0000000..daf74d1 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/orig/Makefile @@ -0,0 +1,15 @@ +CC = gcc + +all: libfoo.so + +libfoo.so: foo.o + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libfoo.so $^ -lc + +%.o: %.c + $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -o $@ -c $< + +install: + install -d $(DESTDIR)/usr/lib + install -m644 libfoo.so $(DESTDIR)/usr/lib/ + +.PHONY: distclean realclean clean install test check diff --git a/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/orig/foo.c b/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/orig/foo.c new file mode 100644 index 0000000..aa323d5 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-unversioned/build-spec/orig/foo.c @@ -0,0 +1,24 @@ +/* + * Be sure that this library uses a function from libc. Otherwise, gcc is + * smart enough not to link it with libc and we get more tags for missing + * dependency lines. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> + +double e(void (*f)(char *)){ + char tmp[10]; + double x; + f(tmp); + x = atof(tmp); + return exp(x); +} + +int +foo(int num) +{ + printf("%d\n", num); + return num * 42; +} diff --git a/t/recipes/checks/debian/shlibs/shared-libs-unversioned/eval/desc b/t/recipes/checks/debian/shlibs/shared-libs-unversioned/eval/desc new file mode 100644 index 0000000..1937c93 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-unversioned/eval/desc @@ -0,0 +1,5 @@ +Testname: shared-libs-unversioned +Check: debian/shlibs +Test-Against: + ships-undeclared-shared-library +See-Also: Debian Bug#506673 diff --git a/t/recipes/checks/debian/shlibs/shared-libs-unversioned/eval/hints b/t/recipes/checks/debian/shlibs/shared-libs-unversioned/eval/hints new file mode 100644 index 0000000..eee1d97 --- /dev/null +++ b/t/recipes/checks/debian/shlibs/shared-libs-unversioned/eval/hints @@ -0,0 +1,2 @@ +libfoo (binary): symbols-file-missing-build-depends-package-field libfoo.so [symbols] +libfoo (binary): shared-library-lacks-version usr/lib/libfoo.so libfoo.so |