#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/maven.mk

JAVA_HOME := /usr/lib/jvm/default-java

DEB_MAVEN_INSTALL_TO_USJ := false
PACKAGE   := jenkins-winstone
JAR       := winstone

JETTY_VERSION := $(shell dpkg-query -f '$${source:Version}' --show libjetty8-java)
DEB_DH_GENCONTROL_ARGS_ALL := -- -Vjetty8:Version=${JETTY_VERSION}

# Run mh_installjar to ensure USJ name matches package
# and does not conflict with any pure winstone packaged
# sometime in the future
install/lib$(PACKAGE)-java::
	mh_installpom -plib$(PACKAGE)-java dependency-reduced-pom.xml
	mh_installjar -plib$(PACKAGE)-java --usj-name=$(PACKAGE) -l pom.xml target/$(JAR)-$(DEB_UPSTREAM_VERSION).jar
	jh_classpath -plib$(PACKAGE)-java

clean::
	rm -f dependency-reduced-pom.xml

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