#!/usr/bin/make -f

export JAVA_HOME=/usr/lib/jvm/default-java
export CLASSPATH=/usr/share/java/jansi-native.jar:/usr/share/java/hawtjni-runtime.jar

%:
	dh --with javahelper --with maven-repo-helper $@

override_dh_auto_build:
	jh_build jansi.jar src/main/java

override_dh_auto_clean:
	dh_auto_clean
	ant -f debian/build.xml clean

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	ant -f debian/build.xml test
endif

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