diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:42:30 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:42:30 +0000 |
commit | 75808db17caf8b960b351e3408e74142f4c85aac (patch) | |
tree | 7989e9c09a4240248bf4658a22208a0a52d991c4 /t/recipes/checks/files/architecture/binaries-multiarch | |
parent | Initial commit. (diff) | |
download | lintian-75808db17caf8b960b351e3408e74142f4c85aac.tar.xz lintian-75808db17caf8b960b351e3408e74142f4c85aac.zip |
Adding upstream version 2.117.0.upstream/2.117.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 't/recipes/checks/files/architecture/binaries-multiarch')
10 files changed, 105 insertions, 0 deletions
diff --git a/t/recipes/checks/files/architecture/binaries-multiarch/build-spec/debian/compat.in b/t/recipes/checks/files/architecture/binaries-multiarch/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/files/architecture/binaries-multiarch/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/files/architecture/binaries-multiarch/build-spec/debian/control.in b/t/recipes/checks/files/architecture/binaries-multiarch/build-spec/debian/control.in new file mode 100644 index 0000000..aa271ff --- /dev/null +++ b/t/recipes/checks/files/architecture/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/files/architecture/binaries-multiarch/build-spec/debian/libbasic2.symbols b/t/recipes/checks/files/architecture/binaries-multiarch/build-spec/debian/libbasic2.symbols new file mode 100644 index 0000000..c2b8fb3 --- /dev/null +++ b/t/recipes/checks/files/architecture/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/files/architecture/binaries-multiarch/build-spec/debian/rules b/t/recipes/checks/files/architecture/binaries-multiarch/build-spec/debian/rules new file mode 100644 index 0000000..249fe25 --- /dev/null +++ b/t/recipes/checks/files/architecture/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/files/architecture/binaries-multiarch/build-spec/fill-values b/t/recipes/checks/files/architecture/binaries-multiarch/build-spec/fill-values new file mode 100644 index 0000000..a521479 --- /dev/null +++ b/t/recipes/checks/files/architecture/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/files/architecture/binaries-multiarch/build-spec/orig/Makefile b/t/recipes/checks/files/architecture/binaries-multiarch/build-spec/orig/Makefile new file mode 100644 index 0000000..979e366 --- /dev/null +++ b/t/recipes/checks/files/architecture/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/files/architecture/binaries-multiarch/build-spec/orig/basic.c b/t/recipes/checks/files/architecture/binaries-multiarch/build-spec/orig/basic.c new file mode 100644 index 0000000..27e93fc --- /dev/null +++ b/t/recipes/checks/files/architecture/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/files/architecture/binaries-multiarch/eval/desc b/t/recipes/checks/files/architecture/binaries-multiarch/eval/desc new file mode 100644 index 0000000..039d4be --- /dev/null +++ b/t/recipes/checks/files/architecture/binaries-multiarch/eval/desc @@ -0,0 +1,4 @@ +Testname: binaries-multiarch +Test-Architectures: i386 amd64 +Test-Against: triplet-dir-and-architecture-mismatch +Check: files/architecture diff --git a/t/recipes/checks/files/architecture/binaries-multiarch/eval/hints b/t/recipes/checks/files/architecture/binaries-multiarch/eval/hints new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/t/recipes/checks/files/architecture/binaries-multiarch/eval/hints @@ -0,0 +1 @@ + diff --git a/t/recipes/checks/files/architecture/binaries-multiarch/eval/post-test b/t/recipes/checks/files/architecture/binaries-multiarch/eval/post-test new file mode 100644 index 0000000..fdc0a20 --- /dev/null +++ b/t/recipes/checks/files/architecture/binaries-multiarch/eval/post-test @@ -0,0 +1,2 @@ +s/i386-linux-gnu/x86_64-linux-gnu/ +s/is for i386/is for amd64/ |