#!/usr/bin/make -f

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

PACKAGE              := $(DEB_SOURCE_PACKAGE)
VERSION              := $(DEB_UPSTREAM_VERSION)
JAVA_HOME            := /usr/lib/jvm/java-6-openjdk
DEB_JARS             := ant-nodeps maven-core maven-model maven-plugin-api maven-project file-management plexus-utils plexus-container-default-alpha
DEB_ANT_BUILD_TARGET := package #javadoc
DEB_ANT_BUILDFILE    := debian/build.xml
DEB_ANT_ARGS         := -Dpackage=$(PACKAGE) -Dversion=$(VERSION)
API_DOCS             := target/api

get-orig-source:
	-uscan --download-version $(DEB_UPSTREAM_VERSION) --force-download --rename

binary-post-install/lib$(PACKAGE)-java::
	mh_installpoms -plib$(PACKAGE)-java
	mh_installjar -plib$(PACKAGE)-java -l surefire-api/pom.xml surefire-api/target/surefire-api-$(VERSION).jar
	mh_installjar -plib$(PACKAGE)-java -l surefire-booter/pom.xml surefire-booter/target/surefire-booter-$(VERSION).jar
	mh_installjar -plib$(PACKAGE)-java -l surefire-providers/surefire-junit/pom.xml surefire-providers/surefire-junit/target/surefire-junit-$(VERSION).jar
	mh_installjar -plib$(PACKAGE)-java -l surefire-providers/surefire-junit4/pom.xml surefire-providers/surefire-junit4/target/surefire-junit4-$(VERSION).jar
	mh_installjar -plib$(PACKAGE)-java -l surefire-providers/surefire-testng/pom.xml surefire-providers/surefire-testng/target/surefire-testng-$(VERSION).jar
	mh_installjar -plib$(PACKAGE)-java -l maven-surefire-plugin/pom.xml maven-surefire-plugin/target/maven-surefire-plugin-$(VERSION).jar
	mh_installjar -plib$(PACKAGE)-java -l maven-surefire-report-plugin/pom.xml maven-surefire-report-plugin/target/maven-surefire-report-plugin-$(VERSION).jar

clean::
	-rm -rf debian/tmp
