#!/usr/bin/make -f

# DH_VERBOSE := 1

%:
	dh $@ --with javahelper
#
#override_dh_auto_clean:
#	rm -rf buildsupport/*
#	ln -s ../debian/buildsupport/build.xml buildsupport/build.xml
#	ln -s ../debian/buildsupport/gitant buildsupport/gitant
#	dh_auto_clean
#	rm -rf buildsupport/*
#
#override_dh_auto_configure:
#	dh_auto_configure
#	ln -s ../debian/buildsupport/build.xml buildsupport/build.xml
#	ln -s ../debian/buildsupport/gitant buildsupport/gitant

override_dh_auto_clean:
	dh_auto_clean
	$(RM) goby-distribution/test-data

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	# Create a symlink to the directory with test data for tests run from the
	# goby-distribution directory.
	ln -s ../test-data goby-distribution/test-data
	# Putting the JRI location in the path, as indicated in GobyRengine.java.
	# Also indicating R_HOME, as found in http://rforge.net/JRI/.
	export LD_LIBRARY_PATH="$$LD_LIBRARY_PATH:/usr/lib/R/site-library/rJava/jri" && \
	        export R_HOME="/usr/lib/R" && \
	        dh_auto_test
endif
