1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#!/usr/bin/make -f
export JAVA_HOME := /usr/lib/jvm/default-java
JSON_SIMPLE_VERSION = $(shell dpkg -l libjson-simple-java | grep '^ii' | awk '{print $$3}')
JSON_SIMPLE_3 = $(shell dpkg --compare-versions '$(JSON_SIMPLE_VERSION)' '>' '3.1.1-1~' && echo yes || echo no)
ifeq (yes,$(JSON_SIMPLE_3))
JSON_SIMPLE_PACKAGE = com.github.cliftonlabs.json_simple
JSON_EXCEPTION = JsonException
JSON_SIMPLE_MAVEN = com.github.cliftonlabs
else
JSON_SIMPLE_PACKAGE = org.json.simple
JSON_EXCEPTION = DeserializationException
JSON_SIMPLE_MAVEN = com.googlecode.json-simple
endif
%:
dh $@ --buildsystem=maven
debian/maven.rules: debian/maven.rules.in
sed 's/@JSON_SIMPLE_MAVEN@/$(JSON_SIMPLE_MAVEN)/' $< >$@
execute_after_dh_auto_clean:
find . -type f -name \*.java.json-simple \
-exec sh -c 'file={} && mv $$file $${file%.json-simple}' \; -print
override_dh_auto_configure: debian/maven.rules
dh_auto_configure
execute_before_dh_auto_build:
find . -type f -name \*.java -exec grep -q 'import @JSON_SIMPLE_PACKAGE@' {} \; \
-exec sed -i.json-simple \
-e 's,@JSON_SIMPLE_PACKAGE@,$(JSON_SIMPLE_PACKAGE),' \
-e 's/@JSON_EXCEPTION@/$(JSON_EXCEPTION)/' \
{} \; -print
execute_before_dh_gencontrol:
sed -i '/^maven:CompileDepends.*/d' debian/*substvars
|