#!/usr/bin/make -f

# DH_VERBOSE := 1

include /usr/share/dpkg/default.mk

export JAVA_HOME=/usr/lib/jvm/default-java
export LC_ALL=C.UTF-8

%:
	dh $@ --with javahelper

override_dh_auto_clean:
	dh_auto_clean
	# Removing the unit tests we copied into a subdirectory of src/test.
	if [ -e src/test/java/org ]; then \
	        $(RM) -rf src/test/java/org; \
	fi

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	# Moving the unit tests into a subdir of src/test so that Maven sees them.
	mkdir -p src/test/java/org/snpsift/testCases
	cp -a src/main/java/org/snpsift/testCases/unit src/test/java/org/snpsift/testCases
	dh_auto_test
endif
