#!/usr/bin/make -f

# DH_VERBOSE := 1

include /usr/share/dpkg/pkg-info.mk

%:
	dh $@ --buildsystem=gradle --with maven_repo_helper

override_dh_auto_clean:
	dh_auto_clean
	# Cleaning the custom pom file and transformed poms file
	-rm debian/libxgboost-predictor-java.poms
	-rm debian/pom.xml

override_dh_auto_configure:
	# Putting the version number in the custom pom and in the poms file to grasp
	# the built jar.
	sed 's/\(VERSION_PACKAGE\)/\1$(DEB_VERSION_UPSTREAM)/; s/VERSION_PACKAGE\(.*\)+dfsg[0-9]*/\1/' debian/libxgboost-predictor-java.poms.in > debian/libxgboost-predictor-java.poms
	sed 's/\(VERSION_PACKAGE\)/\1$(DEB_VERSION_UPSTREAM)/; s/VERSION_PACKAGE\(.*\)+dfsg[0-9]*/\1/' debian/pom.xml.in > debian/pom.xml
	dh_auto_configure
