#!/usr/bin/make -f
%:
	dh $@ --with javahelper

override_jh_build:
	jh_build
	unzip test.jar
	# Unknown class version
	perl -i -pe 's/^(\xCA\xFE\xBA\xBE...)./$$1\x2A/' org/debian/lintian/TestA.class
	# Java7 (unsupported)
	perl -i -pe 's/^(\xCA\xFE\xBA\xBE...)./$$1\x33/' 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
