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/libraries | |
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/libraries')
358 files changed, 4058 insertions, 0 deletions
diff --git a/t/recipes/checks/libraries/debug-symbols/binaries-general/build-spec/debian/rules b/t/recipes/checks/libraries/debug-symbols/binaries-general/build-spec/debian/rules new file mode 100644 index 0000000..3ea7a63 --- /dev/null +++ b/t/recipes/checks/libraries/debug-symbols/binaries-general/build-spec/debian/rules @@ -0,0 +1,12 @@ +#!/usr/bin/make -f + +export DEB_BUILD_MAINT_OPTIONS=hardening=+all + +%: + dh $@ + +override_dh_strip: + dh_strip -X usr/lib/debug -X unstripped -X ocaml + +override_dh_dwz: + # Can error with "deadbeefdeadbeef.debug: Found compressed .debug_info section, not attempting dwz compression" diff --git a/t/recipes/checks/libraries/debug-symbols/binaries-general/build-spec/fill-values b/t/recipes/checks/libraries/debug-symbols/binaries-general/build-spec/fill-values new file mode 100644 index 0000000..a24247d --- /dev/null +++ b/t/recipes/checks/libraries/debug-symbols/binaries-general/build-spec/fill-values @@ -0,0 +1,4 @@ +Skeleton: upload-native +Testname: binaries-general +Description: Misc errors related to binaries +Package-Architecture: any diff --git a/t/recipes/checks/libraries/debug-symbols/binaries-general/build-spec/orig/Makefile b/t/recipes/checks/libraries/debug-symbols/binaries-general/build-spec/orig/Makefile new file mode 100644 index 0000000..cf0f211 --- /dev/null +++ b/t/recipes/checks/libraries/debug-symbols/binaries-general/build-spec/orig/Makefile @@ -0,0 +1,64 @@ +# 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 + +NOPIE_CFLAGS = $(filter-out -fPIE,$(CFLAGS)) +NOPIE_LDFLAGS = $(filter-out -fPIE -pie,$(LDFLAGS)) +COMPILE:= $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) +COMPILE_NOPIE:= $(CC) $(NOPIE_CFLAGS) $(CPPFLAGS) $(NOPIE_LDFLAGS) +# extract from readelf +GETBUILDID:=./getbuildid + +all: + # rpath not matching any of the exceptions to the rpath checks + # - with profiling enabled. + $(COMPILE_NOPIE) -o basic basic.c -pg -Wl,--rpath,/usr/local/lib + # rpath shipped in the package, but one of {/usr}?/lib + $(COMPILE) -o basiclibrpath basic.c -Wl,--rpath,/usr/lib + # non-special rpath shipped in the package + $(COMPILE) -o basicshippedrpath basic.c -Wl,--rpath,/usr/share/foo + # special rpath shipped in the package, multiple paths + $(COMPILE) -o basicshippedrpathmore basic.c -Wl,--rpath,/usr/lib/binaries-general:/usr/lib/binaries-general/bar + # static version of basic for debugging checks + $(COMPILE_NOPIE) -static -o basic.static basic.c + # static executable to trigger ocaml check + $(COMPILE_NOPIE) -o ocaml-exec ocaml.c + # version with debug + $(COMPILE) -o basicdebug -g3 -Wl,--build-id basic.c + +install: + # according to local debian rules /usr/lib/debug is unstripped + install -d $(DESTDIR)/usr/share/foo/ + install -d $(DESTDIR)/usr/lib/debug/usr/share/foo/ + install -d $(DESTDIR)/usr/lib/foo/ + install -d $(DESTDIR)/usr/bin + + install -m 755 -c basic $(DESTDIR)/usr/share/foo/basic + objcopy --only-keep-debug basic $(DESTDIR)/usr/lib/debug/usr/share/foo/basic + strip -s $(DESTDIR)/usr/lib/debug/usr/share/foo/basic + install -m 755 -c basiclibrpath $(DESTDIR)/usr/lib/foo/basiclibrpath + install -m 755 -c basicshippedrpath $(DESTDIR)/usr/lib/foo/basicshippedrpath + install -m 755 -c ocaml-exec $(DESTDIR)/usr/lib/foo/ocaml-exec + install -m 744 -c basicshippedrpathmore $(DESTDIR)/usr/lib/foo/basicshippedrpathmore + objcopy --only-keep-debug basic $(DESTDIR)/usr/lib/debug/basic + install -d "$(DESTDIR)/usr/lib/debug/.build-id/"`$(GETBUILDID) -s basicdebug` + install -m 755 -c basicdebug $(DESTDIR)/usr/share/foo/basicdebug + # force fake buildid in order to have tag matching ok (deadbeefdeadbeef) + install -d "$(DESTDIR)/usr/lib/debug/.build-id/de" + objcopy --compress-debug-sections basicdebug \ + "$(DESTDIR)/usr/lib/debug/.build-id/de/deadbeefdeadbeef.debug" + install -d "$(DESTDIR)/usr/lib/debug/.build-id/"`$(GETBUILDID) -s basicdebug` + objcopy --compress-debug-sections --only-keep-debug basicdebug \ + "$(DESTDIR)/usr/lib/debug/.build-id/"`$(GETBUILDID) -s basicdebug`"/"`$(GETBUILDID) -f basicdebug`.debug + install -m 755 -c basic.static $(DESTDIR)/usr/lib/debug/ + # according to local debian rules unstripped in name avoid dh_strip to do the work + install -m 755 basicdebug $(DESTDIR)/usr/bin/unstripped + install -m 755 basic.static $(DESTDIR)/usr/bin/static + +clean distclean: + rm -f basic + +check test: diff --git a/t/recipes/checks/libraries/debug-symbols/binaries-general/build-spec/orig/basic.c b/t/recipes/checks/libraries/debug-symbols/binaries-general/build-spec/orig/basic.c new file mode 100644 index 0000000..3618004 --- /dev/null +++ b/t/recipes/checks/libraries/debug-symbols/binaries-general/build-spec/orig/basic.c @@ -0,0 +1,12 @@ +#include <stdio.h> +#include <string.h> + +int +main(int argc, char *argv[]) +{ + char t[10]; + printf("Hello world!\n"); + /* forces a stack protector */ + (void) strcpy(t,argv[0]); + return (int) t[0]; +} diff --git a/t/recipes/checks/libraries/debug-symbols/binaries-general/build-spec/orig/getbuildid b/t/recipes/checks/libraries/debug-symbols/binaries-general/build-spec/orig/getbuildid new file mode 100755 index 0000000..0060d2b --- /dev/null +++ b/t/recipes/checks/libraries/debug-symbols/binaries-general/build-spec/orig/getbuildid @@ -0,0 +1,30 @@ +#!/bin/sh +# get build-id of binary + +set -e + +usage() { + echo "Usage: getbuildid [flag] file"; + echo " print build-id of an object file" + echo "flags:" + echo " -f : full build-id (default)." + echo " -s : short build-id aka the first two characters." +} + +if test $# -lt 1; then usage; exit 77; fi +if test $# -gt 3; then usage; exit 77; fi + +if test $# -eq 1; then + LC_ALL=C readelf -n "$1" | grep -i 'Build Id:' | sed 's/.*:[[:blank:]]*\([[:digit:]|abcdef]*\).*/\1/g' +else + case "x$1" in + 'x-f') + LC_ALL=C readelf -n "$2" | grep -i 'Build Id:' | sed 's/.*:[[:blank:]]*\([[:digit:]|abcdef]*\).*/\1/g' ;; + 'x-s') + LC_ALL=C readelf -n "$2" | grep -i 'Build Id:' | sed 's/.*:[[:blank:]]*\([[:digit:]|abcdef]\{2\}\).*/\1/g' ;; + *) + exit 2; + esac +fi + +exit 0; diff --git a/t/recipes/checks/libraries/debug-symbols/binaries-general/build-spec/orig/ocaml.c b/t/recipes/checks/libraries/debug-symbols/binaries-general/build-spec/orig/ocaml.c new file mode 100644 index 0000000..370d17d --- /dev/null +++ b/t/recipes/checks/libraries/debug-symbols/binaries-general/build-spec/orig/ocaml.c @@ -0,0 +1,11 @@ +#include <stdio.h> + +int +main(int argc, char **argv) +{ + if (argc > 2) { + puts("Caml1999X000"); + } + puts("\n"); + return 0; +} diff --git a/t/recipes/checks/libraries/debug-symbols/binaries-general/eval/desc b/t/recipes/checks/libraries/debug-symbols/binaries-general/eval/desc new file mode 100644 index 0000000..e8419a4 --- /dev/null +++ b/t/recipes/checks/libraries/debug-symbols/binaries-general/eval/desc @@ -0,0 +1,2 @@ +Testname: binaries-general +Check: libraries/debug-symbols diff --git a/t/recipes/checks/libraries/debug-symbols/binaries-general/eval/hints b/t/recipes/checks/libraries/debug-symbols/binaries-general/eval/hints new file mode 100644 index 0000000..0bc6db2 --- /dev/null +++ b/t/recipes/checks/libraries/debug-symbols/binaries-general/eval/hints @@ -0,0 +1 @@ +binaries-general (binary): stripped-library [usr/lib/debug/usr/share/foo/basic] diff --git a/t/recipes/checks/libraries/debug-symbols/binaries-general/eval/post-test b/t/recipes/checks/libraries/debug-symbols/binaries-general/eval/post-test new file mode 100755 index 0000000..11ad2c8 --- /dev/null +++ b/t/recipes/checks/libraries/debug-symbols/binaries-general/eval/post-test @@ -0,0 +1 @@ +/: hardening-.*/ d diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/fill-values b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/fill-values new file mode 100644 index 0000000..ffb07bb --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/fill-values @@ -0,0 +1,4 @@ +Skeleton: upload-native +Testname: binaries-embedded-libs +Package-Architecture: any +Description: Package with binary with library-unique strings diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/Makefile b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/Makefile new file mode 100644 index 0000000..cffe7c4 --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/Makefile @@ -0,0 +1,26 @@ +BINARIES := zlib libpng libjpeg libopenjpeg libtiff libpcre3 libbz2 libxml2 \ + libmagic libexpat libsqlite libm gmp mpfr \ + ieee-data1 ieee-data2 ieee-data3 + +MANPAGES := $(patsubst %,%.1,$(BINARIES)) + +all: $(BINARIES) $(MANPAGES) + +%: %.c + gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $* $*.c + +%.1: template.1 + sed 's/#BIN#/$*/g' < $< > $@ + +install: + install -d $(DESTDIR)/usr/bin + install -d $(DESTDIR)/usr/share/man/man1 + for b in $(BINARIES); do \ + install -m 755 -c $$b $(DESTDIR)/usr/bin/$$b; \ + install -m 644 -c $$b.1 $(DESTDIR)/usr/share/man/man1/$$b.1; \ + done + +clean distclean: + rm -f $(BINARIES) $(MANPAGES) + +check test: diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/gmp.c b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/gmp.c new file mode 100644 index 0000000..1c13690 --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/gmp.c @@ -0,0 +1,15 @@ +#include <stdio.h> +#include "hardening-trigger.h" + +/* + * There's not much you can do with GMP without having the allocation + * code ... + */ +static const char alloc_failure[] + = "GNU MP: Cannot allocate memory"; + +int +main(void) +{ + printf("%s\n", alloc_failure); +} diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/hardening-trigger.h b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/hardening-trigger.h new file mode 100644 index 0000000..0bfe592 --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/hardening-trigger.h @@ -0,0 +1,6 @@ +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/libraries/embedded/binaries-embedded-libs/build-spec/orig/ieee-data1.c b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/ieee-data1.c new file mode 100644 index 0000000..68922cc --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/ieee-data1.c @@ -0,0 +1,10 @@ +#include <stdio.h> + +static const char ieee_data_url[] + = "http://standards.ieee.org/develop/regauth/oui/oui.txt"; + +int +main(void) +{ + printf("%s\n", ieee_data_url); +} diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/ieee-data2.c b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/ieee-data2.c new file mode 100644 index 0000000..37ecf4d --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/ieee-data2.c @@ -0,0 +1,10 @@ +#include <stdio.h> + +static const char ieee_data_url[] + = "http://standards-oui.ieee.org/oui.txt"; + +int +main(void) +{ + printf("%s\n", ieee_data_url); +} diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/ieee-data3.c b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/ieee-data3.c new file mode 100644 index 0000000..615e312 --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/ieee-data3.c @@ -0,0 +1,17 @@ +#include <stdio.h> + +struct ieee_data { + char a1; + char a2; + char a3; + const char * name; +}; + +static const struct ieee_data ieee_data_array[] + = { 0x00, 0x00, 0x56, "DR. B. STRUCK"}; + +int +main(void) +{ + printf("%s\n", ieee_data_array[0].name); +} diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libbz2.c b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libbz2.c new file mode 100644 index 0000000..9fc9d92 --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libbz2.c @@ -0,0 +1,11 @@ +#include <stdio.h> +#include "hardening-trigger.h" + +static const char bzip2_bug[] + = "This is a bug in bzip2"; + +int +main(void) +{ + printf("%s\n", bzip2_bug); +} diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libexpat.c b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libexpat.c new file mode 100644 index 0000000..1df8c01 --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libexpat.c @@ -0,0 +1,15 @@ +#include <stdio.h> +#include "hardening-trigger.h" + +/* + * The XML_DTD warning string is always present, even if expat was + * built with XML_DTD + */ +static const char xml_dtd[] + = "requested feature requires XML_DTD support in Expat"; + +int +main(void) +{ + printf("%s\n", xml_dtd); +} diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libjpeg.c b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libjpeg.c new file mode 100644 index 0000000..6f76a7d --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libjpeg.c @@ -0,0 +1,15 @@ +#include <stdio.h> +#include "hardening-trigger.h" + +/* + * The quantization tables warning message is unique enough to be used to + * detect embedded or statically-linked copies of libjpeg. + */ +static const char quantization_tables_warning[] + = "Caution: quantization tables are too coarse for baseline JPEG"; + +int +main(void) +{ + printf("%s\n", quantization_tables_warning); +} diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libm.c b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libm.c new file mode 100644 index 0000000..b69548d --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libm.c @@ -0,0 +1,11 @@ +#include <stdio.h> +#include "hardening-trigger.h" + +static const char domain_error[] + = "neg**non-integral: DOMAIN error"; + +int +main(void) +{ + printf("%s\n", domain_error); +} diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libmagic.c b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libmagic.c new file mode 100644 index 0000000..d8a7d4c --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libmagic.c @@ -0,0 +1,11 @@ +#include <stdio.h> +#include "hardening-trigger.h" + +static const char no_magic_files[] + = "could not find any magic files!"; + +int +main(void) +{ + printf("%s\n", no_magic_files); +} diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libopenjpeg.c b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libopenjpeg.c new file mode 100644 index 0000000..b232b21 --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libopenjpeg.c @@ -0,0 +1,15 @@ +#include <stdio.h> +#include "hardening-trigger.h" + +/* + * The tcd_decode error message appears to be unique enough to be used to + * detect embedded or statically-linked copies of libopenjpeg. + */ +static const char tcd_error[] + = "tcd_decode: incomplete bistream"; + +int +main(void) +{ + printf("%s\n", tcd_error); +} diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libpcre3.c b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libpcre3.c new file mode 100644 index 0000000..5eca82e --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libpcre3.c @@ -0,0 +1,15 @@ +#include <stdio.h> +#include "hardening-trigger.h" + +/* + * The PCRE_UTF8 message is unique enough to be used to + * detect embedded or statically-linked copies of pcre. + */ +static const char pcre_utf8[] + = "this version of PCRE is not compiled with PCRE_UTF8 support"; + +int +main(void) +{ + printf("%s\n", pcre_utf8); +} diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libpng.c b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libpng.c new file mode 100644 index 0000000..3de5e57 --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libpng.c @@ -0,0 +1,15 @@ +#include <stdio.h> +#include "hardening-trigger.h" + +/* + * The png_zalloc overflow error message is unique enough to be used to + * detect embedded or statically-linked copies of libpng. + */ +static const char zalloc_error[] + = "Potential overflow in png_zalloc()"; + +int +main(void) +{ + printf("%s\n", zalloc_error); +} diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libsqlite.c b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libsqlite.c new file mode 100644 index 0000000..9bc97d0 --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libsqlite.c @@ -0,0 +1,14 @@ +#include <stdio.h> +#include "hardening-trigger.h" + +/* + * the sqlite_master table is used by sqlite 2 and 3 + */ +static const char sqlite_create[] + = "CREATE TABLE sqlite_master( foo bar moo)"; + +int +main(void) +{ + printf("%s\n", sqlite_create); +} diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libtiff.c b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libtiff.c new file mode 100644 index 0000000..ec36402 --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libtiff.c @@ -0,0 +1,15 @@ +#include <stdio.h> +#include "hardening-trigger.h" + +/* + * The PixarLog error message is unique enough to be used to + * detect embedded or statically-linked copies of libtiff. + */ +static const char pixarlog_error[] + = "No space for PixarLog state block"; + +int +main(void) +{ + printf("%s\n", pixarlog_error); +} diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libxml2.c b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libxml2.c new file mode 100644 index 0000000..5c151d2 --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/libxml2.c @@ -0,0 +1,11 @@ +#include <stdio.h> +#include "hardening-trigger.h" + +static const char root_dtd_mismatch[] + = "root and DTD name do not match '%s' and '%s'"; + +int +main(void) +{ + printf("%s\n", root_dtd_mismatch); +} diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/mpfr.c b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/mpfr.c new file mode 100644 index 0000000..a23b9dc --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/mpfr.c @@ -0,0 +1,15 @@ +#include <stdio.h> +#include "hardening-trigger.h" + +/* + * There's not much you can do with MPFR without having the allocation + * code ... + */ +static const char alloc_failure[] + = "MPFR: Can't allocate memory"; + +int +main(void) +{ + printf("%s\n", alloc_failure); +} diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/template.1 b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/template.1 new file mode 100644 index 0000000..e193a57 --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/template.1 @@ -0,0 +1,24 @@ +.\" Copyright (C) 2010 Raphael Geissert <atomo64@gmail.com> +.\" +.\" This is free software; you may redistribute it and/or modify +.\" it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2, +.\" or (at your option) any later version. +.\" +.\" 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. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with the Debian GNU/Linux system; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +.\" 02111-1307 USA +.TH #BIN# "1" +.SH NAME +#BIN# \- dummy binary simulating embedding the #BIN# library +.SH SYNOPSIS +#BIN# +.SH DESCRIPTION +.B #BIN# +is a dummy binary used internally by lintian as a part of its testsuite. diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/zlib.c b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/zlib.c new file mode 100644 index 0000000..eb43c79 --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/build-spec/orig/zlib.c @@ -0,0 +1,15 @@ +#include <stdio.h> +#include "hardening-trigger.h" + +/* + * zlib asks derivative works to include this string, so it's the signature + * that we use to detect embedded copies. + */ +static const char deflate_copyright[] + = "deflate 1.2.3.3 Copyright 1995-2006 Jean-loup Gailly"; + +int +main(void) +{ + printf("%s\n", deflate_copyright); +} diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/eval/desc b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/eval/desc new file mode 100644 index 0000000..fd20867 --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/eval/desc @@ -0,0 +1,2 @@ +Testname: binaries-embedded-libs +Check: libraries/embedded diff --git a/t/recipes/checks/libraries/embedded/binaries-embedded-libs/eval/hints b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/eval/hints new file mode 100644 index 0000000..542340d --- /dev/null +++ b/t/recipes/checks/libraries/embedded/binaries-embedded-libs/eval/hints @@ -0,0 +1,17 @@ +binaries-embedded-libs (binary): embedded-library zlib [usr/bin/zlib] +binaries-embedded-libs (binary): embedded-library tiff [usr/bin/libtiff] +binaries-embedded-libs (binary): embedded-library sqlite [usr/bin/libsqlite] +binaries-embedded-libs (binary): embedded-library pcre3 [usr/bin/libpcre3] +binaries-embedded-libs (binary): embedded-library openjpeg [usr/bin/libopenjpeg] +binaries-embedded-libs (binary): embedded-library mpfr [usr/bin/mpfr] +binaries-embedded-libs (binary): embedded-library libxml2 [usr/bin/libxml2] +binaries-embedded-libs (binary): embedded-library libpng [usr/bin/libpng] +binaries-embedded-libs (binary): embedded-library libm [usr/bin/libm] +binaries-embedded-libs (binary): embedded-library libjpeg [usr/bin/libjpeg] +binaries-embedded-libs (binary): embedded-library ieee-data [usr/bin/ieee-data3] +binaries-embedded-libs (binary): embedded-library ieee-data [usr/bin/ieee-data2] +binaries-embedded-libs (binary): embedded-library ieee-data [usr/bin/ieee-data1] +binaries-embedded-libs (binary): embedded-library gmp [usr/bin/gmp] +binaries-embedded-libs (binary): embedded-library file [usr/bin/libmagic] +binaries-embedded-libs (binary): embedded-library expat [usr/bin/libexpat] +binaries-embedded-libs (binary): embedded-library bzip2 [usr/bin/libbz2] diff --git a/t/recipes/checks/libraries/shared/exit/shared-libs-exit-fork/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/exit/shared-libs-exit-fork/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/exit/shared-libs-exit-fork/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/exit/shared-libs-exit-fork/build-spec/debian/control.in b/t/recipes/checks/libraries/shared/exit/shared-libs-exit-fork/build-spec/debian/control.in new file mode 100644 index 0000000..86a2064 --- /dev/null +++ b/t/recipes/checks/libraries/shared/exit/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/libraries/shared/exit/shared-libs-exit-fork/build-spec/debian/libexecbit1.symbols b/t/recipes/checks/libraries/shared/exit/shared-libs-exit-fork/build-spec/debian/libexecbit1.symbols new file mode 100644 index 0000000..0b26833 --- /dev/null +++ b/t/recipes/checks/libraries/shared/exit/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/libraries/shared/exit/shared-libs-exit-fork/build-spec/fill-values b/t/recipes/checks/libraries/shared/exit/shared-libs-exit-fork/build-spec/fill-values new file mode 100644 index 0000000..8c30582 --- /dev/null +++ b/t/recipes/checks/libraries/shared/exit/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/libraries/shared/exit/shared-libs-exit-fork/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/exit/shared-libs-exit-fork/build-spec/orig/Makefile new file mode 100644 index 0000000..68d5863 --- /dev/null +++ b/t/recipes/checks/libraries/shared/exit/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/libraries/shared/exit/shared-libs-exit-fork/build-spec/orig/code.c b/t/recipes/checks/libraries/shared/exit/shared-libs-exit-fork/build-spec/orig/code.c new file mode 100644 index 0000000..df63394 --- /dev/null +++ b/t/recipes/checks/libraries/shared/exit/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/libraries/shared/exit/shared-libs-exit-fork/eval/desc b/t/recipes/checks/libraries/shared/exit/shared-libs-exit-fork/eval/desc new file mode 100644 index 0000000..f983298 --- /dev/null +++ b/t/recipes/checks/libraries/shared/exit/shared-libs-exit-fork/eval/desc @@ -0,0 +1,4 @@ +Testname: shared-libs-exit-fork +Test-Against: + exit-in-shared-library +Check: libraries/shared/exit diff --git a/t/recipes/checks/libraries/shared/exit/shared-libs-exit-fork/eval/hints b/t/recipes/checks/libraries/shared/exit/shared-libs-exit-fork/eval/hints new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/t/recipes/checks/libraries/shared/exit/shared-libs-exit-fork/eval/hints @@ -0,0 +1 @@ + diff --git a/t/recipes/checks/libraries/shared/exit/shared-libs-exit/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/exit/shared-libs-exit/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/exit/shared-libs-exit/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/exit/shared-libs-exit/build-spec/debian/control.in b/t/recipes/checks/libraries/shared/exit/shared-libs-exit/build-spec/debian/control.in new file mode 100644 index 0000000..86a2064 --- /dev/null +++ b/t/recipes/checks/libraries/shared/exit/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/libraries/shared/exit/shared-libs-exit/build-spec/debian/libexecbit1.symbols b/t/recipes/checks/libraries/shared/exit/shared-libs-exit/build-spec/debian/libexecbit1.symbols new file mode 100644 index 0000000..0b26833 --- /dev/null +++ b/t/recipes/checks/libraries/shared/exit/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/libraries/shared/exit/shared-libs-exit/build-spec/fill-values b/t/recipes/checks/libraries/shared/exit/shared-libs-exit/build-spec/fill-values new file mode 100644 index 0000000..99c4585 --- /dev/null +++ b/t/recipes/checks/libraries/shared/exit/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/libraries/shared/exit/shared-libs-exit/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/exit/shared-libs-exit/build-spec/orig/Makefile new file mode 100644 index 0000000..68d5863 --- /dev/null +++ b/t/recipes/checks/libraries/shared/exit/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/libraries/shared/exit/shared-libs-exit/build-spec/orig/code.c b/t/recipes/checks/libraries/shared/exit/shared-libs-exit/build-spec/orig/code.c new file mode 100644 index 0000000..297a4e8 --- /dev/null +++ b/t/recipes/checks/libraries/shared/exit/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/libraries/shared/exit/shared-libs-exit/eval/desc b/t/recipes/checks/libraries/shared/exit/shared-libs-exit/eval/desc new file mode 100644 index 0000000..58e693f --- /dev/null +++ b/t/recipes/checks/libraries/shared/exit/shared-libs-exit/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-exit +Check: libraries/shared/exit diff --git a/t/recipes/checks/libraries/shared/exit/shared-libs-exit/eval/hints b/t/recipes/checks/libraries/shared/exit/shared-libs-exit/eval/hints new file mode 100644 index 0000000..ac335c0 --- /dev/null +++ b/t/recipes/checks/libraries/shared/exit/shared-libs-exit/eval/hints @@ -0,0 +1 @@ +libexecbit1 (binary): exit-in-shared-library [usr/lib/libexecbit.so.1.0.1] diff --git a/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/changelog.in b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/changelog.in new file mode 100644 index 0000000..91a6bb5 --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/changelog.in @@ -0,0 +1,6 @@ +libbaz ([% $version %]) [% $distribution %]; urgency=low + + * Initial setup + + -- Sean 'Shaleh' Perry <shaleh@debian.org> Tue, 30 Jan 2001 15:23:59 -0800 + diff --git a/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/control b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/control new file mode 100644 index 0000000..1506687 --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/control @@ -0,0 +1,58 @@ +Source: libbaz +Section: libs +Priority: optional +Maintainer: Lintian Maintainer <lintian-maint@debian.org> +Build-depends: debhelper (>=4) +Standards-Version: 3.2.1 + +Package: libbaz1 +Architecture: any +Provides: libbaz +Description: test handling of library packages + Regression test for lintian's handling of libraries. + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz1-dev +Architecture: any +Depends: libbaz1 (= ${source:Version}), perlapi-5.8.8 +Description: development package + Regression test for lintian's handling of libraries (dev). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz2 +Architecture: any +Depends: ${shlibs:Depends}, libssl0.9.8 +Description: test handling of library packages (good) + Regression test for lintian's handling of libraries (good). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz2-dev +Architecture: any +Depends: ${shlibs:Depends}, libbaz2 (= ${source:Version}) +Description: development package (good) + Regression test for lintian's handling of libraries (dev good). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz2-dbg +Architecture: any +Depends: libbaz2 (= ${binary:Version}) +Priority: optional +Description: debugging package + Regression test for lintian's handling of libraries (debug). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + diff --git a/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/copyright b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/copyright new file mode 100644 index 0000000..a874c87 --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/copyright @@ -0,0 +1,8 @@ +This package is released under public domain. This is distributed in the hope +that it will be useful, but without any warranty; without even the implied +warranty of merchantability or fitness for a particular purpose. + +A reference to /usr/share/common-licenses/GPL-2 to make it look like this +package is under the GPL and trigger the OpenSSL warning. + +However, this has an OpenSSL exception. diff --git a/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/dev.postinst b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/dev.postinst new file mode 100644 index 0000000..683e3cc --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/dev.postinst @@ -0,0 +1,4 @@ +#!/bin/sh -e + +$PKG=libbaz1-dev + diff --git a/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/dev.prerm b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/dev.prerm new file mode 100644 index 0000000..683e3cc --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/dev.prerm @@ -0,0 +1,4 @@ +#!/bin/sh -e + +$PKG=libbaz1-dev + diff --git a/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/lib.postinst b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/lib.postinst new file mode 100644 index 0000000..ec0b98a --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/lib.postinst @@ -0,0 +1,10 @@ +#!/bin/sh -e + +$PKG=libbaz1 + +if [ "$1" = "configure" ]; then + if [ -d /usr/doc -a ! -e /usr/doc/$PKG -a -d /usr/share/doc/$PKG ] +; then + ln -sf ../share/doc/$PKG /usr/doc/$PKG + fi +fi diff --git a/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/lib.prerm b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/lib.prerm new file mode 100644 index 0000000..50e37c3 --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/lib.prerm @@ -0,0 +1,7 @@ +#!/bin/sh -e + +$PKG=libbaz1 + +if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/$PKG ]; then + rm -f /usr/doc/$PKG +fi diff --git a/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/lib.shlibs b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/lib.shlibs new file mode 100644 index 0000000..b88e288 --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/lib.shlibs @@ -0,0 +1,8 @@ +libdoesntexist2 1.0 libbaz1 +libdoesntexist2 1.0 libbaz1 +libbaz2 1.1 libbaz +libbaz3 1 libbaz1 (>> 1-1) +libbaz4 1 libbaz1 (= 1-1) +libbaz5 1 libbaz2 +udeb: libdoesntexist2 1.0 libbaz2 +udeb: libdoesntexist2 1.0 libbaz2 diff --git a/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/lib.symbols b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/lib.symbols new file mode 100644 index 0000000..72f9d8a --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/lib.symbols @@ -0,0 +1,3 @@ +libbaz.so.2 libbaz1 #MINVER# + pw 1-1 + foo 1.1-1 diff --git a/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/rules b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/rules new file mode 100755 index 0000000..fa99bc8 --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/rules @@ -0,0 +1,121 @@ +#!/usr/bin/make -f + +lib_tmp=debian/tmp-lib +dev_tmp=debian/tmp-dev + +LIB=libbaz1 +DEV=libbaz1-dev + +VENDORARCH := $(shell perl -MConfig -wE'say substr($$Config{vendorarch},1)') + +build-arch: + $(MAKE) + +build-indep: + +build: build-arch build-indep + +clean: + $(MAKE) clean + dh_clean -plibbaz2 -plibbaz2-dev + rm -f debian/files debian/substvars + rm -rf $(lib_tmp) $(dev_tmp) + +# Now the correct libbaz2-dev package +binary-correct: + install -d debian/libbaz2-dev/usr/lib + cp -a libbaz2.a libbaz2.so debian/libbaz2-dev/usr/lib + # usually, I'd also include some .h files to /usr/include + + # Now the correct libbaz2 package + install -d debian/libbaz2/usr/lib + cp -a libbaz2.so.* debian/libbaz2/usr/lib + chmod a-x debian/libbaz2/usr/lib/* + + # General stuff that is tested in other testsets: + dh_installdocs -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + dh_compress -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + + # Mess up the libbaz2 changelog files to test the symlink handling. + ln -s /usr/share/doc/lintian/changelog.gz \ + debian/libbaz2/usr/share/doc/libbaz2/changelog.gz + install -m 644 debian/changelog \ + debian/libbaz2-dev/usr/share/doc/libbaz2-dev/foo + ln -s foo debian/libbaz2-dev/usr/share/doc/libbaz2-dev/changelog + + # Okay, if either line is omitted, it should be noted + dh_strip --dbg-package=libbaz2-dbg -plibbaz2 -plibbaz2-dev + dh_makeshlibs -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + dh_shlibdeps -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + + # and again, regular packaging stuff + dh_installdeb -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + echo udeb: libbaz2 1.0 libbaz2 >> debian/libbaz2/DEBIAN/shlibs + dh_gencontrol -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + dh_builddeb -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + +# and the incorrect one +binary-arch: build-arch binary-correct + # first, the lib package + install -d $(lib_tmp)/usr/lib + # resp. no soname (check), wrong soname (check), and no-pic (check) + cp -a libbaz1.so.1.0* $(lib_tmp)/usr/lib + cp -a libbaz2.so.1.0.3b $(lib_tmp)/usr/lib/libfoo2.so.1.0.3b + install -m644 libbaz3.so.1.0.3b $(lib_tmp)/usr/lib/libbaz3.so.1.0.3b + # let's include the .a in the non-dev too (TODO) + # Also, libbaz1.a hasn't a symbol table (TODO) + cp -a *.a $(lib_tmp)/usr/lib + # And a wrong .so symlink (wrong, only in -dev, TODO) + ln -s libfoo3.so.0.9 $(lib_tmp)/usr/lib/libfoo3.so + # And a wrong .so.X symlink (wrong, should point to a real existing + # shlib, TODO) + ln -s libfoo.so.0.9.1 $(lib_tmp)/usr/lib/libfoo.so.0.9 + # And a plain .so (wrong, TODO) + touch $(lib_tmp)/usr/lib/libbar2.so + # And a non-versioned SONAME. + install -m644 libbaz.so $(lib_tmp)/usr/lib/libbaz.so + strip --remove-section=.comment --strip-unneeded $(lib_tmp)/usr/lib/libbaz.so + # Pretend to be a Perl module to test a lack of Perl dependencies. + install -d $(lib_tmp)/$(VENDORARCH)/auto/Foo + install -m 644 libbaz2.so.1.0.3b $(lib_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + strip $(lib_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + + install -d $(lib_tmp)/usr/share/doc/$(LIB) + install -m 644 debian/copyright $(lib_tmp)/usr/share/doc/$(LIB) + install -m 644 debian/changelog $(lib_tmp)/usr/share/doc/$(LIB) + gzip -n -9 $(lib_tmp)/usr/share/doc/$(LIB)/changelog + install -d $(lib_tmp)/DEBIAN + install -m 755 debian/lib.postinst $(lib_tmp)/DEBIAN/postinst + install -m 755 debian/lib.prerm $(lib_tmp)/DEBIAN/prerm + touch $(lib_tmp)/usr/share/doc/README.Debian + #dpkg-shlibdeps $(lib_tmp)/usr/lib/libbaz.so.1.0 + install -m 755 debian/lib.shlibs $(lib_tmp)/DEBIAN/shlibs + install -m 755 debian/lib.symbols $(lib_tmp)/DEBIAN/symbols + dpkg-gencontrol -isp -p$(LIB) -P$(lib_tmp) + dpkg --build $(lib_tmp) .. + + # now the -dev package + install -d $(dev_tmp)/usr/include + install -d $(lib_tmp)/usr/lib + # let's also install the .so at the same time... (wrong, TODO) + cp -a *.a *.so.* $(lib_tmp)/usr/lib + # and fuck up permission (TODO) + chmod a+x $(lib_tmp)/usr/lib/*.a + # Pretend to be a Perl module to test a lack of Perl dependencies. + install -d $(dev_tmp)/$(VENDORARCH)/auto/Foo + install -m 644 libbaz2.so.1.0.3b $(dev_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + strip $(dev_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + install -d $(dev_tmp)/usr/share/doc + ln -s $(LIB) $(dev_tmp)/usr/share/doc/$(DEV) + install -d $(dev_tmp)/DEBIAN + install -m 755 debian/dev.postinst $(dev_tmp)/DEBIAN/postinst + install -m 755 debian/dev.prerm $(dev_tmp)/DEBIAN/prerm + dpkg-gencontrol -isp -p$(DEV) -P$(dev_tmp) + dpkg --build $(dev_tmp) .. + + +binary: binary-arch + +# The mention of binary-indep here should be sufficient to suppress the +# warning that it's not present. +.PHONY: build-arch build-indep build binary-arch binary-indep binary clean diff --git a/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/source.lintian-overrides b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/source.lintian-overrides new file mode 100644 index 0000000..6008d27 --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/debian/source.lintian-overrides @@ -0,0 +1 @@ +libbaz source: maintainer-script-lacks-debhelper-token diff --git a/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/fill-values b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/fill-values new file mode 100644 index 0000000..7effe4f --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/fill-values @@ -0,0 +1,6 @@ +Skeleton: upload-non-native +Testname: legacy-libbaz +Source: libbaz +Version: 1-1 +Default-Build-Depends: debhelper (>= 9.20151004~) +Description: Legacy test "libbaz" diff --git a/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/orig/Makefile new file mode 100644 index 0000000..657dc2a --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/orig/Makefile @@ -0,0 +1,55 @@ +# This is the correct way to build a lib + +CC=gcc +CFLAGS=-g -Wall -Winline -O2 +LDFLAGS=-Wl,--no-as-needed + +OBJS=baz.o extra.o +SHOBJS=baz.sho extra.sho +NOPICOBJS = $(SHOBJS) + +all: libbaz1.a libbaz2.a libbaz1.so.1.0.3b libbaz2.so libbaz3.so.1.0.3b \ + libbaz.so + +libbaz2.so: libbaz2.so.1.0 + ln -sf $^ $@ +libbaz2.so.1.0: libbaz2.so.1.0.3b + ln -sf $^ $@ + +# Oops, forget the soname altogether +libbaz1.so.1.0.3b: $(NOPICOBJS) + $(CC) $(LDFLAGS) -o $@ -shared $^ -lc + +libbaz2.so.1.0.3b: $(SHOBJS) + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libbaz2.so.1.0 $^ -lc + +# Non-PIC. We can't test this on all architectures +libbaz3.so.1.0.3b: $(NOPICOBJS) + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libbaz3.so.1 $^ -lc + +# Non-versioned SONAME. +libbaz.so: $(SHOBJS) + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libbaz.so $^ -lc + +#%.o-noreentrant: %.c +# $(CC) $(LDFLAGS) $(CFLAGS) -o $@ -c $< + +%.sho: %.c + $(CC) $(LDFLAGS) $(CFLAGS) -D_REENTRANT -fPIC -o $@ -c $< + +%.o: %.c + $(CC) $(LDFLAGS) $(CFLAGS) -D_REENTRANT -o $@ -c $< + +libbaz2.a: $(OBJS) + ar cq $@ $(OBJS) + strip --strip-unneeded --remove-section=.comment \ + --remove-section=-note $@ + ranlib $@ + +# The pic one in the .a (wrong), no archive table +libbaz1.a: $(SHOBJS) + ar cqS $@ $^ + strip --strip-unneeded --remove-section=.comment \ + --remove-section=-note $@ +clean: + rm -f *.a *.o *.so* *.sho diff --git a/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/orig/baz.c b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/orig/baz.c new file mode 100644 index 0000000..4d5fc45 --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/orig/baz.c @@ -0,0 +1,6 @@ +#include <math.h> + +double pw(double p) +{ + return exp(p); +} diff --git a/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/orig/extra.c b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/orig/extra.c new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/build-spec/orig/extra.c diff --git a/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/eval/desc b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/eval/desc new file mode 100644 index 0000000..df5e0bd --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/eval/desc @@ -0,0 +1,2 @@ +Testname: legacy-libbaz +Check: libraries/shared/file-permissions diff --git a/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/eval/hints b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/eval/hints new file mode 100644 index 0000000..a789499 --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/eval/hints @@ -0,0 +1 @@ +libbaz1 (binary): shared-library-is-executable 0755 [usr/lib/libfoo2.so.1.0.3b] diff --git a/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/eval/post-test b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/eval/post-test new file mode 100755 index 0000000..29dc3f4 --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/legacy-libbaz/eval/post-test @@ -0,0 +1,4 @@ +/: hardening-.*/ d +s/\(current is ([0-9]+\.)+[0-9]\)/(current is CURRENT)/ +s,usr/lib/([^\/]*/)?perl[0-9]*(/[0-9]*\.[0-9]*)?/,usr/lib/ma-dir/perl/version/,g +/: file-references-package-build-path / d diff --git a/t/recipes/checks/libraries/shared/file-permissions/shared-libs-exec-bit/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/file-permissions/shared-libs-exec-bit/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/shared-libs-exec-bit/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/file-permissions/shared-libs-exec-bit/build-spec/debian/control.in b/t/recipes/checks/libraries/shared/file-permissions/shared-libs-exec-bit/build-spec/debian/control.in new file mode 100644 index 0000000..86a2064 --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/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/libraries/shared/file-permissions/shared-libs-exec-bit/build-spec/debian/libexecbit1.symbols b/t/recipes/checks/libraries/shared/file-permissions/shared-libs-exec-bit/build-spec/debian/libexecbit1.symbols new file mode 100644 index 0000000..d8226ca --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/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/libraries/shared/file-permissions/shared-libs-exec-bit/build-spec/debian/rules b/t/recipes/checks/libraries/shared/file-permissions/shared-libs-exec-bit/build-spec/debian/rules new file mode 100644 index 0000000..9082f3f --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/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/libraries/shared/file-permissions/shared-libs-exec-bit/build-spec/fill-values b/t/recipes/checks/libraries/shared/file-permissions/shared-libs-exec-bit/build-spec/fill-values new file mode 100644 index 0000000..0f19b1b --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/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/libraries/shared/file-permissions/shared-libs-exec-bit/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/file-permissions/shared-libs-exec-bit/build-spec/orig/Makefile new file mode 100644 index 0000000..0997289 --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/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/libraries/shared/file-permissions/shared-libs-exec-bit/build-spec/orig/code.c b/t/recipes/checks/libraries/shared/file-permissions/shared-libs-exec-bit/build-spec/orig/code.c new file mode 100644 index 0000000..0ed08e0 --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/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/libraries/shared/file-permissions/shared-libs-exec-bit/eval/desc b/t/recipes/checks/libraries/shared/file-permissions/shared-libs-exec-bit/eval/desc new file mode 100644 index 0000000..3243044 --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/shared-libs-exec-bit/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-exec-bit +Check: libraries/shared/file-permissions diff --git a/t/recipes/checks/libraries/shared/file-permissions/shared-libs-exec-bit/eval/hints b/t/recipes/checks/libraries/shared/file-permissions/shared-libs-exec-bit/eval/hints new file mode 100644 index 0000000..5e5d17a --- /dev/null +++ b/t/recipes/checks/libraries/shared/file-permissions/shared-libs-exec-bit/eval/hints @@ -0,0 +1,2 @@ +libexecbit1 (binary): shared-library-is-executable 0755 [usr/lib/libexecbit.so.1.0.1] +libexecbit1 (binary): odd-permissions-on-shared-library 0600 [usr/lib/libbadperm.so.1.0.1] diff --git a/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/changelog.in b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/changelog.in new file mode 100644 index 0000000..91a6bb5 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/changelog.in @@ -0,0 +1,6 @@ +libbaz ([% $version %]) [% $distribution %]; urgency=low + + * Initial setup + + -- Sean 'Shaleh' Perry <shaleh@debian.org> Tue, 30 Jan 2001 15:23:59 -0800 + diff --git a/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/control b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/control new file mode 100644 index 0000000..1506687 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/control @@ -0,0 +1,58 @@ +Source: libbaz +Section: libs +Priority: optional +Maintainer: Lintian Maintainer <lintian-maint@debian.org> +Build-depends: debhelper (>=4) +Standards-Version: 3.2.1 + +Package: libbaz1 +Architecture: any +Provides: libbaz +Description: test handling of library packages + Regression test for lintian's handling of libraries. + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz1-dev +Architecture: any +Depends: libbaz1 (= ${source:Version}), perlapi-5.8.8 +Description: development package + Regression test for lintian's handling of libraries (dev). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz2 +Architecture: any +Depends: ${shlibs:Depends}, libssl0.9.8 +Description: test handling of library packages (good) + Regression test for lintian's handling of libraries (good). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz2-dev +Architecture: any +Depends: ${shlibs:Depends}, libbaz2 (= ${source:Version}) +Description: development package (good) + Regression test for lintian's handling of libraries (dev good). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz2-dbg +Architecture: any +Depends: libbaz2 (= ${binary:Version}) +Priority: optional +Description: debugging package + Regression test for lintian's handling of libraries (debug). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + diff --git a/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/copyright b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/copyright new file mode 100644 index 0000000..a874c87 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/copyright @@ -0,0 +1,8 @@ +This package is released under public domain. This is distributed in the hope +that it will be useful, but without any warranty; without even the implied +warranty of merchantability or fitness for a particular purpose. + +A reference to /usr/share/common-licenses/GPL-2 to make it look like this +package is under the GPL and trigger the OpenSSL warning. + +However, this has an OpenSSL exception. diff --git a/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/dev.postinst b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/dev.postinst new file mode 100644 index 0000000..683e3cc --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/dev.postinst @@ -0,0 +1,4 @@ +#!/bin/sh -e + +$PKG=libbaz1-dev + diff --git a/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/dev.prerm b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/dev.prerm new file mode 100644 index 0000000..683e3cc --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/dev.prerm @@ -0,0 +1,4 @@ +#!/bin/sh -e + +$PKG=libbaz1-dev + diff --git a/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/lib.postinst b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/lib.postinst new file mode 100644 index 0000000..ec0b98a --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/lib.postinst @@ -0,0 +1,10 @@ +#!/bin/sh -e + +$PKG=libbaz1 + +if [ "$1" = "configure" ]; then + if [ -d /usr/doc -a ! -e /usr/doc/$PKG -a -d /usr/share/doc/$PKG ] +; then + ln -sf ../share/doc/$PKG /usr/doc/$PKG + fi +fi diff --git a/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/lib.prerm b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/lib.prerm new file mode 100644 index 0000000..50e37c3 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/lib.prerm @@ -0,0 +1,7 @@ +#!/bin/sh -e + +$PKG=libbaz1 + +if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/$PKG ]; then + rm -f /usr/doc/$PKG +fi diff --git a/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/lib.shlibs b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/lib.shlibs new file mode 100644 index 0000000..b88e288 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/lib.shlibs @@ -0,0 +1,8 @@ +libdoesntexist2 1.0 libbaz1 +libdoesntexist2 1.0 libbaz1 +libbaz2 1.1 libbaz +libbaz3 1 libbaz1 (>> 1-1) +libbaz4 1 libbaz1 (= 1-1) +libbaz5 1 libbaz2 +udeb: libdoesntexist2 1.0 libbaz2 +udeb: libdoesntexist2 1.0 libbaz2 diff --git a/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/lib.symbols b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/lib.symbols new file mode 100644 index 0000000..72f9d8a --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/lib.symbols @@ -0,0 +1,3 @@ +libbaz.so.2 libbaz1 #MINVER# + pw 1-1 + foo 1.1-1 diff --git a/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/rules b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/rules new file mode 100755 index 0000000..fa99bc8 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/rules @@ -0,0 +1,121 @@ +#!/usr/bin/make -f + +lib_tmp=debian/tmp-lib +dev_tmp=debian/tmp-dev + +LIB=libbaz1 +DEV=libbaz1-dev + +VENDORARCH := $(shell perl -MConfig -wE'say substr($$Config{vendorarch},1)') + +build-arch: + $(MAKE) + +build-indep: + +build: build-arch build-indep + +clean: + $(MAKE) clean + dh_clean -plibbaz2 -plibbaz2-dev + rm -f debian/files debian/substvars + rm -rf $(lib_tmp) $(dev_tmp) + +# Now the correct libbaz2-dev package +binary-correct: + install -d debian/libbaz2-dev/usr/lib + cp -a libbaz2.a libbaz2.so debian/libbaz2-dev/usr/lib + # usually, I'd also include some .h files to /usr/include + + # Now the correct libbaz2 package + install -d debian/libbaz2/usr/lib + cp -a libbaz2.so.* debian/libbaz2/usr/lib + chmod a-x debian/libbaz2/usr/lib/* + + # General stuff that is tested in other testsets: + dh_installdocs -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + dh_compress -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + + # Mess up the libbaz2 changelog files to test the symlink handling. + ln -s /usr/share/doc/lintian/changelog.gz \ + debian/libbaz2/usr/share/doc/libbaz2/changelog.gz + install -m 644 debian/changelog \ + debian/libbaz2-dev/usr/share/doc/libbaz2-dev/foo + ln -s foo debian/libbaz2-dev/usr/share/doc/libbaz2-dev/changelog + + # Okay, if either line is omitted, it should be noted + dh_strip --dbg-package=libbaz2-dbg -plibbaz2 -plibbaz2-dev + dh_makeshlibs -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + dh_shlibdeps -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + + # and again, regular packaging stuff + dh_installdeb -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + echo udeb: libbaz2 1.0 libbaz2 >> debian/libbaz2/DEBIAN/shlibs + dh_gencontrol -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + dh_builddeb -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + +# and the incorrect one +binary-arch: build-arch binary-correct + # first, the lib package + install -d $(lib_tmp)/usr/lib + # resp. no soname (check), wrong soname (check), and no-pic (check) + cp -a libbaz1.so.1.0* $(lib_tmp)/usr/lib + cp -a libbaz2.so.1.0.3b $(lib_tmp)/usr/lib/libfoo2.so.1.0.3b + install -m644 libbaz3.so.1.0.3b $(lib_tmp)/usr/lib/libbaz3.so.1.0.3b + # let's include the .a in the non-dev too (TODO) + # Also, libbaz1.a hasn't a symbol table (TODO) + cp -a *.a $(lib_tmp)/usr/lib + # And a wrong .so symlink (wrong, only in -dev, TODO) + ln -s libfoo3.so.0.9 $(lib_tmp)/usr/lib/libfoo3.so + # And a wrong .so.X symlink (wrong, should point to a real existing + # shlib, TODO) + ln -s libfoo.so.0.9.1 $(lib_tmp)/usr/lib/libfoo.so.0.9 + # And a plain .so (wrong, TODO) + touch $(lib_tmp)/usr/lib/libbar2.so + # And a non-versioned SONAME. + install -m644 libbaz.so $(lib_tmp)/usr/lib/libbaz.so + strip --remove-section=.comment --strip-unneeded $(lib_tmp)/usr/lib/libbaz.so + # Pretend to be a Perl module to test a lack of Perl dependencies. + install -d $(lib_tmp)/$(VENDORARCH)/auto/Foo + install -m 644 libbaz2.so.1.0.3b $(lib_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + strip $(lib_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + + install -d $(lib_tmp)/usr/share/doc/$(LIB) + install -m 644 debian/copyright $(lib_tmp)/usr/share/doc/$(LIB) + install -m 644 debian/changelog $(lib_tmp)/usr/share/doc/$(LIB) + gzip -n -9 $(lib_tmp)/usr/share/doc/$(LIB)/changelog + install -d $(lib_tmp)/DEBIAN + install -m 755 debian/lib.postinst $(lib_tmp)/DEBIAN/postinst + install -m 755 debian/lib.prerm $(lib_tmp)/DEBIAN/prerm + touch $(lib_tmp)/usr/share/doc/README.Debian + #dpkg-shlibdeps $(lib_tmp)/usr/lib/libbaz.so.1.0 + install -m 755 debian/lib.shlibs $(lib_tmp)/DEBIAN/shlibs + install -m 755 debian/lib.symbols $(lib_tmp)/DEBIAN/symbols + dpkg-gencontrol -isp -p$(LIB) -P$(lib_tmp) + dpkg --build $(lib_tmp) .. + + # now the -dev package + install -d $(dev_tmp)/usr/include + install -d $(lib_tmp)/usr/lib + # let's also install the .so at the same time... (wrong, TODO) + cp -a *.a *.so.* $(lib_tmp)/usr/lib + # and fuck up permission (TODO) + chmod a+x $(lib_tmp)/usr/lib/*.a + # Pretend to be a Perl module to test a lack of Perl dependencies. + install -d $(dev_tmp)/$(VENDORARCH)/auto/Foo + install -m 644 libbaz2.so.1.0.3b $(dev_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + strip $(dev_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + install -d $(dev_tmp)/usr/share/doc + ln -s $(LIB) $(dev_tmp)/usr/share/doc/$(DEV) + install -d $(dev_tmp)/DEBIAN + install -m 755 debian/dev.postinst $(dev_tmp)/DEBIAN/postinst + install -m 755 debian/dev.prerm $(dev_tmp)/DEBIAN/prerm + dpkg-gencontrol -isp -p$(DEV) -P$(dev_tmp) + dpkg --build $(dev_tmp) .. + + +binary: binary-arch + +# The mention of binary-indep here should be sufficient to suppress the +# warning that it's not present. +.PHONY: build-arch build-indep build binary-arch binary-indep binary clean diff --git a/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/source.lintian-overrides b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/source.lintian-overrides new file mode 100644 index 0000000..6008d27 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/debian/source.lintian-overrides @@ -0,0 +1 @@ +libbaz source: maintainer-script-lacks-debhelper-token diff --git a/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/fill-values b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/fill-values new file mode 100644 index 0000000..7effe4f --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/fill-values @@ -0,0 +1,6 @@ +Skeleton: upload-non-native +Testname: legacy-libbaz +Source: libbaz +Version: 1-1 +Default-Build-Depends: debhelper (>= 9.20151004~) +Description: Legacy test "libbaz" diff --git a/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/orig/Makefile new file mode 100644 index 0000000..657dc2a --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/orig/Makefile @@ -0,0 +1,55 @@ +# This is the correct way to build a lib + +CC=gcc +CFLAGS=-g -Wall -Winline -O2 +LDFLAGS=-Wl,--no-as-needed + +OBJS=baz.o extra.o +SHOBJS=baz.sho extra.sho +NOPICOBJS = $(SHOBJS) + +all: libbaz1.a libbaz2.a libbaz1.so.1.0.3b libbaz2.so libbaz3.so.1.0.3b \ + libbaz.so + +libbaz2.so: libbaz2.so.1.0 + ln -sf $^ $@ +libbaz2.so.1.0: libbaz2.so.1.0.3b + ln -sf $^ $@ + +# Oops, forget the soname altogether +libbaz1.so.1.0.3b: $(NOPICOBJS) + $(CC) $(LDFLAGS) -o $@ -shared $^ -lc + +libbaz2.so.1.0.3b: $(SHOBJS) + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libbaz2.so.1.0 $^ -lc + +# Non-PIC. We can't test this on all architectures +libbaz3.so.1.0.3b: $(NOPICOBJS) + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libbaz3.so.1 $^ -lc + +# Non-versioned SONAME. +libbaz.so: $(SHOBJS) + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libbaz.so $^ -lc + +#%.o-noreentrant: %.c +# $(CC) $(LDFLAGS) $(CFLAGS) -o $@ -c $< + +%.sho: %.c + $(CC) $(LDFLAGS) $(CFLAGS) -D_REENTRANT -fPIC -o $@ -c $< + +%.o: %.c + $(CC) $(LDFLAGS) $(CFLAGS) -D_REENTRANT -o $@ -c $< + +libbaz2.a: $(OBJS) + ar cq $@ $(OBJS) + strip --strip-unneeded --remove-section=.comment \ + --remove-section=-note $@ + ranlib $@ + +# The pic one in the .a (wrong), no archive table +libbaz1.a: $(SHOBJS) + ar cqS $@ $^ + strip --strip-unneeded --remove-section=.comment \ + --remove-section=-note $@ +clean: + rm -f *.a *.o *.so* *.sho diff --git a/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/orig/baz.c b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/orig/baz.c new file mode 100644 index 0000000..4d5fc45 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/orig/baz.c @@ -0,0 +1,6 @@ +#include <math.h> + +double pw(double p) +{ + return exp(p); +} diff --git a/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/orig/extra.c b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/orig/extra.c new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/legacy-libbaz/build-spec/orig/extra.c diff --git a/t/recipes/checks/libraries/shared/links/legacy-libbaz/eval/desc b/t/recipes/checks/libraries/shared/links/legacy-libbaz/eval/desc new file mode 100644 index 0000000..7a688ab --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/legacy-libbaz/eval/desc @@ -0,0 +1,2 @@ +Testname: legacy-libbaz +Check: libraries/shared/links diff --git a/t/recipes/checks/libraries/shared/links/legacy-libbaz/eval/hints b/t/recipes/checks/libraries/shared/links/legacy-libbaz/eval/hints new file mode 100644 index 0000000..86a3574 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/legacy-libbaz/eval/hints @@ -0,0 +1,5 @@ +libbaz1 (binary): lacks-versioned-link-to-shared-library usr/lib/libbaz3.so.1 [usr/lib/libbaz3.so.1.0.3b] +libbaz1 (binary): lacks-versioned-link-to-shared-library usr/lib/libbaz2.so.1.0 [usr/lib/libfoo2.so.1.0.3b] +libbaz1 (binary): lacks-unversioned-link-to-shared-library example: usr/lib/libbaz3.so [usr/lib/libbaz3.so.1.0.3b] +libbaz1 (binary): lacks-unversioned-link-to-shared-library example: usr/lib/libbaz2.so [usr/lib/libfoo2.so.1.0.3b] +libbaz1 (binary): lacks-unversioned-link-to-shared-library example: usr/lib/libbaz.so [usr/lib/libbaz.so] diff --git a/t/recipes/checks/libraries/shared/links/legacy-libbaz/eval/post-test b/t/recipes/checks/libraries/shared/links/legacy-libbaz/eval/post-test new file mode 100755 index 0000000..29dc3f4 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/legacy-libbaz/eval/post-test @@ -0,0 +1,4 @@ +/: hardening-.*/ d +s/\(current is ([0-9]+\.)+[0-9]\)/(current is CURRENT)/ +s,usr/lib/([^\/]*/)?perl[0-9]*(/[0-9]*\.[0-9]*)?/,usr/lib/ma-dir/perl/version/,g +/: file-references-package-build-path / d diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink-fp/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink-fp/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink-fp/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink-fp/build-spec/debian/control.in b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink-fp/build-spec/debian/control.in new file mode 100644 index 0000000..9ca1147 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-dev-symlink-fp/build-spec/debian/libfoo-1.install b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink-fp/build-spec/debian/libfoo-1.install new file mode 100644 index 0000000..cb060ec --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-dev-symlink-fp/build-spec/debian/libfoo-1.symbols b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink-fp/build-spec/debian/libfoo-1.symbols new file mode 100644 index 0000000..910a1e5 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-dev-symlink-fp/build-spec/debian/libfoo-dev.install b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink-fp/build-spec/debian/libfoo-dev.install new file mode 100644 index 0000000..ed7b146 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-dev-symlink-fp/build-spec/fill-values b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink-fp/build-spec/fill-values new file mode 100644 index 0000000..5240e59 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-dev-symlink-fp/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink-fp/build-spec/orig/Makefile new file mode 100644 index 0000000..decdff1 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-dev-symlink-fp/build-spec/orig/code.c b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink-fp/build-spec/orig/code.c new file mode 100644 index 0000000..9a88735 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-dev-symlink-fp/build-spec/orig/code.h b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink-fp/build-spec/orig/code.h new file mode 100644 index 0000000..570beae --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-dev-symlink-fp/eval/desc b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink-fp/eval/desc new file mode 100644 index 0000000..4cc6818 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink-fp/eval/desc @@ -0,0 +1,4 @@ +Testname: shared-libs-dev-symlink-fp +Test-Against: + lacks-unversioned-link-to-shared-library +Check: libraries/shared/links diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink-fp/eval/hints b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink-fp/eval/hints new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink-fp/eval/hints @@ -0,0 +1 @@ + diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/build-spec/debian/control.in b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/build-spec/debian/control.in new file mode 100644 index 0000000..dfba657 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-dev-symlink/build-spec/debian/libfoo-dev.install b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/build-spec/debian/libfoo-dev.install new file mode 100644 index 0000000..e43b95c --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/build-spec/debian/libfoo-dev.install @@ -0,0 +1 @@ +usr/include diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/build-spec/debian/libfoo1.install b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/build-spec/debian/libfoo1.install new file mode 100644 index 0000000..08fa063 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/build-spec/debian/libfoo1.install @@ -0,0 +1 @@ +usr/lib/libfoo.so.* diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/build-spec/debian/libfoo1.symbols b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/build-spec/debian/libfoo1.symbols new file mode 100644 index 0000000..a1f052b --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-dev-symlink/build-spec/fill-values b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/build-spec/fill-values new file mode 100644 index 0000000..9c44aa5 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-dev-symlink/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/build-spec/orig/Makefile new file mode 100644 index 0000000..a7a50b9 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-dev-symlink/build-spec/orig/code.c b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/build-spec/orig/code.c new file mode 100644 index 0000000..9a88735 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-dev-symlink/build-spec/orig/code.h b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/build-spec/orig/code.h new file mode 100644 index 0000000..570beae --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-dev-symlink/eval/desc b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/eval/desc new file mode 100644 index 0000000..5498340 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-dev-symlink +Check: libraries/shared/links diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/eval/hints b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/eval/hints new file mode 100644 index 0000000..f612e92 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-dev-symlink/eval/hints @@ -0,0 +1 @@ +libfoo1 (binary): lacks-unversioned-link-to-shared-library example: usr/lib/libfoo.so [usr/lib/libfoo.so.1.0.1] diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-not-symlink/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-not-symlink/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-not-symlink/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-not-symlink/build-spec/debian/control.in b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-not-symlink/build-spec/debian/control.in new file mode 100644 index 0000000..c20a449 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-ldconfig-not-symlink/build-spec/debian/libfoo1.symbols b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-not-symlink/build-spec/debian/libfoo1.symbols new file mode 100644 index 0000000..a1f052b --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-ldconfig-not-symlink/build-spec/fill-values b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-not-symlink/build-spec/fill-values new file mode 100644 index 0000000..b000a7b --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-ldconfig-not-symlink/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-not-symlink/build-spec/orig/Makefile new file mode 100644 index 0000000..2e3306e --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-ldconfig-not-symlink/build-spec/orig/code.c b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-not-symlink/build-spec/orig/code.c new file mode 100644 index 0000000..0ed08e0 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-ldconfig-not-symlink/eval/desc b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-not-symlink/eval/desc new file mode 100644 index 0000000..c73712e --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-not-symlink/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-ldconfig-not-symlink +Check: libraries/shared/links diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-not-symlink/eval/hints b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-not-symlink/eval/hints new file mode 100644 index 0000000..c78dccd --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-not-symlink/eval/hints @@ -0,0 +1 @@ +libfoo1 (binary): ldconfig-symlink-is-not-a-symlink should point to usr/lib/libfoo.so.1.0.1 [usr/lib/libfoo.so.1] diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-wrong-file/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-wrong-file/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-wrong-file/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-wrong-file/build-spec/debian/control.in b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-wrong-file/build-spec/debian/control.in new file mode 100644 index 0000000..c20a449 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-ldconfig-wrong-file/build-spec/debian/libfoo1.symbols b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-wrong-file/build-spec/debian/libfoo1.symbols new file mode 100644 index 0000000..a1f052b --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-ldconfig-wrong-file/build-spec/fill-values b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-wrong-file/build-spec/fill-values new file mode 100644 index 0000000..74b1f2a --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-ldconfig-wrong-file/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-wrong-file/build-spec/orig/Makefile new file mode 100644 index 0000000..373cbd2 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-ldconfig-wrong-file/build-spec/orig/code.c b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-wrong-file/build-spec/orig/code.c new file mode 100644 index 0000000..0ed08e0 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-ldconfig-wrong-file/eval/desc b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-wrong-file/eval/desc new file mode 100644 index 0000000..5b8f458 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-wrong-file/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-ldconfig-wrong-file +Check: libraries/shared/links diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-wrong-file/eval/hints b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-wrong-file/eval/hints new file mode 100644 index 0000000..9dce51a --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-ldconfig-wrong-file/eval/hints @@ -0,0 +1 @@ +libfoo1 (binary): ldconfig-symlink-referencing-wrong-file should point to some-other-file instead of libfoo.so.1.0.1 [usr/lib/libfoo.so.1] diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-missing-ldconfig-symlink/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/links/shared-libs-missing-ldconfig-symlink/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-missing-ldconfig-symlink/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-missing-ldconfig-symlink/build-spec/debian/control.in b/t/recipes/checks/libraries/shared/links/shared-libs-missing-ldconfig-symlink/build-spec/debian/control.in new file mode 100644 index 0000000..86a2064 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-missing-ldconfig-symlink/build-spec/debian/libexecbit1.symbols b/t/recipes/checks/libraries/shared/links/shared-libs-missing-ldconfig-symlink/build-spec/debian/libexecbit1.symbols new file mode 100644 index 0000000..0b26833 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-missing-ldconfig-symlink/build-spec/fill-values b/t/recipes/checks/libraries/shared/links/shared-libs-missing-ldconfig-symlink/build-spec/fill-values new file mode 100644 index 0000000..50aa473 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-missing-ldconfig-symlink/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/links/shared-libs-missing-ldconfig-symlink/build-spec/orig/Makefile new file mode 100644 index 0000000..6de6868 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-missing-ldconfig-symlink/build-spec/orig/code.c b/t/recipes/checks/libraries/shared/links/shared-libs-missing-ldconfig-symlink/build-spec/orig/code.c new file mode 100644 index 0000000..65887f3 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-missing-ldconfig-symlink/eval/desc b/t/recipes/checks/libraries/shared/links/shared-libs-missing-ldconfig-symlink/eval/desc new file mode 100644 index 0000000..c5f12a5 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-missing-ldconfig-symlink/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-missing-ldconfig-symlink +Check: libraries/shared/links diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-missing-ldconfig-symlink/eval/hints b/t/recipes/checks/libraries/shared/links/shared-libs-missing-ldconfig-symlink/eval/hints new file mode 100644 index 0000000..7e665b8 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-missing-ldconfig-symlink/eval/hints @@ -0,0 +1 @@ +libexecbit1 (binary): lacks-versioned-link-to-shared-library usr/lib/libexecbit.so.1 [usr/lib/libexecbit.so.1.0.1] diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-non-dev-symlink/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/links/shared-libs-non-dev-symlink/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-non-dev-symlink/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-non-dev-symlink/build-spec/debian/control.in b/t/recipes/checks/libraries/shared/links/shared-libs-non-dev-symlink/build-spec/debian/control.in new file mode 100644 index 0000000..c20a449 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-non-dev-symlink/build-spec/debian/libfoo1.symbols b/t/recipes/checks/libraries/shared/links/shared-libs-non-dev-symlink/build-spec/debian/libfoo1.symbols new file mode 100644 index 0000000..a1f052b --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-non-dev-symlink/build-spec/fill-values b/t/recipes/checks/libraries/shared/links/shared-libs-non-dev-symlink/build-spec/fill-values new file mode 100644 index 0000000..cec22d9 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-non-dev-symlink/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/links/shared-libs-non-dev-symlink/build-spec/orig/Makefile new file mode 100644 index 0000000..b62fa17 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-non-dev-symlink/build-spec/orig/code.c b/t/recipes/checks/libraries/shared/links/shared-libs-non-dev-symlink/build-spec/orig/code.c new file mode 100644 index 0000000..0ed08e0 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/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/libraries/shared/links/shared-libs-non-dev-symlink/eval/desc b/t/recipes/checks/libraries/shared/links/shared-libs-non-dev-symlink/eval/desc new file mode 100644 index 0000000..818d698 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-non-dev-symlink/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-non-dev-symlink +Check: libraries/shared/links diff --git a/t/recipes/checks/libraries/shared/links/shared-libs-non-dev-symlink/eval/hints b/t/recipes/checks/libraries/shared/links/shared-libs-non-dev-symlink/eval/hints new file mode 100644 index 0000000..5fde620 --- /dev/null +++ b/t/recipes/checks/libraries/shared/links/shared-libs-non-dev-symlink/eval/hints @@ -0,0 +1 @@ +libfoo1 (binary): link-to-shared-library-in-wrong-package usr/lib/libfoo.so.1.0.1 [usr/lib/libfoo.so] diff --git a/t/recipes/checks/libraries/shared/multi-arch/shared-libs-multi-arch-foreign/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/multi-arch/shared-libs-multi-arch-foreign/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/multi-arch/shared-libs-multi-arch-foreign/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/multi-arch/shared-libs-multi-arch-foreign/build-spec/debian/control.in b/t/recipes/checks/libraries/shared/multi-arch/shared-libs-multi-arch-foreign/build-spec/debian/control.in new file mode 100644 index 0000000..29d4c58 --- /dev/null +++ b/t/recipes/checks/libraries/shared/multi-arch/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/libraries/shared/multi-arch/shared-libs-multi-arch-foreign/build-spec/debian/libhallo1.symbols b/t/recipes/checks/libraries/shared/multi-arch/shared-libs-multi-arch-foreign/build-spec/debian/libhallo1.symbols new file mode 100644 index 0000000..4c27e3f --- /dev/null +++ b/t/recipes/checks/libraries/shared/multi-arch/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/libraries/shared/multi-arch/shared-libs-multi-arch-foreign/build-spec/fill-values b/t/recipes/checks/libraries/shared/multi-arch/shared-libs-multi-arch-foreign/build-spec/fill-values new file mode 100644 index 0000000..de5d6cc --- /dev/null +++ b/t/recipes/checks/libraries/shared/multi-arch/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/libraries/shared/multi-arch/shared-libs-multi-arch-foreign/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/multi-arch/shared-libs-multi-arch-foreign/build-spec/orig/Makefile new file mode 100644 index 0000000..ac55af7 --- /dev/null +++ b/t/recipes/checks/libraries/shared/multi-arch/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/libraries/shared/multi-arch/shared-libs-multi-arch-foreign/build-spec/orig/code.c b/t/recipes/checks/libraries/shared/multi-arch/shared-libs-multi-arch-foreign/build-spec/orig/code.c new file mode 100644 index 0000000..65887f3 --- /dev/null +++ b/t/recipes/checks/libraries/shared/multi-arch/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/libraries/shared/multi-arch/shared-libs-multi-arch-foreign/eval/desc b/t/recipes/checks/libraries/shared/multi-arch/shared-libs-multi-arch-foreign/eval/desc new file mode 100644 index 0000000..002fcf0 --- /dev/null +++ b/t/recipes/checks/libraries/shared/multi-arch/shared-libs-multi-arch-foreign/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-multi-arch-foreign +Check: libraries/shared/multi-arch diff --git a/t/recipes/checks/libraries/shared/multi-arch/shared-libs-multi-arch-foreign/eval/hints b/t/recipes/checks/libraries/shared/multi-arch/shared-libs-multi-arch-foreign/eval/hints new file mode 100644 index 0000000..28706b2 --- /dev/null +++ b/t/recipes/checks/libraries/shared/multi-arch/shared-libs-multi-arch-foreign/eval/hints @@ -0,0 +1 @@ +libhallo1 (binary): shared-library-is-multi-arch-foreign usr/lib/libhallo.so.1.0.1 diff --git a/t/recipes/checks/libraries/shared/obsolete/cblas/build-spec/debian/rules b/t/recipes/checks/libraries/shared/obsolete/cblas/build-spec/debian/rules new file mode 100644 index 0000000..1511626 --- /dev/null +++ b/t/recipes/checks/libraries/shared/obsolete/cblas/build-spec/debian/rules @@ -0,0 +1,9 @@ +#!/usr/bin/make -f + +export DEB_BUILD_MAINT_OPTIONS=hardening=+all + +%: + dh $@ + +# errors out with: objcopy: '.../binaries-missing-depends-on-xapi.debug': No such file +override_dh_dwz: diff --git a/t/recipes/checks/libraries/shared/obsolete/cblas/build-spec/fill-values b/t/recipes/checks/libraries/shared/obsolete/cblas/build-spec/fill-values new file mode 100644 index 0000000..f369a07 --- /dev/null +++ b/t/recipes/checks/libraries/shared/obsolete/cblas/build-spec/fill-values @@ -0,0 +1,4 @@ +Skeleton: upload-native +Testname: cblas +Description: Compiled executable that uses libcblas.so. +Package-Architecture: any diff --git a/t/recipes/checks/libraries/shared/obsolete/cblas/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/obsolete/cblas/build-spec/orig/Makefile new file mode 100644 index 0000000..24efbc8 --- /dev/null +++ b/t/recipes/checks/libraries/shared/obsolete/cblas/build-spec/orig/Makefile @@ -0,0 +1,17 @@ +TRIPLET := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) + +all: + gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -fPIC -shared -Wl,-z,defs -Wl,-soname,libcblas.so.1 -o libcblas.so libcblas.c + gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o consumer consumer.c -L. -lcblas + +install: + install -d $(DESTDIR)/usr/lib/$(TRIPLET) + install -m 644 -c -s libcblas.so $(DESTDIR)/usr/lib/$(TRIPLET)/libcblas.so.1 + install -d $(DESTDIR)/usr/bin + install -m 644 -c consumer $(DESTDIR)/usr/bin/ + +clean distclean: + rm -f consumer + rm -f libcblas.so + +check test: diff --git a/t/recipes/checks/libraries/shared/obsolete/cblas/build-spec/orig/cblas.h b/t/recipes/checks/libraries/shared/obsolete/cblas/build-spec/orig/cblas.h new file mode 100644 index 0000000..5ee765f --- /dev/null +++ b/t/recipes/checks/libraries/shared/obsolete/cblas/build-spec/orig/cblas.h @@ -0,0 +1 @@ +float sasum(int n, float* x, int incx); diff --git a/t/recipes/checks/libraries/shared/obsolete/cblas/build-spec/orig/consumer.c b/t/recipes/checks/libraries/shared/obsolete/cblas/build-spec/orig/consumer.c new file mode 100644 index 0000000..baab985 --- /dev/null +++ b/t/recipes/checks/libraries/shared/obsolete/cblas/build-spec/orig/consumer.c @@ -0,0 +1,11 @@ +#include <assert.h> + +#include "cblas.h" + +int main(void) +{ + float array[] = {1.,-1.,1.,-1.}; + assert(4 == sasum(4, array, 1)); + + return 0; +} diff --git a/t/recipes/checks/libraries/shared/obsolete/cblas/build-spec/orig/libcblas.c b/t/recipes/checks/libraries/shared/obsolete/cblas/build-spec/orig/libcblas.c new file mode 100644 index 0000000..02ab68d --- /dev/null +++ b/t/recipes/checks/libraries/shared/obsolete/cblas/build-spec/orig/libcblas.c @@ -0,0 +1,9 @@ +#include <stdlib.h> +#include <math.h> + +float sasum(int n, float* x, int incx) { + float s = 0; + for (int i = 0; i < n; i++) + s += abs(*(x+i)); + return s; +} diff --git a/t/recipes/checks/libraries/shared/obsolete/cblas/eval/desc b/t/recipes/checks/libraries/shared/obsolete/cblas/eval/desc new file mode 100644 index 0000000..ca03b68 --- /dev/null +++ b/t/recipes/checks/libraries/shared/obsolete/cblas/eval/desc @@ -0,0 +1,2 @@ +Testname: cblas +Check: libraries/shared/obsolete diff --git a/t/recipes/checks/libraries/shared/obsolete/cblas/eval/hints b/t/recipes/checks/libraries/shared/obsolete/cblas/eval/hints new file mode 100644 index 0000000..105efad --- /dev/null +++ b/t/recipes/checks/libraries/shared/obsolete/cblas/eval/hints @@ -0,0 +1 @@ +cblas (binary): linked-with-obsolete-library libcblas.so.1 [usr/bin/consumer] diff --git a/t/recipes/checks/libraries/shared/relocation/shared-libs-non-pic-i386/build-spec/Makefile.in b/t/recipes/checks/libraries/shared/relocation/shared-libs-non-pic-i386/build-spec/Makefile.in new file mode 100644 index 0000000..372897d --- /dev/null +++ b/t/recipes/checks/libraries/shared/relocation/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/libraries/shared/relocation/shared-libs-non-pic-i386/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/relocation/shared-libs-non-pic-i386/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/relocation/shared-libs-non-pic-i386/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/relocation/shared-libs-non-pic-i386/build-spec/debian/control.in b/t/recipes/checks/libraries/shared/relocation/shared-libs-non-pic-i386/build-spec/debian/control.in new file mode 100644 index 0000000..47c51c7 --- /dev/null +++ b/t/recipes/checks/libraries/shared/relocation/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/libraries/shared/relocation/shared-libs-non-pic-i386/build-spec/debian/symbols b/t/recipes/checks/libraries/shared/relocation/shared-libs-non-pic-i386/build-spec/debian/symbols new file mode 100644 index 0000000..63ba04d --- /dev/null +++ b/t/recipes/checks/libraries/shared/relocation/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/libraries/shared/relocation/shared-libs-non-pic-i386/build-spec/fill-values b/t/recipes/checks/libraries/shared/relocation/shared-libs-non-pic-i386/build-spec/fill-values new file mode 100644 index 0000000..cb0b316 --- /dev/null +++ b/t/recipes/checks/libraries/shared/relocation/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/libraries/shared/relocation/shared-libs-non-pic-i386/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/relocation/shared-libs-non-pic-i386/build-spec/orig/Makefile new file mode 100644 index 0000000..c5ec48c --- /dev/null +++ b/t/recipes/checks/libraries/shared/relocation/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/libraries/shared/relocation/shared-libs-non-pic-i386/build-spec/orig/non-pic.c b/t/recipes/checks/libraries/shared/relocation/shared-libs-non-pic-i386/build-spec/orig/non-pic.c new file mode 100644 index 0000000..f0fa719 --- /dev/null +++ b/t/recipes/checks/libraries/shared/relocation/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/libraries/shared/relocation/shared-libs-non-pic-i386/eval/desc b/t/recipes/checks/libraries/shared/relocation/shared-libs-non-pic-i386/eval/desc new file mode 100644 index 0000000..a84565c --- /dev/null +++ b/t/recipes/checks/libraries/shared/relocation/shared-libs-non-pic-i386/eval/desc @@ -0,0 +1,3 @@ +Testname: shared-libs-non-pic-i386 +Test-Architectures: i386 +Check: libraries/shared/relocation diff --git a/t/recipes/checks/libraries/shared/relocation/shared-libs-non-pic-i386/eval/hints b/t/recipes/checks/libraries/shared/relocation/shared-libs-non-pic-i386/eval/hints new file mode 100644 index 0000000..dbd4fe7 --- /dev/null +++ b/t/recipes/checks/libraries/shared/relocation/shared-libs-non-pic-i386/eval/hints @@ -0,0 +1 @@ +libbaz3-1 (binary): specific-address-in-shared-library [usr/lib/libbaz3.so.1.0.3b] diff --git a/t/recipes/checks/libraries/shared/relocation/shared-libs-non-pic-i386/eval/post-test b/t/recipes/checks/libraries/shared/relocation/shared-libs-non-pic-i386/eval/post-test new file mode 100755 index 0000000..11ad2c8 --- /dev/null +++ b/t/recipes/checks/libraries/shared/relocation/shared-libs-non-pic-i386/eval/post-test @@ -0,0 +1 @@ +/: hardening-.*/ d diff --git a/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/control.in b/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/control.in new file mode 100644 index 0000000..1109beb --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/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/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/libany5gcc1v5.install b/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/libany5gcc1v5.install new file mode 100644 index 0000000..283bc61 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/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/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/libany5gcc1v5.symbols b/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/libany5gcc1v5.symbols new file mode 100644 index 0000000..a394502 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/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/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/libany6gcc1v6.install b/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/libany6gcc1v6.install new file mode 100644 index 0000000..9485e87 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/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/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/libany6gcc1v6.symbols b/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/libany6gcc1v6.symbols new file mode 100644 index 0000000..aee5f00 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/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/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/libanyq16-6.install b/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/libanyq16-6.install new file mode 100644 index 0000000..b4ecaea --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/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/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/libanyq16-6.symbols b/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/libanyq16-6.symbols new file mode 100644 index 0000000..0f32f79 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/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/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/mylibany.install b/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/mylibany.install new file mode 100644 index 0000000..5c86ce1 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/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/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/mylibany.symbols b/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/debian/mylibany.symbols new file mode 100644 index 0000000..9b6f454 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/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/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/fill-values b/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/fill-values new file mode 100644 index 0000000..523eb0b --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/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/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/orig/Makefile new file mode 100644 index 0000000..21a67b5 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/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/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/orig/code.c b/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/build-spec/orig/code.c new file mode 100644 index 0000000..0c4f917 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/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/libraries/shared/soname/binaries-doesnt-match-sonames/eval/desc b/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/eval/desc new file mode 100644 index 0000000..f56f7dc --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/eval/desc @@ -0,0 +1,2 @@ +Testname: binaries-doesnt-match-sonames +Check: libraries/shared/soname diff --git a/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/eval/hints b/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/eval/hints new file mode 100644 index 0000000..3bf2fcf --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/binaries-doesnt-match-sonames/eval/hints @@ -0,0 +1 @@ +mylibany (binary): package-name-doesnt-match-sonames libany1 diff --git a/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/changelog.in b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/changelog.in new file mode 100644 index 0000000..91a6bb5 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/changelog.in @@ -0,0 +1,6 @@ +libbaz ([% $version %]) [% $distribution %]; urgency=low + + * Initial setup + + -- Sean 'Shaleh' Perry <shaleh@debian.org> Tue, 30 Jan 2001 15:23:59 -0800 + diff --git a/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/control b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/control new file mode 100644 index 0000000..1506687 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/control @@ -0,0 +1,58 @@ +Source: libbaz +Section: libs +Priority: optional +Maintainer: Lintian Maintainer <lintian-maint@debian.org> +Build-depends: debhelper (>=4) +Standards-Version: 3.2.1 + +Package: libbaz1 +Architecture: any +Provides: libbaz +Description: test handling of library packages + Regression test for lintian's handling of libraries. + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz1-dev +Architecture: any +Depends: libbaz1 (= ${source:Version}), perlapi-5.8.8 +Description: development package + Regression test for lintian's handling of libraries (dev). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz2 +Architecture: any +Depends: ${shlibs:Depends}, libssl0.9.8 +Description: test handling of library packages (good) + Regression test for lintian's handling of libraries (good). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz2-dev +Architecture: any +Depends: ${shlibs:Depends}, libbaz2 (= ${source:Version}) +Description: development package (good) + Regression test for lintian's handling of libraries (dev good). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz2-dbg +Architecture: any +Depends: libbaz2 (= ${binary:Version}) +Priority: optional +Description: debugging package + Regression test for lintian's handling of libraries (debug). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + diff --git a/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/copyright b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/copyright new file mode 100644 index 0000000..a874c87 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/copyright @@ -0,0 +1,8 @@ +This package is released under public domain. This is distributed in the hope +that it will be useful, but without any warranty; without even the implied +warranty of merchantability or fitness for a particular purpose. + +A reference to /usr/share/common-licenses/GPL-2 to make it look like this +package is under the GPL and trigger the OpenSSL warning. + +However, this has an OpenSSL exception. diff --git a/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/dev.postinst b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/dev.postinst new file mode 100644 index 0000000..683e3cc --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/dev.postinst @@ -0,0 +1,4 @@ +#!/bin/sh -e + +$PKG=libbaz1-dev + diff --git a/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/dev.prerm b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/dev.prerm new file mode 100644 index 0000000..683e3cc --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/dev.prerm @@ -0,0 +1,4 @@ +#!/bin/sh -e + +$PKG=libbaz1-dev + diff --git a/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/lib.postinst b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/lib.postinst new file mode 100644 index 0000000..ec0b98a --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/lib.postinst @@ -0,0 +1,10 @@ +#!/bin/sh -e + +$PKG=libbaz1 + +if [ "$1" = "configure" ]; then + if [ -d /usr/doc -a ! -e /usr/doc/$PKG -a -d /usr/share/doc/$PKG ] +; then + ln -sf ../share/doc/$PKG /usr/doc/$PKG + fi +fi diff --git a/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/lib.prerm b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/lib.prerm new file mode 100644 index 0000000..50e37c3 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/lib.prerm @@ -0,0 +1,7 @@ +#!/bin/sh -e + +$PKG=libbaz1 + +if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/$PKG ]; then + rm -f /usr/doc/$PKG +fi diff --git a/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/lib.shlibs b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/lib.shlibs new file mode 100644 index 0000000..b88e288 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/lib.shlibs @@ -0,0 +1,8 @@ +libdoesntexist2 1.0 libbaz1 +libdoesntexist2 1.0 libbaz1 +libbaz2 1.1 libbaz +libbaz3 1 libbaz1 (>> 1-1) +libbaz4 1 libbaz1 (= 1-1) +libbaz5 1 libbaz2 +udeb: libdoesntexist2 1.0 libbaz2 +udeb: libdoesntexist2 1.0 libbaz2 diff --git a/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/lib.symbols b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/lib.symbols new file mode 100644 index 0000000..72f9d8a --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/lib.symbols @@ -0,0 +1,3 @@ +libbaz.so.2 libbaz1 #MINVER# + pw 1-1 + foo 1.1-1 diff --git a/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/rules b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/rules new file mode 100755 index 0000000..fa99bc8 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/rules @@ -0,0 +1,121 @@ +#!/usr/bin/make -f + +lib_tmp=debian/tmp-lib +dev_tmp=debian/tmp-dev + +LIB=libbaz1 +DEV=libbaz1-dev + +VENDORARCH := $(shell perl -MConfig -wE'say substr($$Config{vendorarch},1)') + +build-arch: + $(MAKE) + +build-indep: + +build: build-arch build-indep + +clean: + $(MAKE) clean + dh_clean -plibbaz2 -plibbaz2-dev + rm -f debian/files debian/substvars + rm -rf $(lib_tmp) $(dev_tmp) + +# Now the correct libbaz2-dev package +binary-correct: + install -d debian/libbaz2-dev/usr/lib + cp -a libbaz2.a libbaz2.so debian/libbaz2-dev/usr/lib + # usually, I'd also include some .h files to /usr/include + + # Now the correct libbaz2 package + install -d debian/libbaz2/usr/lib + cp -a libbaz2.so.* debian/libbaz2/usr/lib + chmod a-x debian/libbaz2/usr/lib/* + + # General stuff that is tested in other testsets: + dh_installdocs -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + dh_compress -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + + # Mess up the libbaz2 changelog files to test the symlink handling. + ln -s /usr/share/doc/lintian/changelog.gz \ + debian/libbaz2/usr/share/doc/libbaz2/changelog.gz + install -m 644 debian/changelog \ + debian/libbaz2-dev/usr/share/doc/libbaz2-dev/foo + ln -s foo debian/libbaz2-dev/usr/share/doc/libbaz2-dev/changelog + + # Okay, if either line is omitted, it should be noted + dh_strip --dbg-package=libbaz2-dbg -plibbaz2 -plibbaz2-dev + dh_makeshlibs -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + dh_shlibdeps -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + + # and again, regular packaging stuff + dh_installdeb -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + echo udeb: libbaz2 1.0 libbaz2 >> debian/libbaz2/DEBIAN/shlibs + dh_gencontrol -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + dh_builddeb -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + +# and the incorrect one +binary-arch: build-arch binary-correct + # first, the lib package + install -d $(lib_tmp)/usr/lib + # resp. no soname (check), wrong soname (check), and no-pic (check) + cp -a libbaz1.so.1.0* $(lib_tmp)/usr/lib + cp -a libbaz2.so.1.0.3b $(lib_tmp)/usr/lib/libfoo2.so.1.0.3b + install -m644 libbaz3.so.1.0.3b $(lib_tmp)/usr/lib/libbaz3.so.1.0.3b + # let's include the .a in the non-dev too (TODO) + # Also, libbaz1.a hasn't a symbol table (TODO) + cp -a *.a $(lib_tmp)/usr/lib + # And a wrong .so symlink (wrong, only in -dev, TODO) + ln -s libfoo3.so.0.9 $(lib_tmp)/usr/lib/libfoo3.so + # And a wrong .so.X symlink (wrong, should point to a real existing + # shlib, TODO) + ln -s libfoo.so.0.9.1 $(lib_tmp)/usr/lib/libfoo.so.0.9 + # And a plain .so (wrong, TODO) + touch $(lib_tmp)/usr/lib/libbar2.so + # And a non-versioned SONAME. + install -m644 libbaz.so $(lib_tmp)/usr/lib/libbaz.so + strip --remove-section=.comment --strip-unneeded $(lib_tmp)/usr/lib/libbaz.so + # Pretend to be a Perl module to test a lack of Perl dependencies. + install -d $(lib_tmp)/$(VENDORARCH)/auto/Foo + install -m 644 libbaz2.so.1.0.3b $(lib_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + strip $(lib_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + + install -d $(lib_tmp)/usr/share/doc/$(LIB) + install -m 644 debian/copyright $(lib_tmp)/usr/share/doc/$(LIB) + install -m 644 debian/changelog $(lib_tmp)/usr/share/doc/$(LIB) + gzip -n -9 $(lib_tmp)/usr/share/doc/$(LIB)/changelog + install -d $(lib_tmp)/DEBIAN + install -m 755 debian/lib.postinst $(lib_tmp)/DEBIAN/postinst + install -m 755 debian/lib.prerm $(lib_tmp)/DEBIAN/prerm + touch $(lib_tmp)/usr/share/doc/README.Debian + #dpkg-shlibdeps $(lib_tmp)/usr/lib/libbaz.so.1.0 + install -m 755 debian/lib.shlibs $(lib_tmp)/DEBIAN/shlibs + install -m 755 debian/lib.symbols $(lib_tmp)/DEBIAN/symbols + dpkg-gencontrol -isp -p$(LIB) -P$(lib_tmp) + dpkg --build $(lib_tmp) .. + + # now the -dev package + install -d $(dev_tmp)/usr/include + install -d $(lib_tmp)/usr/lib + # let's also install the .so at the same time... (wrong, TODO) + cp -a *.a *.so.* $(lib_tmp)/usr/lib + # and fuck up permission (TODO) + chmod a+x $(lib_tmp)/usr/lib/*.a + # Pretend to be a Perl module to test a lack of Perl dependencies. + install -d $(dev_tmp)/$(VENDORARCH)/auto/Foo + install -m 644 libbaz2.so.1.0.3b $(dev_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + strip $(dev_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + install -d $(dev_tmp)/usr/share/doc + ln -s $(LIB) $(dev_tmp)/usr/share/doc/$(DEV) + install -d $(dev_tmp)/DEBIAN + install -m 755 debian/dev.postinst $(dev_tmp)/DEBIAN/postinst + install -m 755 debian/dev.prerm $(dev_tmp)/DEBIAN/prerm + dpkg-gencontrol -isp -p$(DEV) -P$(dev_tmp) + dpkg --build $(dev_tmp) .. + + +binary: binary-arch + +# The mention of binary-indep here should be sufficient to suppress the +# warning that it's not present. +.PHONY: build-arch build-indep build binary-arch binary-indep binary clean diff --git a/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/source.lintian-overrides b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/source.lintian-overrides new file mode 100644 index 0000000..6008d27 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/debian/source.lintian-overrides @@ -0,0 +1 @@ +libbaz source: maintainer-script-lacks-debhelper-token diff --git a/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/fill-values b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/fill-values new file mode 100644 index 0000000..7effe4f --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/fill-values @@ -0,0 +1,6 @@ +Skeleton: upload-non-native +Testname: legacy-libbaz +Source: libbaz +Version: 1-1 +Default-Build-Depends: debhelper (>= 9.20151004~) +Description: Legacy test "libbaz" diff --git a/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/orig/Makefile new file mode 100644 index 0000000..657dc2a --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/orig/Makefile @@ -0,0 +1,55 @@ +# This is the correct way to build a lib + +CC=gcc +CFLAGS=-g -Wall -Winline -O2 +LDFLAGS=-Wl,--no-as-needed + +OBJS=baz.o extra.o +SHOBJS=baz.sho extra.sho +NOPICOBJS = $(SHOBJS) + +all: libbaz1.a libbaz2.a libbaz1.so.1.0.3b libbaz2.so libbaz3.so.1.0.3b \ + libbaz.so + +libbaz2.so: libbaz2.so.1.0 + ln -sf $^ $@ +libbaz2.so.1.0: libbaz2.so.1.0.3b + ln -sf $^ $@ + +# Oops, forget the soname altogether +libbaz1.so.1.0.3b: $(NOPICOBJS) + $(CC) $(LDFLAGS) -o $@ -shared $^ -lc + +libbaz2.so.1.0.3b: $(SHOBJS) + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libbaz2.so.1.0 $^ -lc + +# Non-PIC. We can't test this on all architectures +libbaz3.so.1.0.3b: $(NOPICOBJS) + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libbaz3.so.1 $^ -lc + +# Non-versioned SONAME. +libbaz.so: $(SHOBJS) + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libbaz.so $^ -lc + +#%.o-noreentrant: %.c +# $(CC) $(LDFLAGS) $(CFLAGS) -o $@ -c $< + +%.sho: %.c + $(CC) $(LDFLAGS) $(CFLAGS) -D_REENTRANT -fPIC -o $@ -c $< + +%.o: %.c + $(CC) $(LDFLAGS) $(CFLAGS) -D_REENTRANT -o $@ -c $< + +libbaz2.a: $(OBJS) + ar cq $@ $(OBJS) + strip --strip-unneeded --remove-section=.comment \ + --remove-section=-note $@ + ranlib $@ + +# The pic one in the .a (wrong), no archive table +libbaz1.a: $(SHOBJS) + ar cqS $@ $^ + strip --strip-unneeded --remove-section=.comment \ + --remove-section=-note $@ +clean: + rm -f *.a *.o *.so* *.sho diff --git a/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/orig/baz.c b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/orig/baz.c new file mode 100644 index 0000000..4d5fc45 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/orig/baz.c @@ -0,0 +1,6 @@ +#include <math.h> + +double pw(double p) +{ + return exp(p); +} diff --git a/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/orig/extra.c b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/orig/extra.c new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/build-spec/orig/extra.c diff --git a/t/recipes/checks/libraries/shared/soname/legacy-libbaz/eval/desc b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/eval/desc new file mode 100644 index 0000000..0a028e1 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/eval/desc @@ -0,0 +1,2 @@ +Testname: legacy-libbaz +Check: libraries/shared/soname diff --git a/t/recipes/checks/libraries/shared/soname/legacy-libbaz/eval/hints b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/eval/hints new file mode 100644 index 0000000..17a0bab --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/eval/hints @@ -0,0 +1,2 @@ +libbaz2 (binary): package-name-doesnt-match-sonames libbaz2-1.0 +libbaz1 (binary): package-name-doesnt-match-sonames libbaz libbaz2-1.0 libbaz3-1 diff --git a/t/recipes/checks/libraries/shared/soname/legacy-libbaz/eval/post-test b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/eval/post-test new file mode 100755 index 0000000..29dc3f4 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/legacy-libbaz/eval/post-test @@ -0,0 +1,4 @@ +/: hardening-.*/ d +s/\(current is ([0-9]+\.)+[0-9]\)/(current is CURRENT)/ +s,usr/lib/([^\/]*/)?perl[0-9]*(/[0-9]*\.[0-9]*)?/,usr/lib/ma-dir/perl/version/,g +/: file-references-package-build-path / d diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/build-spec/debian/_symbols b/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/build-spec/debian/_symbols new file mode 100644 index 0000000..46e6af1 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/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/libraries/shared/soname/missing/legacy-debug/build-spec/debian/changelog.in b/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/build-spec/debian/changelog.in new file mode 100644 index 0000000..02da925 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/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/libraries/shared/soname/missing/legacy-debug/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/build-spec/debian/control b/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/build-spec/debian/control new file mode 100644 index 0000000..fcb2b86 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/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/libraries/shared/soname/missing/legacy-debug/build-spec/debian/copyright b/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/build-spec/debian/copyright new file mode 100644 index 0000000..5d4f6c2 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/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/libraries/shared/soname/missing/legacy-debug/build-spec/debian/rules b/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/build-spec/debian/rules new file mode 100755 index 0000000..b659895 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/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/libraries/shared/soname/missing/legacy-debug/build-spec/fill-values b/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/build-spec/fill-values new file mode 100644 index 0000000..79eebf1 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/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/libraries/shared/soname/missing/legacy-debug/build-spec/orig/hello.c b/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/build-spec/orig/hello.c new file mode 100644 index 0000000..76f8337 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/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/libraries/shared/soname/missing/legacy-debug/build-spec/orig/libhello.c b/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/build-spec/orig/libhello.c new file mode 100644 index 0000000..e2f8409 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/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/libraries/shared/soname/missing/legacy-debug/build-spec/orig/libhello.h b/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/build-spec/orig/libhello.h new file mode 100644 index 0000000..ef77476 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/build-spec/orig/libhello.h @@ -0,0 +1 @@ +void hello(void); diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/eval/desc b/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/eval/desc new file mode 100644 index 0000000..c44e37c --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/eval/desc @@ -0,0 +1,2 @@ +Testname: legacy-debug +Check: libraries/shared/soname/missing diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/eval/hints b/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/eval/hints new file mode 100644 index 0000000..67b1bb6 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/eval/hints @@ -0,0 +1 @@ +libhello0-dbg (binary): sharedobject-in-library-directory-missing-soname [usr/lib/libhello.so.dbg] diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/eval/post-test b/t/recipes/checks/libraries/shared/soname/missing/legacy-debug/eval/post-test new file mode 100644 index 0000000..fc97c5f --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/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/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/changelog.in b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/changelog.in new file mode 100644 index 0000000..91a6bb5 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/changelog.in @@ -0,0 +1,6 @@ +libbaz ([% $version %]) [% $distribution %]; urgency=low + + * Initial setup + + -- Sean 'Shaleh' Perry <shaleh@debian.org> Tue, 30 Jan 2001 15:23:59 -0800 + diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/control b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/control new file mode 100644 index 0000000..1506687 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/control @@ -0,0 +1,58 @@ +Source: libbaz +Section: libs +Priority: optional +Maintainer: Lintian Maintainer <lintian-maint@debian.org> +Build-depends: debhelper (>=4) +Standards-Version: 3.2.1 + +Package: libbaz1 +Architecture: any +Provides: libbaz +Description: test handling of library packages + Regression test for lintian's handling of libraries. + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz1-dev +Architecture: any +Depends: libbaz1 (= ${source:Version}), perlapi-5.8.8 +Description: development package + Regression test for lintian's handling of libraries (dev). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz2 +Architecture: any +Depends: ${shlibs:Depends}, libssl0.9.8 +Description: test handling of library packages (good) + Regression test for lintian's handling of libraries (good). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz2-dev +Architecture: any +Depends: ${shlibs:Depends}, libbaz2 (= ${source:Version}) +Description: development package (good) + Regression test for lintian's handling of libraries (dev good). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz2-dbg +Architecture: any +Depends: libbaz2 (= ${binary:Version}) +Priority: optional +Description: debugging package + Regression test for lintian's handling of libraries (debug). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/copyright b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/copyright new file mode 100644 index 0000000..a874c87 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/copyright @@ -0,0 +1,8 @@ +This package is released under public domain. This is distributed in the hope +that it will be useful, but without any warranty; without even the implied +warranty of merchantability or fitness for a particular purpose. + +A reference to /usr/share/common-licenses/GPL-2 to make it look like this +package is under the GPL and trigger the OpenSSL warning. + +However, this has an OpenSSL exception. diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/dev.postinst b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/dev.postinst new file mode 100644 index 0000000..683e3cc --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/dev.postinst @@ -0,0 +1,4 @@ +#!/bin/sh -e + +$PKG=libbaz1-dev + diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/dev.prerm b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/dev.prerm new file mode 100644 index 0000000..683e3cc --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/dev.prerm @@ -0,0 +1,4 @@ +#!/bin/sh -e + +$PKG=libbaz1-dev + diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/lib.postinst b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/lib.postinst new file mode 100644 index 0000000..ec0b98a --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/lib.postinst @@ -0,0 +1,10 @@ +#!/bin/sh -e + +$PKG=libbaz1 + +if [ "$1" = "configure" ]; then + if [ -d /usr/doc -a ! -e /usr/doc/$PKG -a -d /usr/share/doc/$PKG ] +; then + ln -sf ../share/doc/$PKG /usr/doc/$PKG + fi +fi diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/lib.prerm b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/lib.prerm new file mode 100644 index 0000000..50e37c3 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/lib.prerm @@ -0,0 +1,7 @@ +#!/bin/sh -e + +$PKG=libbaz1 + +if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/$PKG ]; then + rm -f /usr/doc/$PKG +fi diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/lib.shlibs b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/lib.shlibs new file mode 100644 index 0000000..b88e288 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/lib.shlibs @@ -0,0 +1,8 @@ +libdoesntexist2 1.0 libbaz1 +libdoesntexist2 1.0 libbaz1 +libbaz2 1.1 libbaz +libbaz3 1 libbaz1 (>> 1-1) +libbaz4 1 libbaz1 (= 1-1) +libbaz5 1 libbaz2 +udeb: libdoesntexist2 1.0 libbaz2 +udeb: libdoesntexist2 1.0 libbaz2 diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/lib.symbols b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/lib.symbols new file mode 100644 index 0000000..72f9d8a --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/lib.symbols @@ -0,0 +1,3 @@ +libbaz.so.2 libbaz1 #MINVER# + pw 1-1 + foo 1.1-1 diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/rules b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/rules new file mode 100755 index 0000000..fa99bc8 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/rules @@ -0,0 +1,121 @@ +#!/usr/bin/make -f + +lib_tmp=debian/tmp-lib +dev_tmp=debian/tmp-dev + +LIB=libbaz1 +DEV=libbaz1-dev + +VENDORARCH := $(shell perl -MConfig -wE'say substr($$Config{vendorarch},1)') + +build-arch: + $(MAKE) + +build-indep: + +build: build-arch build-indep + +clean: + $(MAKE) clean + dh_clean -plibbaz2 -plibbaz2-dev + rm -f debian/files debian/substvars + rm -rf $(lib_tmp) $(dev_tmp) + +# Now the correct libbaz2-dev package +binary-correct: + install -d debian/libbaz2-dev/usr/lib + cp -a libbaz2.a libbaz2.so debian/libbaz2-dev/usr/lib + # usually, I'd also include some .h files to /usr/include + + # Now the correct libbaz2 package + install -d debian/libbaz2/usr/lib + cp -a libbaz2.so.* debian/libbaz2/usr/lib + chmod a-x debian/libbaz2/usr/lib/* + + # General stuff that is tested in other testsets: + dh_installdocs -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + dh_compress -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + + # Mess up the libbaz2 changelog files to test the symlink handling. + ln -s /usr/share/doc/lintian/changelog.gz \ + debian/libbaz2/usr/share/doc/libbaz2/changelog.gz + install -m 644 debian/changelog \ + debian/libbaz2-dev/usr/share/doc/libbaz2-dev/foo + ln -s foo debian/libbaz2-dev/usr/share/doc/libbaz2-dev/changelog + + # Okay, if either line is omitted, it should be noted + dh_strip --dbg-package=libbaz2-dbg -plibbaz2 -plibbaz2-dev + dh_makeshlibs -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + dh_shlibdeps -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + + # and again, regular packaging stuff + dh_installdeb -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + echo udeb: libbaz2 1.0 libbaz2 >> debian/libbaz2/DEBIAN/shlibs + dh_gencontrol -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + dh_builddeb -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + +# and the incorrect one +binary-arch: build-arch binary-correct + # first, the lib package + install -d $(lib_tmp)/usr/lib + # resp. no soname (check), wrong soname (check), and no-pic (check) + cp -a libbaz1.so.1.0* $(lib_tmp)/usr/lib + cp -a libbaz2.so.1.0.3b $(lib_tmp)/usr/lib/libfoo2.so.1.0.3b + install -m644 libbaz3.so.1.0.3b $(lib_tmp)/usr/lib/libbaz3.so.1.0.3b + # let's include the .a in the non-dev too (TODO) + # Also, libbaz1.a hasn't a symbol table (TODO) + cp -a *.a $(lib_tmp)/usr/lib + # And a wrong .so symlink (wrong, only in -dev, TODO) + ln -s libfoo3.so.0.9 $(lib_tmp)/usr/lib/libfoo3.so + # And a wrong .so.X symlink (wrong, should point to a real existing + # shlib, TODO) + ln -s libfoo.so.0.9.1 $(lib_tmp)/usr/lib/libfoo.so.0.9 + # And a plain .so (wrong, TODO) + touch $(lib_tmp)/usr/lib/libbar2.so + # And a non-versioned SONAME. + install -m644 libbaz.so $(lib_tmp)/usr/lib/libbaz.so + strip --remove-section=.comment --strip-unneeded $(lib_tmp)/usr/lib/libbaz.so + # Pretend to be a Perl module to test a lack of Perl dependencies. + install -d $(lib_tmp)/$(VENDORARCH)/auto/Foo + install -m 644 libbaz2.so.1.0.3b $(lib_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + strip $(lib_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + + install -d $(lib_tmp)/usr/share/doc/$(LIB) + install -m 644 debian/copyright $(lib_tmp)/usr/share/doc/$(LIB) + install -m 644 debian/changelog $(lib_tmp)/usr/share/doc/$(LIB) + gzip -n -9 $(lib_tmp)/usr/share/doc/$(LIB)/changelog + install -d $(lib_tmp)/DEBIAN + install -m 755 debian/lib.postinst $(lib_tmp)/DEBIAN/postinst + install -m 755 debian/lib.prerm $(lib_tmp)/DEBIAN/prerm + touch $(lib_tmp)/usr/share/doc/README.Debian + #dpkg-shlibdeps $(lib_tmp)/usr/lib/libbaz.so.1.0 + install -m 755 debian/lib.shlibs $(lib_tmp)/DEBIAN/shlibs + install -m 755 debian/lib.symbols $(lib_tmp)/DEBIAN/symbols + dpkg-gencontrol -isp -p$(LIB) -P$(lib_tmp) + dpkg --build $(lib_tmp) .. + + # now the -dev package + install -d $(dev_tmp)/usr/include + install -d $(lib_tmp)/usr/lib + # let's also install the .so at the same time... (wrong, TODO) + cp -a *.a *.so.* $(lib_tmp)/usr/lib + # and fuck up permission (TODO) + chmod a+x $(lib_tmp)/usr/lib/*.a + # Pretend to be a Perl module to test a lack of Perl dependencies. + install -d $(dev_tmp)/$(VENDORARCH)/auto/Foo + install -m 644 libbaz2.so.1.0.3b $(dev_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + strip $(dev_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + install -d $(dev_tmp)/usr/share/doc + ln -s $(LIB) $(dev_tmp)/usr/share/doc/$(DEV) + install -d $(dev_tmp)/DEBIAN + install -m 755 debian/dev.postinst $(dev_tmp)/DEBIAN/postinst + install -m 755 debian/dev.prerm $(dev_tmp)/DEBIAN/prerm + dpkg-gencontrol -isp -p$(DEV) -P$(dev_tmp) + dpkg --build $(dev_tmp) .. + + +binary: binary-arch + +# The mention of binary-indep here should be sufficient to suppress the +# warning that it's not present. +.PHONY: build-arch build-indep build binary-arch binary-indep binary clean diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/source.lintian-overrides b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/source.lintian-overrides new file mode 100644 index 0000000..6008d27 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/debian/source.lintian-overrides @@ -0,0 +1 @@ +libbaz source: maintainer-script-lacks-debhelper-token diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/fill-values b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/fill-values new file mode 100644 index 0000000..7effe4f --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/fill-values @@ -0,0 +1,6 @@ +Skeleton: upload-non-native +Testname: legacy-libbaz +Source: libbaz +Version: 1-1 +Default-Build-Depends: debhelper (>= 9.20151004~) +Description: Legacy test "libbaz" diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/orig/Makefile new file mode 100644 index 0000000..657dc2a --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/orig/Makefile @@ -0,0 +1,55 @@ +# This is the correct way to build a lib + +CC=gcc +CFLAGS=-g -Wall -Winline -O2 +LDFLAGS=-Wl,--no-as-needed + +OBJS=baz.o extra.o +SHOBJS=baz.sho extra.sho +NOPICOBJS = $(SHOBJS) + +all: libbaz1.a libbaz2.a libbaz1.so.1.0.3b libbaz2.so libbaz3.so.1.0.3b \ + libbaz.so + +libbaz2.so: libbaz2.so.1.0 + ln -sf $^ $@ +libbaz2.so.1.0: libbaz2.so.1.0.3b + ln -sf $^ $@ + +# Oops, forget the soname altogether +libbaz1.so.1.0.3b: $(NOPICOBJS) + $(CC) $(LDFLAGS) -o $@ -shared $^ -lc + +libbaz2.so.1.0.3b: $(SHOBJS) + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libbaz2.so.1.0 $^ -lc + +# Non-PIC. We can't test this on all architectures +libbaz3.so.1.0.3b: $(NOPICOBJS) + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libbaz3.so.1 $^ -lc + +# Non-versioned SONAME. +libbaz.so: $(SHOBJS) + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libbaz.so $^ -lc + +#%.o-noreentrant: %.c +# $(CC) $(LDFLAGS) $(CFLAGS) -o $@ -c $< + +%.sho: %.c + $(CC) $(LDFLAGS) $(CFLAGS) -D_REENTRANT -fPIC -o $@ -c $< + +%.o: %.c + $(CC) $(LDFLAGS) $(CFLAGS) -D_REENTRANT -o $@ -c $< + +libbaz2.a: $(OBJS) + ar cq $@ $(OBJS) + strip --strip-unneeded --remove-section=.comment \ + --remove-section=-note $@ + ranlib $@ + +# The pic one in the .a (wrong), no archive table +libbaz1.a: $(SHOBJS) + ar cqS $@ $^ + strip --strip-unneeded --remove-section=.comment \ + --remove-section=-note $@ +clean: + rm -f *.a *.o *.so* *.sho diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/orig/baz.c b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/orig/baz.c new file mode 100644 index 0000000..4d5fc45 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/orig/baz.c @@ -0,0 +1,6 @@ +#include <math.h> + +double pw(double p) +{ + return exp(p); +} diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/orig/extra.c b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/orig/extra.c new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/build-spec/orig/extra.c diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/eval/desc b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/eval/desc new file mode 100644 index 0000000..ae6536b --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/eval/desc @@ -0,0 +1,2 @@ +Testname: legacy-libbaz +Check: libraries/shared/soname/missing diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/eval/hints b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/eval/hints new file mode 100644 index 0000000..28d3482 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/eval/hints @@ -0,0 +1 @@ +libbaz1 (binary): sharedobject-in-library-directory-missing-soname [usr/lib/libbaz1.so.1.0.3b] diff --git a/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/eval/post-test b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/eval/post-test new file mode 100755 index 0000000..29dc3f4 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/legacy-libbaz/eval/post-test @@ -0,0 +1,4 @@ +/: hardening-.*/ d +s/\(current is ([0-9]+\.)+[0-9]\)/(current is CURRENT)/ +s,usr/lib/([^\/]*/)?perl[0-9]*(/[0-9]*\.[0-9]*)?/,usr/lib/ma-dir/perl/version/,g +/: file-references-package-build-path / d diff --git a/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/build-spec/debian/control.in b/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/build-spec/debian/control.in new file mode 100644 index 0000000..c749732 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/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/libraries/shared/soname/missing/shared-libs-missing-soname/build-spec/fill-values b/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/build-spec/fill-values new file mode 100644 index 0000000..94741cf --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/build-spec/fill-values @@ -0,0 +1,6 @@ +Skeleton: upload-native +Testname: shared-libs-missing-soname +Package-Architecture: any +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test for shlib without SONAME diff --git a/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/build-spec/orig/Makefile new file mode 100644 index 0000000..2c8bd5e --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/build-spec/orig/Makefile @@ -0,0 +1,19 @@ +CFLAGS += -fPIC + +all: libhallo.so hallohelper + +libhallo.so: code.o + $(LINK.c) -o $@ -shared $^ -lc + +hallohelper: main.o + $(LINK.c) -o $@ -pie $^ -lc + +clean: + rm -f *.a *.o *.so *helper + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0644 *.so $(DESTDIR)/usr/lib + install -m 0755 *helper $(DESTDIR)/usr/lib + +.PHONY: install clean diff --git a/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/build-spec/orig/code.c b/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/build-spec/orig/code.c new file mode 100644 index 0000000..65887f3 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/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/libraries/shared/soname/missing/shared-libs-missing-soname/build-spec/orig/main.c b/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/build-spec/orig/main.c new file mode 100644 index 0000000..832667c --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/build-spec/orig/main.c @@ -0,0 +1,4 @@ +int main(int argc, char **argv) +{ + return 42; +} diff --git a/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/eval/desc b/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/eval/desc new file mode 100644 index 0000000..64729bb --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-missing-soname +Check: libraries/shared/soname/missing diff --git a/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/eval/hints b/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/eval/hints new file mode 100644 index 0000000..cd76dc7 --- /dev/null +++ b/t/recipes/checks/libraries/shared/soname/missing/shared-libs-missing-soname/eval/hints @@ -0,0 +1 @@ +libhallo1 (binary): sharedobject-in-library-directory-missing-soname [usr/lib/libhallo.so] diff --git a/t/recipes/checks/libraries/shared/stack/shared-libs-exec-stack/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/stack/shared-libs-exec-stack/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/stack/shared-libs-exec-stack/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/stack/shared-libs-exec-stack/build-spec/debian/control.in b/t/recipes/checks/libraries/shared/stack/shared-libs-exec-stack/build-spec/debian/control.in new file mode 100644 index 0000000..bd81464 --- /dev/null +++ b/t/recipes/checks/libraries/shared/stack/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/libraries/shared/stack/shared-libs-exec-stack/build-spec/debian/libexecstack1.symbols b/t/recipes/checks/libraries/shared/stack/shared-libs-exec-stack/build-spec/debian/libexecstack1.symbols new file mode 100644 index 0000000..1cc72ae --- /dev/null +++ b/t/recipes/checks/libraries/shared/stack/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/libraries/shared/stack/shared-libs-exec-stack/build-spec/fill-values b/t/recipes/checks/libraries/shared/stack/shared-libs-exec-stack/build-spec/fill-values new file mode 100644 index 0000000..7ca10e3 --- /dev/null +++ b/t/recipes/checks/libraries/shared/stack/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/libraries/shared/stack/shared-libs-exec-stack/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/stack/shared-libs-exec-stack/build-spec/orig/Makefile new file mode 100644 index 0000000..1754891 --- /dev/null +++ b/t/recipes/checks/libraries/shared/stack/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/libraries/shared/stack/shared-libs-exec-stack/build-spec/orig/foo.c b/t/recipes/checks/libraries/shared/stack/shared-libs-exec-stack/build-spec/orig/foo.c new file mode 100644 index 0000000..7f41799 --- /dev/null +++ b/t/recipes/checks/libraries/shared/stack/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/libraries/shared/stack/shared-libs-exec-stack/build-spec/orig/get.c b/t/recipes/checks/libraries/shared/stack/shared-libs-exec-stack/build-spec/orig/get.c new file mode 100644 index 0000000..8207637 --- /dev/null +++ b/t/recipes/checks/libraries/shared/stack/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/libraries/shared/stack/shared-libs-exec-stack/eval/desc b/t/recipes/checks/libraries/shared/stack/shared-libs-exec-stack/eval/desc new file mode 100644 index 0000000..d4a1cf4 --- /dev/null +++ b/t/recipes/checks/libraries/shared/stack/shared-libs-exec-stack/eval/desc @@ -0,0 +1,3 @@ +Testname: shared-libs-exec-stack +Check: libraries/shared/stack +Test-Architectures: any-amd64 any-i386 arm64 armel armhf ppc64el s390x alpha arc hppa ia64 m68k powerpc ppc64 riscv64 sh4 sparc64 x32 diff --git a/t/recipes/checks/libraries/shared/stack/shared-libs-exec-stack/eval/hints b/t/recipes/checks/libraries/shared/stack/shared-libs-exec-stack/eval/hints new file mode 100644 index 0000000..577d912 --- /dev/null +++ b/t/recipes/checks/libraries/shared/stack/shared-libs-exec-stack/eval/hints @@ -0,0 +1 @@ +libexecstack1 (binary): executable-stack-in-shared-library [usr/lib/libexecstack.so.1.0.1] diff --git a/t/recipes/checks/libraries/shared/stack/shared-libs-no-gnu-stack/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/stack/shared-libs-no-gnu-stack/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/stack/shared-libs-no-gnu-stack/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/stack/shared-libs-no-gnu-stack/build-spec/debian/control.in b/t/recipes/checks/libraries/shared/stack/shared-libs-no-gnu-stack/build-spec/debian/control.in new file mode 100644 index 0000000..c749732 --- /dev/null +++ b/t/recipes/checks/libraries/shared/stack/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/libraries/shared/stack/shared-libs-no-gnu-stack/build-spec/debian/libhallo1.symbols b/t/recipes/checks/libraries/shared/stack/shared-libs-no-gnu-stack/build-spec/debian/libhallo1.symbols new file mode 100644 index 0000000..4c27e3f --- /dev/null +++ b/t/recipes/checks/libraries/shared/stack/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/libraries/shared/stack/shared-libs-no-gnu-stack/build-spec/fill-values b/t/recipes/checks/libraries/shared/stack/shared-libs-no-gnu-stack/build-spec/fill-values new file mode 100644 index 0000000..c238ab1 --- /dev/null +++ b/t/recipes/checks/libraries/shared/stack/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/libraries/shared/stack/shared-libs-no-gnu-stack/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/stack/shared-libs-no-gnu-stack/build-spec/orig/Makefile new file mode 100644 index 0000000..8d357a8 --- /dev/null +++ b/t/recipes/checks/libraries/shared/stack/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/libraries/shared/stack/shared-libs-no-gnu-stack/build-spec/orig/code.c b/t/recipes/checks/libraries/shared/stack/shared-libs-no-gnu-stack/build-spec/orig/code.c new file mode 100644 index 0000000..65887f3 --- /dev/null +++ b/t/recipes/checks/libraries/shared/stack/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/libraries/shared/stack/shared-libs-no-gnu-stack/build-spec/orig/erase-pt-gnu-stack b/t/recipes/checks/libraries/shared/stack/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/libraries/shared/stack/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/libraries/shared/stack/shared-libs-no-gnu-stack/eval/desc b/t/recipes/checks/libraries/shared/stack/shared-libs-no-gnu-stack/eval/desc new file mode 100644 index 0000000..8986371 --- /dev/null +++ b/t/recipes/checks/libraries/shared/stack/shared-libs-no-gnu-stack/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-no-gnu-stack +Check: libraries/shared/stack diff --git a/t/recipes/checks/libraries/shared/stack/shared-libs-no-gnu-stack/eval/hints b/t/recipes/checks/libraries/shared/stack/shared-libs-no-gnu-stack/eval/hints new file mode 100644 index 0000000..cd6d473 --- /dev/null +++ b/t/recipes/checks/libraries/shared/stack/shared-libs-no-gnu-stack/eval/hints @@ -0,0 +1 @@ +libhallo1 (binary): shared-library-lacks-stack-section [usr/lib/libhallo.so.1.0.1] diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/changelog.in b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/changelog.in new file mode 100644 index 0000000..91a6bb5 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/changelog.in @@ -0,0 +1,6 @@ +libbaz ([% $version %]) [% $distribution %]; urgency=low + + * Initial setup + + -- Sean 'Shaleh' Perry <shaleh@debian.org> Tue, 30 Jan 2001 15:23:59 -0800 + diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/control b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/control new file mode 100644 index 0000000..1506687 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/control @@ -0,0 +1,58 @@ +Source: libbaz +Section: libs +Priority: optional +Maintainer: Lintian Maintainer <lintian-maint@debian.org> +Build-depends: debhelper (>=4) +Standards-Version: 3.2.1 + +Package: libbaz1 +Architecture: any +Provides: libbaz +Description: test handling of library packages + Regression test for lintian's handling of libraries. + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz1-dev +Architecture: any +Depends: libbaz1 (= ${source:Version}), perlapi-5.8.8 +Description: development package + Regression test for lintian's handling of libraries (dev). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz2 +Architecture: any +Depends: ${shlibs:Depends}, libssl0.9.8 +Description: test handling of library packages (good) + Regression test for lintian's handling of libraries (good). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz2-dev +Architecture: any +Depends: ${shlibs:Depends}, libbaz2 (= ${source:Version}) +Description: development package (good) + Regression test for lintian's handling of libraries (dev good). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + +Package: libbaz2-dbg +Architecture: any +Depends: libbaz2 (= ${binary:Version}) +Priority: optional +Description: debugging package + Regression test for lintian's handling of libraries (debug). + . + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/copyright b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/copyright new file mode 100644 index 0000000..a874c87 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/copyright @@ -0,0 +1,8 @@ +This package is released under public domain. This is distributed in the hope +that it will be useful, but without any warranty; without even the implied +warranty of merchantability or fitness for a particular purpose. + +A reference to /usr/share/common-licenses/GPL-2 to make it look like this +package is under the GPL and trigger the OpenSSL warning. + +However, this has an OpenSSL exception. diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/dev.postinst b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/dev.postinst new file mode 100644 index 0000000..683e3cc --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/dev.postinst @@ -0,0 +1,4 @@ +#!/bin/sh -e + +$PKG=libbaz1-dev + diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/dev.prerm b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/dev.prerm new file mode 100644 index 0000000..683e3cc --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/dev.prerm @@ -0,0 +1,4 @@ +#!/bin/sh -e + +$PKG=libbaz1-dev + diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.postinst b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.postinst new file mode 100644 index 0000000..ec0b98a --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.postinst @@ -0,0 +1,10 @@ +#!/bin/sh -e + +$PKG=libbaz1 + +if [ "$1" = "configure" ]; then + if [ -d /usr/doc -a ! -e /usr/doc/$PKG -a -d /usr/share/doc/$PKG ] +; then + ln -sf ../share/doc/$PKG /usr/doc/$PKG + fi +fi diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.prerm b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.prerm new file mode 100644 index 0000000..50e37c3 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.prerm @@ -0,0 +1,7 @@ +#!/bin/sh -e + +$PKG=libbaz1 + +if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/$PKG ]; then + rm -f /usr/doc/$PKG +fi diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.shlibs b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.shlibs new file mode 100644 index 0000000..b88e288 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.shlibs @@ -0,0 +1,8 @@ +libdoesntexist2 1.0 libbaz1 +libdoesntexist2 1.0 libbaz1 +libbaz2 1.1 libbaz +libbaz3 1 libbaz1 (>> 1-1) +libbaz4 1 libbaz1 (= 1-1) +libbaz5 1 libbaz2 +udeb: libdoesntexist2 1.0 libbaz2 +udeb: libdoesntexist2 1.0 libbaz2 diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.symbols b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.symbols new file mode 100644 index 0000000..72f9d8a --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/lib.symbols @@ -0,0 +1,3 @@ +libbaz.so.2 libbaz1 #MINVER# + pw 1-1 + foo 1.1-1 diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/rules b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/rules new file mode 100755 index 0000000..fa99bc8 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/rules @@ -0,0 +1,121 @@ +#!/usr/bin/make -f + +lib_tmp=debian/tmp-lib +dev_tmp=debian/tmp-dev + +LIB=libbaz1 +DEV=libbaz1-dev + +VENDORARCH := $(shell perl -MConfig -wE'say substr($$Config{vendorarch},1)') + +build-arch: + $(MAKE) + +build-indep: + +build: build-arch build-indep + +clean: + $(MAKE) clean + dh_clean -plibbaz2 -plibbaz2-dev + rm -f debian/files debian/substvars + rm -rf $(lib_tmp) $(dev_tmp) + +# Now the correct libbaz2-dev package +binary-correct: + install -d debian/libbaz2-dev/usr/lib + cp -a libbaz2.a libbaz2.so debian/libbaz2-dev/usr/lib + # usually, I'd also include some .h files to /usr/include + + # Now the correct libbaz2 package + install -d debian/libbaz2/usr/lib + cp -a libbaz2.so.* debian/libbaz2/usr/lib + chmod a-x debian/libbaz2/usr/lib/* + + # General stuff that is tested in other testsets: + dh_installdocs -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + dh_compress -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + + # Mess up the libbaz2 changelog files to test the symlink handling. + ln -s /usr/share/doc/lintian/changelog.gz \ + debian/libbaz2/usr/share/doc/libbaz2/changelog.gz + install -m 644 debian/changelog \ + debian/libbaz2-dev/usr/share/doc/libbaz2-dev/foo + ln -s foo debian/libbaz2-dev/usr/share/doc/libbaz2-dev/changelog + + # Okay, if either line is omitted, it should be noted + dh_strip --dbg-package=libbaz2-dbg -plibbaz2 -plibbaz2-dev + dh_makeshlibs -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + dh_shlibdeps -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + + # and again, regular packaging stuff + dh_installdeb -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + echo udeb: libbaz2 1.0 libbaz2 >> debian/libbaz2/DEBIAN/shlibs + dh_gencontrol -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + dh_builddeb -plibbaz2 -plibbaz2-dev -plibbaz2-dbg + +# and the incorrect one +binary-arch: build-arch binary-correct + # first, the lib package + install -d $(lib_tmp)/usr/lib + # resp. no soname (check), wrong soname (check), and no-pic (check) + cp -a libbaz1.so.1.0* $(lib_tmp)/usr/lib + cp -a libbaz2.so.1.0.3b $(lib_tmp)/usr/lib/libfoo2.so.1.0.3b + install -m644 libbaz3.so.1.0.3b $(lib_tmp)/usr/lib/libbaz3.so.1.0.3b + # let's include the .a in the non-dev too (TODO) + # Also, libbaz1.a hasn't a symbol table (TODO) + cp -a *.a $(lib_tmp)/usr/lib + # And a wrong .so symlink (wrong, only in -dev, TODO) + ln -s libfoo3.so.0.9 $(lib_tmp)/usr/lib/libfoo3.so + # And a wrong .so.X symlink (wrong, should point to a real existing + # shlib, TODO) + ln -s libfoo.so.0.9.1 $(lib_tmp)/usr/lib/libfoo.so.0.9 + # And a plain .so (wrong, TODO) + touch $(lib_tmp)/usr/lib/libbar2.so + # And a non-versioned SONAME. + install -m644 libbaz.so $(lib_tmp)/usr/lib/libbaz.so + strip --remove-section=.comment --strip-unneeded $(lib_tmp)/usr/lib/libbaz.so + # Pretend to be a Perl module to test a lack of Perl dependencies. + install -d $(lib_tmp)/$(VENDORARCH)/auto/Foo + install -m 644 libbaz2.so.1.0.3b $(lib_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + strip $(lib_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + + install -d $(lib_tmp)/usr/share/doc/$(LIB) + install -m 644 debian/copyright $(lib_tmp)/usr/share/doc/$(LIB) + install -m 644 debian/changelog $(lib_tmp)/usr/share/doc/$(LIB) + gzip -n -9 $(lib_tmp)/usr/share/doc/$(LIB)/changelog + install -d $(lib_tmp)/DEBIAN + install -m 755 debian/lib.postinst $(lib_tmp)/DEBIAN/postinst + install -m 755 debian/lib.prerm $(lib_tmp)/DEBIAN/prerm + touch $(lib_tmp)/usr/share/doc/README.Debian + #dpkg-shlibdeps $(lib_tmp)/usr/lib/libbaz.so.1.0 + install -m 755 debian/lib.shlibs $(lib_tmp)/DEBIAN/shlibs + install -m 755 debian/lib.symbols $(lib_tmp)/DEBIAN/symbols + dpkg-gencontrol -isp -p$(LIB) -P$(lib_tmp) + dpkg --build $(lib_tmp) .. + + # now the -dev package + install -d $(dev_tmp)/usr/include + install -d $(lib_tmp)/usr/lib + # let's also install the .so at the same time... (wrong, TODO) + cp -a *.a *.so.* $(lib_tmp)/usr/lib + # and fuck up permission (TODO) + chmod a+x $(lib_tmp)/usr/lib/*.a + # Pretend to be a Perl module to test a lack of Perl dependencies. + install -d $(dev_tmp)/$(VENDORARCH)/auto/Foo + install -m 644 libbaz2.so.1.0.3b $(dev_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + strip $(dev_tmp)/$(VENDORARCH)/auto/Foo/Foo.so + install -d $(dev_tmp)/usr/share/doc + ln -s $(LIB) $(dev_tmp)/usr/share/doc/$(DEV) + install -d $(dev_tmp)/DEBIAN + install -m 755 debian/dev.postinst $(dev_tmp)/DEBIAN/postinst + install -m 755 debian/dev.prerm $(dev_tmp)/DEBIAN/prerm + dpkg-gencontrol -isp -p$(DEV) -P$(dev_tmp) + dpkg --build $(dev_tmp) .. + + +binary: binary-arch + +# The mention of binary-indep here should be sufficient to suppress the +# warning that it's not present. +.PHONY: build-arch build-indep build binary-arch binary-indep binary clean diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/source.lintian-overrides b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/source.lintian-overrides new file mode 100644 index 0000000..6008d27 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/debian/source.lintian-overrides @@ -0,0 +1 @@ +libbaz source: maintainer-script-lacks-debhelper-token diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/fill-values b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/fill-values new file mode 100644 index 0000000..7effe4f --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/fill-values @@ -0,0 +1,6 @@ +Skeleton: upload-non-native +Testname: legacy-libbaz +Source: libbaz +Version: 1-1 +Default-Build-Depends: debhelper (>= 9.20151004~) +Description: Legacy test "libbaz" diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/Makefile new file mode 100644 index 0000000..657dc2a --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/Makefile @@ -0,0 +1,55 @@ +# This is the correct way to build a lib + +CC=gcc +CFLAGS=-g -Wall -Winline -O2 +LDFLAGS=-Wl,--no-as-needed + +OBJS=baz.o extra.o +SHOBJS=baz.sho extra.sho +NOPICOBJS = $(SHOBJS) + +all: libbaz1.a libbaz2.a libbaz1.so.1.0.3b libbaz2.so libbaz3.so.1.0.3b \ + libbaz.so + +libbaz2.so: libbaz2.so.1.0 + ln -sf $^ $@ +libbaz2.so.1.0: libbaz2.so.1.0.3b + ln -sf $^ $@ + +# Oops, forget the soname altogether +libbaz1.so.1.0.3b: $(NOPICOBJS) + $(CC) $(LDFLAGS) -o $@ -shared $^ -lc + +libbaz2.so.1.0.3b: $(SHOBJS) + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libbaz2.so.1.0 $^ -lc + +# Non-PIC. We can't test this on all architectures +libbaz3.so.1.0.3b: $(NOPICOBJS) + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libbaz3.so.1 $^ -lc + +# Non-versioned SONAME. +libbaz.so: $(SHOBJS) + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,libbaz.so $^ -lc + +#%.o-noreentrant: %.c +# $(CC) $(LDFLAGS) $(CFLAGS) -o $@ -c $< + +%.sho: %.c + $(CC) $(LDFLAGS) $(CFLAGS) -D_REENTRANT -fPIC -o $@ -c $< + +%.o: %.c + $(CC) $(LDFLAGS) $(CFLAGS) -D_REENTRANT -o $@ -c $< + +libbaz2.a: $(OBJS) + ar cq $@ $(OBJS) + strip --strip-unneeded --remove-section=.comment \ + --remove-section=-note $@ + ranlib $@ + +# The pic one in the .a (wrong), no archive table +libbaz1.a: $(SHOBJS) + ar cqS $@ $^ + strip --strip-unneeded --remove-section=.comment \ + --remove-section=-note $@ +clean: + rm -f *.a *.o *.so* *.sho diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/baz.c b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/baz.c new file mode 100644 index 0000000..4d5fc45 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/baz.c @@ -0,0 +1,6 @@ +#include <math.h> + +double pw(double p) +{ + return exp(p); +} diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/extra.c b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/extra.c new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/build-spec/orig/extra.c diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/desc b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/desc new file mode 100644 index 0000000..201d68d --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/desc @@ -0,0 +1,2 @@ +Testname: legacy-libbaz +Check: libraries/shared/trigger/ldconfig diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/hints b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/hints new file mode 100644 index 0000000..2e33583 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/hints @@ -0,0 +1 @@ +libbaz1 (binary): lacks-ldconfig-trigger usr/lib/libbaz.so usr/lib/libbaz3.so.1.0.3b usr/lib/libfoo2.so.1.0.3b diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/post-test b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/post-test new file mode 100755 index 0000000..29dc3f4 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/legacy-libbaz/eval/post-test @@ -0,0 +1,4 @@ +/: hardening-.*/ d +s/\(current is ([0-9]+\.)+[0-9]\)/(current is CURRENT)/ +s,usr/lib/([^\/]*/)?perl[0-9]*(/[0-9]*\.[0-9]*)?/,usr/lib/ma-dir/perl/version/,g +/: file-references-package-build-path / d diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.install b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.install new file mode 100644 index 0000000..fe6951d --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.install @@ -0,0 +1,2 @@ +app usr/lib/app + diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.postinst b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.postinst new file mode 100755 index 0000000..3e67b7e --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.postinst @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +ldconfig + +#DEBHELPER# diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.postrm b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.postrm new file mode 100755 index 0000000..eaeb28d --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.postrm @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +if [ "$1" = remove ] ; then ldconfig ; fi + +#DEBHELPER# diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.triggers b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.triggers new file mode 100644 index 0000000..dd86603 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/app.triggers @@ -0,0 +1 @@ +activate-noawait ldconfig diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/compat.in b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/compat.in new file mode 100644 index 0000000..640a566 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/compat.in @@ -0,0 +1 @@ +[% $dh_compat_level %] diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/control.in b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/control.in new file mode 100644 index 0000000..9960ee9 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/control.in @@ -0,0 +1,47 @@ +Source: [% $source %] +Priority: optional +Section: libs +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Build-Depends: [% $build_depends %] +Rules-Requires-Root: no + +Package: libfoo1 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] (missing ldc) + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + . + Checks for missing ldconfig in scripts. + +Package: libfish1 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] (preinst/rm ldc) + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + . + Checks for ldconfig in preinst/prerm scripts. + +Package: libuns1 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] (unsafe ldc) + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + . + Checks for unsafe ldconfig usage scripts. + +Package: app +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: [% $description %] (useless ldc) + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. + . + Checks for useless ldconfig usage in scripts. diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.install b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.install new file mode 100644 index 0000000..b1c4ec9 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.install @@ -0,0 +1 @@ +usr/lib/libfish* diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.preinst b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.preinst new file mode 100755 index 0000000..3e67b7e --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.preinst @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +ldconfig + +#DEBHELPER# diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.prerm b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.prerm new file mode 100755 index 0000000..3e67b7e --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.prerm @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +ldconfig + +#DEBHELPER# diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.symbols b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.symbols new file mode 100644 index 0000000..2c5a075 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfish1.symbols @@ -0,0 +1,3 @@ +libfish.so.1 libfish1 #MINVER# + e@Base 1.0 + energy@Base 0.9 diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.install b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.install new file mode 100644 index 0000000..f3a3a05 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.install @@ -0,0 +1 @@ +usr/lib/libfoo* diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.postinst b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.postinst new file mode 100755 index 0000000..2615bf9 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.postinst @@ -0,0 +1,8 @@ +#!/bin/sh +set -e + +# No ldconfig +if false ; then true ; fi + +# -- we will remove all debhelper stuff later. +#DEBHELPER# diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.postrm b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.postrm new file mode 100755 index 0000000..9b2f636 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.postrm @@ -0,0 +1,8 @@ +#!/bin/sh +set -e + +if false ; then true ; fi + + +# -- we will remove all debhelper stuff later. +#DEBHELPER# diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.symbols b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.symbols new file mode 100644 index 0000000..a1f052b --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libfoo1.symbols @@ -0,0 +1,3 @@ +libfoo.so.1 libfoo1 #MINVER# + e@Base 1.0 + energy@Base 0.9 diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.install b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.install new file mode 100644 index 0000000..b91d5ff --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.install @@ -0,0 +1 @@ +usr/lib/libuns* diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.postrm b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.postrm new file mode 100755 index 0000000..acc5d15 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.postrm @@ -0,0 +1,8 @@ +#!/bin/sh +set -e + +ldconfig + + +# -- we will remove all debhelper stuff later. +#DEBHELPER# diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.symbols b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.symbols new file mode 100644 index 0000000..d91149f --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/libuns1.symbols @@ -0,0 +1,3 @@ +libuns.so.1 libuns1 #MINVER# + e@Base 1.0 + energy@Base 0.9 diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/rules b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/rules new file mode 100755 index 0000000..b1c71a9 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/debian/rules @@ -0,0 +1,21 @@ +#!/usr/bin/make -f + +export DEB_BUILD_MAINT_OPTIONS=hardening=+all + +%: + dh $@ + +override_dh_builddeb: + for P in $$(dh_listpackages) ; do \ + for S in postinst postrm preinst prerm ; do \ + if [ -f debian/$${P}.$${S} ] ; then \ + cp -af debian/$${P}.$${S} debian/$${P}/DEBIAN/$${S} ; \ + chmod 0755 debian/$${P}/DEBIAN/$${S} ; \ + sed -i '/#DEBHELPER#/ d' debian/$${P}/DEBIAN/$${S} ; \ + fi ; \ + done ; \ + done + # Work around debhelper adding triggers instead of explicit + # ldconfig calls + rm -f debian/libfoo1/DEBIAN/triggers + dh_builddeb diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/fill-values b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/fill-values new file mode 100644 index 0000000..2159596 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/fill-values @@ -0,0 +1,5 @@ +Skeleton: upload-native +Testname: shared-libs-ldconfig-scripts +Default-Build-Depends: debhelper (>= 9.20151004~) +Dh-Compat-Level: 9 +Description: Test checks related to ldconfig in scripts diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/Makefile b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/Makefile new file mode 100644 index 0000000..4d3c286 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/Makefile @@ -0,0 +1,22 @@ +CC=gcc +CFLAGS+= -fPIC + +SONAMES:= libfoo.so.1 libfish.so.1 libuns.so.1 +LIBFILES:= $(patsubst %,%.0.1, $(SONAMES)) + +all: $(LIBFILES) + +$(LIBFILES): code.o + $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(patsubst %.0.1,%,$@) $^ -lm + +clean: + rm -f *.a *.o *.so* + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0644 *.so* $(DESTDIR)/usr/lib + for FILE in $(SONAMES) ; do \ + ln -s $${FILE}.0.1 $(DESTDIR)/usr/lib/$$FILE ; \ + done + +.PHONY: install clean diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/app b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/app new file mode 100755 index 0000000..04f1961 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/app @@ -0,0 +1,2 @@ +#!/bin/sh +echo Hello World diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/code.c b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/code.c new file mode 100644 index 0000000..0ed08e0 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/build-spec/orig/code.c @@ -0,0 +1,15 @@ +#include <stdlib.h> +#include <math.h> + +double e(void (*f)(char *)){ + char tmp[10]; + double x; + f(tmp); + x = atof(tmp); + return exp(x); +} + +double energy(double mass){ + return pow(10.0, 8.0) * pow(3.0, 2.0) * mass; +} + diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/eval/desc b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/eval/desc new file mode 100644 index 0000000..a55b281 --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/eval/desc @@ -0,0 +1,2 @@ +Testname: shared-libs-ldconfig-scripts +Check: libraries/shared/trigger/ldconfig diff --git a/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/eval/hints b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/eval/hints new file mode 100644 index 0000000..92986ce --- /dev/null +++ b/t/recipes/checks/libraries/shared/trigger/ldconfig/shared-libs-ldconfig-scripts/eval/hints @@ -0,0 +1,2 @@ +libfoo1 (binary): lacks-ldconfig-trigger usr/lib/libfoo.so.1.0.1 +app (binary): package-has-unnecessary-activation-of-ldconfig-trigger diff --git a/t/recipes/checks/libraries/static/binaries-static-lib/build-spec/debian/control.in b/t/recipes/checks/libraries/static/binaries-static-lib/build-spec/debian/control.in new file mode 100644 index 0000000..b4e0958 --- /dev/null +++ b/t/recipes/checks/libraries/static/binaries-static-lib/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: libfoo-dev +Architecture: [% $package_architecture %] +Section: libdevel +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/libraries/static/binaries-static-lib/build-spec/debian/rules b/t/recipes/checks/libraries/static/binaries-static-lib/build-spec/debian/rules new file mode 100644 index 0000000..3a30bc0 --- /dev/null +++ b/t/recipes/checks/libraries/static/binaries-static-lib/build-spec/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_strip: + # Don't strip :) diff --git a/t/recipes/checks/libraries/static/binaries-static-lib/build-spec/fill-values b/t/recipes/checks/libraries/static/binaries-static-lib/build-spec/fill-values new file mode 100644 index 0000000..0968380 --- /dev/null +++ b/t/recipes/checks/libraries/static/binaries-static-lib/build-spec/fill-values @@ -0,0 +1,4 @@ +Testname: binaries-static-lib +Package-Architecture: any +Skeleton: upload-non-native +Description: Test checks related to static libs diff --git a/t/recipes/checks/libraries/static/binaries-static-lib/build-spec/orig/Makefile b/t/recipes/checks/libraries/static/binaries-static-lib/build-spec/orig/Makefile new file mode 100644 index 0000000..c6d2401 --- /dev/null +++ b/t/recipes/checks/libraries/static/binaries-static-lib/build-spec/orig/Makefile @@ -0,0 +1,31 @@ +CC=gcc +CFLAGS+= -g +LIBFILES:= libfoo.a libbar.a + +all: $(LIBFILES) + +libfoo.a: code.o other.o + ar rcs -o $@ $^ + +pstripped.o: other.o + cp other.o pstripped.o + strip --strip-unneeded pstripped.o + +fstripped.o: other.o + cp other.o fstripped.o + strip --strip-unneeded --remove-section=.comment \ + --remove-section=.note fstripped.o + +libbar.a: fstripped.o pstripped.o + ar rcs -o $@ $^ + +clean: + rm -f *.a *.o + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0755 -d $(DESTDIR)/usr/include + install -m 0644 *.a $(DESTDIR)/usr/lib + install -m 0644 code.h $(DESTDIR)/usr/include + +.PHONY: install clean diff --git a/t/recipes/checks/libraries/static/binaries-static-lib/build-spec/orig/code.c b/t/recipes/checks/libraries/static/binaries-static-lib/build-spec/orig/code.c new file mode 100644 index 0000000..7bba112 --- /dev/null +++ b/t/recipes/checks/libraries/static/binaries-static-lib/build-spec/orig/code.c @@ -0,0 +1,13 @@ +#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); +} + + diff --git a/t/recipes/checks/libraries/static/binaries-static-lib/build-spec/orig/code.h b/t/recipes/checks/libraries/static/binaries-static-lib/build-spec/orig/code.h new file mode 100644 index 0000000..570beae --- /dev/null +++ b/t/recipes/checks/libraries/static/binaries-static-lib/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/libraries/static/binaries-static-lib/build-spec/orig/other.c b/t/recipes/checks/libraries/static/binaries-static-lib/build-spec/orig/other.c new file mode 100644 index 0000000..153aace --- /dev/null +++ b/t/recipes/checks/libraries/static/binaries-static-lib/build-spec/orig/other.c @@ -0,0 +1,6 @@ +#include "code.h" +#include <math.h> + +double energy(double mass){ + return pow(10.0, 8.0) * pow(3.0, 2.0) * mass; +} diff --git a/t/recipes/checks/libraries/static/binaries-static-lib/eval/desc b/t/recipes/checks/libraries/static/binaries-static-lib/eval/desc new file mode 100644 index 0000000..4fa1456 --- /dev/null +++ b/t/recipes/checks/libraries/static/binaries-static-lib/eval/desc @@ -0,0 +1,2 @@ +Testname: binaries-static-lib +Check: libraries/static diff --git a/t/recipes/checks/libraries/static/binaries-static-lib/eval/hints b/t/recipes/checks/libraries/static/binaries-static-lib/eval/hints new file mode 100644 index 0000000..62dfcf3 --- /dev/null +++ b/t/recipes/checks/libraries/static/binaries-static-lib/eval/hints @@ -0,0 +1,2 @@ +libfoo-dev (binary): unstripped-static-library (code.o other.o) [usr/lib/libfoo.a] +libfoo-dev (binary): static-library-has-unneeded-sections (pstripped.o) .comment [usr/lib/libbar.a] diff --git a/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/build-spec/debian/control.in b/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/build-spec/debian/control.in new file mode 100644 index 0000000..b4e0958 --- /dev/null +++ b/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/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: libfoo-dev +Architecture: [% $package_architecture %] +Section: libdevel +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/libraries/static/link-time-optimization/with-fat-lto-objects/build-spec/debian/rules b/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/build-spec/debian/rules new file mode 100644 index 0000000..3a30bc0 --- /dev/null +++ b/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/build-spec/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_strip: + # Don't strip :) diff --git a/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/build-spec/fill-values b/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/build-spec/fill-values new file mode 100644 index 0000000..7dad5a8 --- /dev/null +++ b/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/build-spec/fill-values @@ -0,0 +1,4 @@ +Testname: with-fat-lto-objects +Package-Architecture: any +Skeleton: upload-non-native +Description: Static library built with -flto=auto and with -ffat-lto-objects diff --git a/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/build-spec/orig/Makefile b/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/build-spec/orig/Makefile new file mode 100644 index 0000000..61335ab --- /dev/null +++ b/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/build-spec/orig/Makefile @@ -0,0 +1,17 @@ +CC=gcc +CFLAGS+= -g -flto=auto -ffat-lto-objects +LIBFILES:= libcodeless.a + +all: $(LIBFILES) + +libcodeless.a: code.o + ar rcs -o $@ $^ + +clean: + rm -f *.a *.o + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0644 *.a $(DESTDIR)/usr/lib + +.PHONY: install clean diff --git a/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/build-spec/orig/code.c b/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/build-spec/orig/code.c new file mode 100644 index 0000000..7bba112 --- /dev/null +++ b/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/build-spec/orig/code.c @@ -0,0 +1,13 @@ +#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); +} + + diff --git a/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/build-spec/orig/code.h b/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/build-spec/orig/code.h new file mode 100644 index 0000000..570beae --- /dev/null +++ b/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/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/libraries/static/link-time-optimization/with-fat-lto-objects/eval/desc b/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/eval/desc new file mode 100644 index 0000000..5a20d7f --- /dev/null +++ b/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/eval/desc @@ -0,0 +1,4 @@ +Testname: with-fat-lto-objects +Check: libraries/static/link-time-optimization +See-Also: + Bug#963057 diff --git a/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/eval/hints b/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/eval/hints new file mode 100644 index 0000000..33c3dd9 --- /dev/null +++ b/t/recipes/checks/libraries/static/link-time-optimization/with-fat-lto-objects/eval/hints @@ -0,0 +1 @@ +libfoo-dev (binary): static-link-time-optimization code.o [usr/lib/libcodeless.a] diff --git a/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/build-spec/debian/control.in b/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/build-spec/debian/control.in new file mode 100644 index 0000000..b4e0958 --- /dev/null +++ b/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/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: libfoo-dev +Architecture: [% $package_architecture %] +Section: libdevel +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/libraries/static/link-time-optimization/without-fat-lto-objects/build-spec/debian/rules b/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/build-spec/debian/rules new file mode 100644 index 0000000..3a30bc0 --- /dev/null +++ b/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/build-spec/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_strip: + # Don't strip :) diff --git a/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/build-spec/fill-values b/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/build-spec/fill-values new file mode 100644 index 0000000..ff04e62 --- /dev/null +++ b/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/build-spec/fill-values @@ -0,0 +1,4 @@ +Testname: without-fat-lto-objects +Package-Architecture: any +Skeleton: upload-non-native +Description: Static library built with -flto=auto, but without -ffat-lto-objects diff --git a/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/build-spec/orig/Makefile b/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/build-spec/orig/Makefile new file mode 100644 index 0000000..6b1fa78 --- /dev/null +++ b/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/build-spec/orig/Makefile @@ -0,0 +1,17 @@ +CC=gcc +CFLAGS+= -g -flto=auto +LIBFILES:= libcodeless.a + +all: $(LIBFILES) + +libcodeless.a: code.o + ar rcs -o $@ $^ + +clean: + rm -f *.a *.o + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0644 *.a $(DESTDIR)/usr/lib + +.PHONY: install clean diff --git a/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/build-spec/orig/code.c b/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/build-spec/orig/code.c new file mode 100644 index 0000000..7bba112 --- /dev/null +++ b/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/build-spec/orig/code.c @@ -0,0 +1,13 @@ +#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); +} + + diff --git a/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/build-spec/orig/code.h b/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/build-spec/orig/code.h new file mode 100644 index 0000000..570beae --- /dev/null +++ b/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/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/libraries/static/link-time-optimization/without-fat-lto-objects/eval/desc b/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/eval/desc new file mode 100644 index 0000000..a71a4f2 --- /dev/null +++ b/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/eval/desc @@ -0,0 +1,4 @@ +Testname: without-fat-lto-objects +Check: libraries/static/link-time-optimization +See-Also: + Bug#963057 diff --git a/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/eval/hints b/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/eval/hints new file mode 100644 index 0000000..33c3dd9 --- /dev/null +++ b/t/recipes/checks/libraries/static/link-time-optimization/without-fat-lto-objects/eval/hints @@ -0,0 +1 @@ +libfoo-dev (binary): static-link-time-optimization code.o [usr/lib/libcodeless.a] diff --git a/t/recipes/checks/libraries/static/name/underscore-s-suffix/build-spec/fill-values b/t/recipes/checks/libraries/static/name/underscore-s-suffix/build-spec/fill-values new file mode 100644 index 0000000..0284acb --- /dev/null +++ b/t/recipes/checks/libraries/static/name/underscore-s-suffix/build-spec/fill-values @@ -0,0 +1,4 @@ +Testname: underscore-s-suffix +Package-Architecture: any +Skeleton: upload-non-native +Description: Static library installed with _s.a suffix diff --git a/t/recipes/checks/libraries/static/name/underscore-s-suffix/build-spec/orig/Makefile b/t/recipes/checks/libraries/static/name/underscore-s-suffix/build-spec/orig/Makefile new file mode 100644 index 0000000..6545dde --- /dev/null +++ b/t/recipes/checks/libraries/static/name/underscore-s-suffix/build-spec/orig/Makefile @@ -0,0 +1,17 @@ +CC=gcc +CFLAGS+= -g +LIBFILES:= librealname_s.a + +all: $(LIBFILES) + +librealname_s.a: code.o + ar rcs -o $@ $^ + +clean: + rm -f *.a *.o + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0644 *.a $(DESTDIR)/usr/lib + +.PHONY: install clean diff --git a/t/recipes/checks/libraries/static/name/underscore-s-suffix/build-spec/orig/code.c b/t/recipes/checks/libraries/static/name/underscore-s-suffix/build-spec/orig/code.c new file mode 100644 index 0000000..7bba112 --- /dev/null +++ b/t/recipes/checks/libraries/static/name/underscore-s-suffix/build-spec/orig/code.c @@ -0,0 +1,13 @@ +#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); +} + + diff --git a/t/recipes/checks/libraries/static/name/underscore-s-suffix/build-spec/orig/code.h b/t/recipes/checks/libraries/static/name/underscore-s-suffix/build-spec/orig/code.h new file mode 100644 index 0000000..570beae --- /dev/null +++ b/t/recipes/checks/libraries/static/name/underscore-s-suffix/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/libraries/static/name/underscore-s-suffix/build-spec/orig/other.c b/t/recipes/checks/libraries/static/name/underscore-s-suffix/build-spec/orig/other.c new file mode 100644 index 0000000..153aace --- /dev/null +++ b/t/recipes/checks/libraries/static/name/underscore-s-suffix/build-spec/orig/other.c @@ -0,0 +1,6 @@ +#include "code.h" +#include <math.h> + +double energy(double mass){ + return pow(10.0, 8.0) * pow(3.0, 2.0) * mass; +} diff --git a/t/recipes/checks/libraries/static/name/underscore-s-suffix/eval/desc b/t/recipes/checks/libraries/static/name/underscore-s-suffix/eval/desc new file mode 100644 index 0000000..8bb948f --- /dev/null +++ b/t/recipes/checks/libraries/static/name/underscore-s-suffix/eval/desc @@ -0,0 +1,4 @@ +Testname: underscore-s-suffix +Check: libraries/static/name +See-Also: + Debian Bug#698398 diff --git a/t/recipes/checks/libraries/static/name/underscore-s-suffix/eval/hints b/t/recipes/checks/libraries/static/name/underscore-s-suffix/eval/hints new file mode 100644 index 0000000..61ad390 --- /dev/null +++ b/t/recipes/checks/libraries/static/name/underscore-s-suffix/eval/hints @@ -0,0 +1 @@ +underscore-s-suffix (binary): odd-static-library-name [usr/lib/librealname_s.a] diff --git a/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/build-spec/debian/control.in b/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/build-spec/debian/control.in new file mode 100644 index 0000000..b4e0958 --- /dev/null +++ b/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/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: libfoo-dev +Architecture: [% $package_architecture %] +Section: libdevel +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/libraries/static/no-code/with-fat-lto-objects/build-spec/debian/rules b/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/build-spec/debian/rules new file mode 100644 index 0000000..3a30bc0 --- /dev/null +++ b/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/build-spec/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_strip: + # Don't strip :) diff --git a/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/build-spec/fill-values b/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/build-spec/fill-values new file mode 100644 index 0000000..7dad5a8 --- /dev/null +++ b/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/build-spec/fill-values @@ -0,0 +1,4 @@ +Testname: with-fat-lto-objects +Package-Architecture: any +Skeleton: upload-non-native +Description: Static library built with -flto=auto and with -ffat-lto-objects diff --git a/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/build-spec/orig/Makefile b/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/build-spec/orig/Makefile new file mode 100644 index 0000000..61335ab --- /dev/null +++ b/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/build-spec/orig/Makefile @@ -0,0 +1,17 @@ +CC=gcc +CFLAGS+= -g -flto=auto -ffat-lto-objects +LIBFILES:= libcodeless.a + +all: $(LIBFILES) + +libcodeless.a: code.o + ar rcs -o $@ $^ + +clean: + rm -f *.a *.o + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0644 *.a $(DESTDIR)/usr/lib + +.PHONY: install clean diff --git a/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/build-spec/orig/code.c b/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/build-spec/orig/code.c new file mode 100644 index 0000000..7bba112 --- /dev/null +++ b/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/build-spec/orig/code.c @@ -0,0 +1,13 @@ +#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); +} + + diff --git a/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/build-spec/orig/code.h b/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/build-spec/orig/code.h new file mode 100644 index 0000000..570beae --- /dev/null +++ b/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/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/libraries/static/no-code/with-fat-lto-objects/eval/desc b/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/eval/desc new file mode 100644 index 0000000..23eef5e --- /dev/null +++ b/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/eval/desc @@ -0,0 +1,6 @@ +Testname: with-fat-lto-objects +Check: libraries/static/no-code +Test-Against: + no-code-sections +See-Also: + Bug#977596 diff --git a/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/eval/hints b/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/eval/hints new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/t/recipes/checks/libraries/static/no-code/with-fat-lto-objects/eval/hints @@ -0,0 +1 @@ + diff --git a/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/build-spec/debian/control.in b/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/build-spec/debian/control.in new file mode 100644 index 0000000..b4e0958 --- /dev/null +++ b/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/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: libfoo-dev +Architecture: [% $package_architecture %] +Section: libdevel +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/libraries/static/no-code/without-fat-lto-objects/build-spec/debian/rules b/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/build-spec/debian/rules new file mode 100644 index 0000000..3a30bc0 --- /dev/null +++ b/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/build-spec/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_strip: + # Don't strip :) diff --git a/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/build-spec/fill-values b/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/build-spec/fill-values new file mode 100644 index 0000000..ff04e62 --- /dev/null +++ b/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/build-spec/fill-values @@ -0,0 +1,4 @@ +Testname: without-fat-lto-objects +Package-Architecture: any +Skeleton: upload-non-native +Description: Static library built with -flto=auto, but without -ffat-lto-objects diff --git a/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/build-spec/orig/Makefile b/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/build-spec/orig/Makefile new file mode 100644 index 0000000..6b1fa78 --- /dev/null +++ b/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/build-spec/orig/Makefile @@ -0,0 +1,17 @@ +CC=gcc +CFLAGS+= -g -flto=auto +LIBFILES:= libcodeless.a + +all: $(LIBFILES) + +libcodeless.a: code.o + ar rcs -o $@ $^ + +clean: + rm -f *.a *.o + +install: all + install -m 0755 -d $(DESTDIR)/usr/lib + install -m 0644 *.a $(DESTDIR)/usr/lib + +.PHONY: install clean diff --git a/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/build-spec/orig/code.c b/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/build-spec/orig/code.c new file mode 100644 index 0000000..7bba112 --- /dev/null +++ b/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/build-spec/orig/code.c @@ -0,0 +1,13 @@ +#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); +} + + diff --git a/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/build-spec/orig/code.h b/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/build-spec/orig/code.h new file mode 100644 index 0000000..570beae --- /dev/null +++ b/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/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/libraries/static/no-code/without-fat-lto-objects/eval/desc b/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/eval/desc new file mode 100644 index 0000000..3bc8ecb --- /dev/null +++ b/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/eval/desc @@ -0,0 +1,4 @@ +Testname: without-fat-lto-objects +Check: libraries/static/no-code +See-Also: + Bug#977596 diff --git a/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/eval/hints b/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/eval/hints new file mode 100644 index 0000000..19a13e1 --- /dev/null +++ b/t/recipes/checks/libraries/static/no-code/without-fat-lto-objects/eval/hints @@ -0,0 +1 @@ +libfoo-dev (binary): no-code-sections [usr/lib/libcodeless.a] |