#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules file for beast-mcmc
# Andreas Tille <tille@debian.org>
# GPL

#export DH_VERBOSE=1

JAVA_HOME  := /usr/lib/jvm/default-java

DEBJAR    := /usr/share/java
# This does not seem to have any effect at all.  The only way to add
# CLASSPATH relieably is editing build.xml
# CLASS_PATH := /usr/share/ant/lib/ant.jar:/usr/share/ant/lib/ant-launcher.jar:/usr/share/ant/lib/ant-nodeps.jar:/usr/share/ant/lib/ant-junit.jar:$(DEBJAR)/antlr4-runtime.jar:$(JAVA_HOME)/lib/tools.jar:$(DEBJAR)/beagle.jar:$(DEBJAR)/mpj.jar:$(DEBJAR)/org.boehn.kmlframework.jar:$(DEBJAR)/itext1-1.4.jar:$(DEBJAR)/junit4.jar:$(DEBJAR)/figtree.jar:$(DEBJAR)/colt.jar:$(DEBJAR)/fest-util.jar:$(DEBJAR)/options.jar:$(DEBJAR)/mtj.jar:$(DEBJAR)/jam.jar:$(DEBJAR)/jdom1.jar:$(DEBJAR)/jebl.jar:$(DEBJAR)/commons-math.jar:/usr/lib/R/site-library/rJava/jri/JRI.jar

# to run the test suite
JAVA       := $(JAVA_HOME)/bin/java
ANT_HOME   := /usr/share/ant
ANT_BIN    := $(ANT_HOME)/bin/ant
ANT_ARGS   := -Dcompile.debug=true -Dcompile.optimize=true

%:
	dh $@ --with javahelper

CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
PDFLATEX:=pdflatex -interaction=batchmode

override_dh_auto_build:
	# move tests requiring fest.swing out of the way
	mv src/test/beast/app/beauti debian/fest_swing_tests
	dh_auto_build
	mv debian/fest_swing_tests src/test/beast/app/beauti

override_dh_compress:
	dh_compress --exclude=.pdf
