summaryrefslogtreecommitdiffstats
path: root/t/recipes/checks/languages/java/java-class-format/build-spec/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 't/recipes/checks/languages/java/java-class-format/build-spec/debian/rules')
-rwxr-xr-xt/recipes/checks/languages/java/java-class-format/build-spec/debian/rules19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/recipes/checks/languages/java/java-class-format/build-spec/debian/rules b/t/recipes/checks/languages/java/java-class-format/build-spec/debian/rules
new file mode 100755
index 0000000..7e46dd0
--- /dev/null
+++ b/t/recipes/checks/languages/java/java-class-format/build-spec/debian/rules
@@ -0,0 +1,19 @@
+#!/usr/bin/make -f
+%:
+ dh $@ --with javahelper
+
+override_jh_build:
+ jh_build --javacopts='-target 1.7' --javacopts='-source 1.7'
+ unzip test.jar
+ # Unknown class version
+ perl -i -pe 's/^(\xCA\xFE\xBA\xBE...)./$$1\x2A/' org/debian/lintian/TestA.class
+ # Java19 (unsupported)
+ perl -i -pe 's/^(\xCA\xFE\xBA\xBE...)./$$1\x3F/' org/debian/lintian/TestB.class
+ # Put them in separate Jars because Lintian stops when the first
+ # "unknown class format" is seen
+ zip -r testa.jar META-INF/ org/debian/lintian/TestA.class
+ zip -r testb.jar META-INF/ org/debian/lintian/TestB.class
+
+override_dh_auto_clean:
+ rm -fr META-INF/ org/
+ rm -f *.jar