#!/usr/bin/make -f

export JAVA_HOME=/usr/lib/jvm/default-java
PKGNAME := rsyntaxtextarea
LIBNAME := lib$(PKGNAME)-java
VERSION := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p')

%:
	dh --with javahelper $@

override_dh_auto_clean:
	dh_auto_clean
	mh_clean

override_dh_auto_install:
	dh_auto_install
	mh_installpom -p$(LIBNAME) -o --no-parent $(CURDIR)/debian/pom.xml
	mh_installjar -p$(LIBNAME) -l $(CURDIR)/debian/pom.xml $(CURDIR)/dist/$(PKGNAME).jar

get-orig-source:
	uscan --download-version $(VERSION) --force-download

get-orig-pom:
	wget -O debian/pom.xml http://repository.sonatype.org/service/local/repositories/central/content/com/fifesoft/$(PKGNAME)/$(VERSION)/$(PKGNAME)-$(VERSION).pom
