#!/usr/bin/make -f

# export build flags
DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

%:
	dh $@ --buildsystem=cmake

override_dh_auto_configure:
	dh_auto_configure --buildsystem=cmake -- \
		-DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=ALWAYS \
		-DGENERATE_SRS_SECRET=0 -DCHROOT_DIR=/var/lib/postsrsd \
		-DUSE_APPARMOR=1 -DINIT_FLAVOR=systemd \
		-DPOSTSRSD_USER=postsrsd

override_dh_auto_test:
	dh_auto_test --buildsystem=cmake

override_dh_install:
	dh_install
	dh_apparmor --profile-name=usr.sbin.postsrsd
	install -m 0644 obj-$(DEB_HOST_GNU_TYPE)/postsrsd.conf debian/postsrsd/usr/share/postsrsd/postsrsd.template

override_dh_installinit:
