#!/usr/bin/make -f
%:
	dh $@

override_dh_installman:
	mkdir -p $(CURDIR)/debian/postgrey/usr/share/man/man8/
	mkdir -p $(CURDIR)/debian/postgrey/usr/share/man/man1/
	pod2man --section=8 postgrey \
		> $(CURDIR)/debian/postgrey/usr/share/man/man8/postgrey.8
	pod2man --section=8 policy-test \
		> $(CURDIR)/debian/postgrey/usr/share/man/man8/policy-test.8
	pod2man --section=1 contrib/postgreyreport \
		> $(CURDIR)/debian/postgrey/usr/share/man/man1/postgreyreport.1

override_dh_install:
	dh_install
	mv $(CURDIR)/debian/postgrey/usr/share/postgrey/postgrey_whitelist_clients \
	   $(CURDIR)/debian/postgrey/usr/share/postgrey/whitelist_clients
	mv $(CURDIR)/debian/postgrey/usr/share/postgrey/postgrey_whitelist_recipients \
	   $(CURDIR)/debian/postgrey/usr/share/postgrey/whitelist_recipients
#
## dh_make-originated rules file
## ©2004,2005 Adrian von Bidder
## Distribute and/or modify at will.
#
## Uncomment this to turn on verbose mode.
##export DH_VERBOSE=1
#
#include /usr/share/quilt/quilt.make
#
## installation base directory
#BASE=$(CURDIR)/debian/postgrey
#
#build: build-stamp
#
#build-stamp: $(QUILT_STAMPFN)
#	touch $@
#
#clean: unpatch
#	dh_testdir
#	dh_testroot
#	rm -f build-stamp
#	dh_clean
#
#install: build
#	dh_testdir
#	dh_testroot
#	dh_prep
#	dh_installdirs etc/postgrey
#
#	# for lack of an upstream Makefile
#	install -D postgrey $(BASE)/usr/sbin/postgrey
#	install -D policy-test $(BASE)/usr/sbin/policy-test
#	install -D contrib/postgreyreport $(BASE)/usr/bin/postgreyreport
#	install -m 0644 -D postgrey_whitelist_clients \
#		$(BASE)/usr/share/postgrey/whitelist_clients
#	install -m 0644 -D postgrey_whitelist_recipients \
#		$(BASE)/usr/share/postgrey/whitelist_recipients
#	install -m 0644 -D debian/postgrey-default \
#		$(BASE)/usr/share/postgrey/postgrey-default
#	install -m 0644 -D debian/postgrey_whitelist_clients.md5sum \
#		$(BASE)/usr/share/postgrey/whitelist_clients.md5sum
#	install -m 0644 -D debian/postgrey_whitelist_recipients.md5sum \
#		$(BASE)/usr/share/postgrey/whitelist_recipients.md5sum
#	install -m 0644 -D debian/postgrey-default.md5sum \
#		$(BASE)/usr/share/postgrey/postgrey-default.md5sum
#	mkdir -p $(BASE)/usr/share/man/man1
#	mkdir -p $(BASE)/usr/share/man/man8
#
## Build architecture-dependent files here.
#binary-arch: build install
## arch:all package!
#
## Build architecture-dependent files here.
#binary-indep: build install
#	dh_testdir
#	dh_testroot
#	dh_installchangelogs Changes
#	dh_installlogcheck
#	dh_installdocs contrib/postgrey_clients_dump README.exim
#	dh_installdebconf
#	dh_installinit -- defaults 19
#	dh_compress
#	dh_fixperms
#	dh_installdeb
#	dh_gencontrol
#	dh_md5sums
#	dh_builddeb
#
#binary: binary-indep binary-arch
#.PHONY: build clean binary-indep binary-arch binary install
