#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2003-2006 Jonas Smedegaard <dr@jones.dk>

include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/rules/debhelper.mk

# suppress optional build-dependencies
CDBS_BUILD_DEPENDS_rules_utils_copyright-check =

DEB_INSTALL_DIRS_pop-before-smtp     = var/lib/pop-before-smtp
DEB_INSTALL_DOCS_pop-before-smtp    += contrib/README.rootless-install contrib/README.QUICKSTART
DEB_INSTALL_MANPAGES_pop-before-smtp = debian/pop-before-smtp.8
DEB_INSTALL_EXAMPLES_pop-before-smtp = contrib/popa3d/* contrib/pat-tester contrib/popauth.m4

destdir  = $(CURDIR)/debian/pop-before-smtp
date    := $(shell head -1 ChangeLog | cut -c 1-10)

common-build-indep::
	/usr/bin/pod2man --section 8 --date $(date) --release $(DEB_UPSTREAM_VERSION) pop-before-smtp > debian/pop-before-smtp.8

binary-post-install/pop-before-smtp::
	mv $(destdir)/etc/pop-before-smtp/pop-before-smtp-conf.pl $(destdir)/etc/pop-before-smtp/pop-before-smtp.conf

clean::
	rm -f debian/pop-before-smtp.8
