#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/ant.mk

JAVA_HOME            := /usr/lib/jvm/default-java
DEB_JARS             := ant-junit ant-junit4
ANT_ARGS             := -Dskip.download=true

PACKAGE := $(DEB_SOURCE_PACKAGE)

DEB_INSTALL_CHANGELOGS_ALL := RELEASE-NOTES.txt

DEB_ANT_CLEAN_TARGET := clean
DEB_ANT_BUILD_TARGET := jar javadoc
DEB_ANT_CHECK_TARGET := test

# Per Debian Java Policy, install a versioned JAR and an unversioned symlink
binary-post-install/lib$(PACKAGE)-java::
	mh_installpoms -plib$(PACKAGE)-java
	mh_installjar -plib$(PACKAGE)-java -l pom.xml target/$(PACKAGE)-$(DEB_UPSTREAM_VERSION).jar

install/lib$(PACKAGE)-java-doc::
	mv target/apidocs target/api

clean::
	mh_clean
	-rm -rf debian/tmp

get-orig-source:
	uscan --force-download --rename
