#!/usr/bin/make -f

%:
	dh $@ --with javahelper,jh_maven_repo_helper

override_dh_auto_build:
	# build JNI library
	$(MAKE) -C jpathwatch-native/src -f ../../debian/Makefile.jni

override_jh_build:
	jh_build
	# generate OSGi metadata
	bnd wrap --properties debian/jpathwatch.bnd --output debian/jpathwatch.jar jpathwatch.jar

override_dh_auto_clean:
	$(MAKE) -C jpathwatch-native/src -f ../../debian/Makefile.jni clean

override_dh_clean:
	dh_clean
	$(RM) debian/jpathwatch.jar

override_dh_install-arch:
	dh_install -plibjpathwatch-java-jni jpathwatch-native/src/libjpathwatch-native.so \
		/usr/lib/$(DEB_HOST_MULTIARCH)/jni
	dh_install -a --remaining-packages

get-orig-source:
	debian/fetch-orig.sh

get-orig-pom:
	wget -O debian/pom.xml https://repo1.maven.org/maven2/net/sf/jpathwatch/jpathwatch/0.95/jpathwatch-0.95.pom
