#!/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/default-java
DEB_JARS             := ant-optional $(ANT_HOME)/lib/ant-launcher.jar
DEB_ANT_BUILD_TARGET := jar
DEB_ANT_CLEAN_TARGET :=

# Additional command-line arguments for Ant
ANT_ARGS             := -Dcompile.optimize=false -propertyfile debian/ant.properties 

#ANT_ARGS             := -Dbuild.sysclasspath=first -Dj2ee.jar=/usr/share/java/servlet-api.jar

binary-post-install/$(PACKAGE)::
	mh_installpoms -p$(PACKAGE)
	mh_installjar -p$(PACKAGE) -l --usj-name=itext1 debian/pom.xml build/bin/iText.jar

clean::
	dh_testdir
	dh_testroot
	-rm -rf build
	-rm -rf debian/tmp
	mh_clean

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

get-orig-pom:
	-wget -O debian/pom.xml http://repo1.maven.org/maven2/com/lowagie/itext/$(VERSION)/itext-$(VERSION).pom

