#!/usr/bin/make -f
#
# debian/rules file to build upmethodology package.
#
# Created 23 Aug 2007, by Stephane Galland <galland@arakhne.org>

#export DH_VERBOSE=1

include /usr/share/cdbs/1/rules/buildvars.mk
include /usr/share/cdbs/1/rules/simple-patchsys.mk

top_dir      := $(shell pwd)
install_dir  := $(top_dir)/debian/tmp

build: build-stamp

configure-stamp: unpack-stamp
	dh_testdir
	touch $@

build-stamp: configure-stamp
	dh_testdir

	# Force updating of DebConf internationalization
	#cd ${top_dir}/debian && debconf-updatepo

	cd ${top_dir} && perl ./Makefile.PL "--prefix=${install_dir}/usr" compile

	touch $@

unpack-stamp:
	dh_testdir
	touch $@

binary-indep:
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdirs
	dh_install --sourcedir=debian/tmp --autodest
	dh_installdocs
	dh_installchangelogs
	dh_installman
	dh_link
	dh_installdebconf
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

install: install-stamp

install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_clean -k

	cd ${top_dir} && perl ./Makefile.PL --nobinlink "--prefix=${install_dir}/usr" install

	touch $@
clean::
	dh_testdir
	dh_testroot
	cd ${top_dir} && perl ./Makefile.PL clean
	${RM} *-stamp
	dh_clean


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

