#!/usr/bin/make -f
# export DH_VERBOSE=1
PKD  = $(abspath $(dir $(MAKEFILE_LIST)))
VER ?= $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{^Version:\s*([\d\.]+)}')
export JAVA_HOME=/usr/lib/jvm/default-java
export CLASSPATH=/usr/share/java/jide-oss.jar:/usr/share/java/xmlgraphics-commons.jar

%:
	dh $@ --with javahelper,jh_maven_repo_helper

override_dh_auto_build:
	dh_auto_build --sourcedirectory=jchart2d

get-orig-source:
	uscan --verbose --repack --compression xz --force-download

get-orig-pom:
	# Maven uses a wrong version. The latest version is 3.2.2. This was
	# corrected in Debian's pom.xml file.
	wget -O debian/pom.xml \
	https://repo1.maven.org/maven2/net/sf/jchart2d/jchart2d/3.3.2/jchart2d-3.3.2.pom