#!/usr/bin/make -f

include /usr/share/dpkg/default.mk

export LC_ALL=C.UTF-8

%:
	dh $@ --with javahelper --with maven_repo_helper

override_dh_clean:
	dh_clean
	# Removing our handmade pom.
	$(RM) pom.xml

override_dh_auto_configure:
	# Placing pom.xml at root, with a hack to put the package version number
	# inside the pom.
	sed 's/\(VERSION_PACKAGE\)/\1$(DEB_VERSION_UPSTREAM)/; s/VERSION_PACKAGE\(.*\)+dfsg[0-9]*/\1/' debian/pom.xml > pom.xml
	dh_auto_configure

override_dh_installexamples:
	dh_installexamples
	# Providing an example at startup instead of having to load it from the Internet.
	cp examples/exampleFile_2_7.jar debian/$(DEB_SOURCE)/usr/share/doc/jalview/examples/exampleFile_2_7.jvp

override_dh_fixperms:
	# Setting the packaged example file as not executable.
	chmod a-x debian/$(DEB_SOURCE)/usr/share/doc/jalview/examples/uniref50.fa
	dh_fixperms
