#!/usr/bin/make -f

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- \
	    --with-pam \
	    --with-mantype=man \
	    --with-maildir=/var/mail \
	    --with-privsep-path=/var/lib/opensmtpd/empty \
	    --with-privsep-user=opensmtpd \
	    --with-queue-user=opensmtpq \
	    --enable-table-db \
	    --with-ca-file=/etc/ssl/certs/ca-certificates.crt

override_dh_fixperms:
	dh_fixperms
	chmod 711 debian/opensmtpd/var/spool/smtpd
	# OpenSMTPD needs the offline mail queue (for messages sent locally,
	# e.g., via /usr/sbin/sendmail) to be 1777
	chmod 1777 debian/opensmtpd/var/spool/smtpd/offline
