#!/usr/bin/make -f

#export DH_VERBOSE=1

get-orig-source:
	@if [ -z "$(UPSTREAM_VERSION)" ]; then echo "Please run as .../debian/rules UPSTREAM_VERSION=xxx $@"; exit 1; fi
	wget -O "pam-python_$(UPSTREAM_VERSION).orig.tar.gz" "http://www.stuart.id.au/russell/files/pam_python/pam_python-$(UPSTREAM_VERSION).tar.gz"

configure: configure-stamp
configure-stamp:
	dh_testdir
	touch configure-stamp

build: configure-stamp build-stamp
build-stamp:
	dh_testdir
	$(MAKE)
	touch build-stamp

clean:
	dh_testdir
	$(MAKE) clean
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs lib/security
	dh_installdocs
	dh_installchangelogs ChangeLog.txt
	$(MAKE) DESTDIR=$(CURDIR)/debian/libpam-python DOCDIR=/usr/share/doc/libpam-python install

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch: build install
# We have nothing to do by default.

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