#!/usr/bin/make -f

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

DEB_BUILD_MAINT_OPTIONS = hardening=+all
DEB_CPPFLAGS_MAINT_APPEND = -D_XOPEN_SOURCE=600 -DNDEBUG
DPKG_EXPORT_BUILDFLAGS = 1
-include /usr/share/dpkg/buildflags.mk

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
	       --with-configdir=/etc/nsd		\
	       --with-nsd_conf_file=/etc/nsd/nsd.conf	\
	       --with-pidfile=/run/nsd/nsd.pid		\
	       --with-dbfile=/var/lib/nsd/nsd.db	\
	       --with-zonesdir=/etc/nsd			\
	       --with-xfrdfile=/var/lib/nsd/xfrd.state	\
	       --disable-largefile			\
	       --disable-recvmmsg			\
	       --enable-root-server			\
	       --enable-mmap				\
	       --enable-ratelimit			\
	       --enable-systemd				\
	       --enable-checking			\

override_dh_auto_install:
	dh_auto_install
	find $(CURDIR)/debian/nsd -type d -empty -delete

override_dh_install-arch:
	dh_install -a
	rm -f $(CURDIR)/debian/nsd/etc/nsd/nsd.conf.sample

override_dh_installchangelogs:
	dh_installchangelogs doc/ChangeLog

override_dh_missing:
	dh_missing --fail-missing
