#! /usr/bin/make -f
#
# debian/rules for checkpassword-pam package
#

# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1

# debhelper compatibility version to use
export DH_COMPAT=2

.PHONY: configure
configure: configure-stamp
configure-stamp:
	dh_testdir
	./configure --prefix=/usr --mandir=/usr/share/man
	touch $@

.PHONY: build
build: configure-stamp build-stamp
build-stamp:
	dh_testdir

	$(MAKE)

	touch $@

.PHONY: clean
clean:
	dh_testdir
	dh_testroot

	rm -f configure-stamp build-stamp

	-$(MAKE) distclean

	dh_clean


.PHONY: install
install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	$(MAKE) DESTDIR=`pwd`/debian/tmp install


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

.PHONY: binary-arch
binary-arch:
	dh_testdir
	dh_testroot
	dh_movefiles
	dh_install
	dh_installdocs
	dh_installman
	gzip -9frq `pwd`/debian/checkpassword-pam/usr/share/man/
	dh_installchangelogs NEWS
	dh_strip
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

.PHONY:
binary: binary-indep binary-arch
