#!/usr/bin/make -f
# SPDX-License-Identifier: GPL-3.0-or-later

# see FEATURE AREAS in dpkg-buildflags(1)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic -fno-omit-frame-pointer
# package maintainers to append LDFLAGS
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk


%:
	dh $@ --buildsystem=meson

override_dh_auto_configure:
	dh_auto_configure -- \
		--buildtype=plain \
		--prefix=/usr \
		--libdir=lib \
		-Ddoc=enabled \
		-Dsystemd_files=enabled \
		-Dclient=enabled \
		-Ddnstap=enabled \
		-Dkeyfile_default=/usr/share/dns/root.key \
		-Droot_hints=/usr/share/dns/root.hints \
		-Dinstall_kresd_conf=enabled \
		-Dunit_tests=enabled \
		-Dmalloc=jemalloc \

override_dh_auto_build:
	dh_auto_build -- doc
	dh_auto_build
