#!/usr/bin/make -f
export JAVA_HOME=/usr/lib/jvm/default-java
export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog --count 1 -SDate)" +%s)
PKD := $(abspath $(dir $(MAKEFILE_LIST)))
DEB_UPSTREAM_VERSION := $(shell dpkg-parsechangelog -l$(PKD)/changelog -SVersion | cut -d- -f1)

%:
	dh $@ --buildsystem=ant

override_dh_auto_build:
	dh_auto_build -- \
		-Dprefix=$(CURDIR)/debian/libcortado-java/usr \
		-Dbuild.type=stripped \
		-Dreal_version=$(DEB_UPSTREAM_VERSION) \
		-DDATE=$(shell date -u -d @$(SOURCE_DATE_EPOCH) +"%Y-%m-%d") \
		install_applet

override_dh_auto_clean:
	dh_auto_clean -- distclean

get-orig-source::
	uscan --download-current-version --force-download --rename
