#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

UPVER=$(shell dpkg-parsechangelog | grep ^Version | cut -d' ' -f2 | cut -d- -f1)

SKIPTEST=false
ifneq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
    SKIPTEST=true
endif

%:
	dh $@ \
		--with javahelper

override_dh_auto_build:
	mh_patchpom --no-parent -posmosis-plugin-borderextract pom.xml
	mvn -o -s /etc/maven2/settings-debian.xml \
	    -Dmaven.test.skip=$(SKIPTEST) package

override_dh_install:
	install -D -m644 target/borderextract-debian.jar \
		debian/osmosis-plugin-borderextract/usr/share/osmosis/osmosis-plugin-borderextract.jar

override_dh_auto_clean:
	dh_auto_clean
	mh_unpatchpoms -posmosis-plugin-borderextract -v
	-rm -rf target/
