summaryrefslogtreecommitdiffstats
path: root/t/recipes/checks/libraries/static/binaries-static-lib
diff options
context:
space:
mode:
Diffstat (limited to 't/recipes/checks/libraries/static/binaries-static-lib')
-rw-r--r--t/recipes/checks/libraries/static/binaries-static-lib/build-spec/debian/control.in16
-rw-r--r--t/recipes/checks/libraries/static/binaries-static-lib/build-spec/debian/rules7
-rw-r--r--t/recipes/checks/libraries/static/binaries-static-lib/build-spec/fill-values4
-rw-r--r--t/recipes/checks/libraries/static/binaries-static-lib/build-spec/orig/Makefile31
-rw-r--r--t/recipes/checks/libraries/static/binaries-static-lib/build-spec/orig/code.c13
-rw-r--r--t/recipes/checks/libraries/static/binaries-static-lib/build-spec/orig/code.h8
-rw-r--r--t/recipes/checks/libraries/static/binaries-static-lib/build-spec/orig/other.c6
-rw-r--r--t/recipes/checks/libraries/static/binaries-static-lib/eval/desc2
-rw-r--r--t/recipes/checks/libraries/static/binaries-static-lib/eval/hints2
9 files changed, 89 insertions, 0 deletions
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]