#!/usr/bin/make -f

%:
	dh $@ --with javahelper 

override_dh_auto_build:
	ant jars
	ant javadocs

override_dh_auto_test:
	ant test -Djava.awt.headless=True

get-orig-source:
	svn export https://github.com/Starlink/starjava/trunk/array starjava-array ; \
	wget -nv https://github.com/Starlink/starjava/raw/master/LICENSE.txt -P starjava-array ; \
	VERSION=`xmllint --xpath '//project/property[@name="version"]/@value' starjava-array/build.xml | cut -d\" -f2| tr - .` ; \
	DATE=`stat -c %y starjava-array/src/main/uk/ac/starlink/array/*.java | cut -c-10 | sort|uniq|tail -1| tr - .`; \
	tar cf starjava-array_$$VERSION+$$DATE.orig.tar starjava-array ; \
	rm -rf starjava-array ; \
	xz starjava-array_$$VERSION+$$DATE.orig.tar
