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

version = 2.1.0

configure: configure-stamp

configure-stamp:
	dh_testdir
	mh_patchpom -plibcanl-java -k pom.xml
	touch $@

build: build-arch build-indep

build-arch:

build-indep: build-stamp

build-stamp: configure-stamp
	dh_testdir
	mvn-debian package
	touch $@

clean:
	dh_testdir
	dh_testroot

	rm -rf target

	[ -r pom.xml.save ] && mv pom.xml.save pom.xml || :

	rm -f build-stamp configure-stamp

	mh_clean
	dh_clean

install: build-stamp
	dh_testdir
	dh_testroot
	dh_prep

binary: binary-arch binary-indep

binary-arch:

binary-indep: install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installchangelogs
	mh_installjar -plibcanl-java pom.xml -l target/canl-$(version).jar
	mh_installpom -plibcanl-java pom.xml
	dh_link
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

.PHONY: build build-arch build-indep binary binary-arch binary-indep clean configure install
