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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
include /usr/share/dpkg/default.mk
export LC_ALL=C.UTF-8
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
else
JSON_SIMPLE_PACKAGE = org.json.simple
endif
%:
dh $@ --with javahelper
override_dh_auto_configure:
# Creating the directories for forester and jcolorbrewer, with symlinks.
mkdir -p biojava-forester/src/main/java/
cp -a forester/org biojava-forester/src/main/java/
mkdir -p biojava-jcolorbrewer/src/main/java/
cp -a jcolorbrewer/org biojava-jcolorbrewer/src/main/java/
# Putting the pom.xml files of forester and jcolorbrewer into their dirs.
sed 's/\(VERSION_PACKAGE\)/\1$(DEB_VERSION_UPSTREAM)/; s/VERSION_PACKAGE\(.*\)+dfsg[0-9]*/\1/' debian/poms/pomForester.xml > biojava-forester/pom.xml
sed 's/\(VERSION_PACKAGE\)/\1$(DEB_VERSION_UPSTREAM)/; s/VERSION_PACKAGE\(.*\)+dfsg[0-9]*/\1/' debian/poms/pomJcolorbrewer.xml > biojava-jcolorbrewer/pom.xml
dh_auto_configure
override_dh_auto_build:
# Insert the correct JSON_SIMPLE_PACKAGE in the code.
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),' \
{} \; -print
dh_auto_build
override_dh_installdocs:
dh_installdocs
# Deleting calls to urchinTracker to enhance privacy.
for F in $$(find . -name "*.html"); do \
sed -i 's/^<div.*urchinTracker.*div>$$//' $$F; \
done
override_dh_clean:
dh_clean
rm -rf target
rm -rf biojava-*/target
find . -type f -name \*.java.json-simple \
-exec sh -c 'file={} && mv $$file $${file%.json-simple}' \; -print
rm -rf biojava-forester
rm -rf biojava-jcolorbrewer
|