#!/usr/bin/make -f

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

%:
	dh $@ --with javahelper

override_dh_auto_build:
	ant -Djsf.build.home=$$(pwd)
	ant -f debian/build.xml injectionprovider
	# build command is run twice because in the first run jsf-api.jar
	# has some classes missing and they are included in the 2nd run.
	ant -Djsf.build.home=$$(pwd)
	ant -f debian/build.xml javadoc

override_dh_auto_clean:
	-ant -Djsf.build.home=$$(pwd) clean

override_dh_clean:
	dh_clean -X.glassfish.orig

get-orig-source:
	cd $(dir $(firstword $(MAKEFILE_LIST)))../ && \
	uscan \
		--verbose \
		--no-symlink \
		--destdir $(CURDIR)      \
		--watchfile debian/watch \
		--force-download
