#!/usr/bin/make -f
# debian/rules for commons-vfs

PACKAGE := $(shell dpkg-parsechangelog | grep '^Source:' | cut -f 2 -d ' ')
VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ' | cut -d: -f2- | sed 's/-[^-]*$$//')

export JAVA_HOME=/usr/lib/jvm/default-java
export CLASSPATH=$(shell for jar in `cat debian/build-classpath`; do if [ -f "$$jar" ]; then echo -n "$${jar}:"; fi; done)
export ANT_ARGS=-Dbasedir=$(realpath .)/core -Dpackage=$(PACKAGE) \
    -Dversion=$(VERSION) -Dbin.package=lib$(PACKAGE)-java \
    -Dpom.file=$(realpath .)/core/pom.xml -Ddebian.dir=$(realpath .)/debian \
    -propertyfile debian/build.properties \
    -f debian/build.xml

%:
	dh $@ --buildsystem=ant --with maven_repo_helper

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