#!/usr/bin/make -f
# -*- makefile -*-

#export DH_VERBOSE=1

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

%:
	dh $@ 

override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_BUILD_TYPE=RELWITHDEBINFO \
		-DENABLE_OPENSSL=ON \
		-DENABLE_SYSTEMD=ON \
		-DENABLE_LIBSODIUM=ON \
		-DENABLE_LTO=OFF \
		-DCMAKE_AR=/usr/bin/ar \
		-DCMAKE_RANLIB=/usr/bin/ranlib \
		-DCMAKE_NM=/usr/bin/nm

#override_dh_strip:
#	dh_strip --dbg-package=fastd-dbg

override_dh_install:
	dh_install
	install -dm755 $(CURDIR)/debian/fastd/etc/fastd
	sed -e 's/fastd@/fastd/g' doc/examples/fastd@.service > $(CURDIR)/debian/fastd/lib/systemd/system/fastd.service

override_dh_installinit:
	dh_installinit --no-start -- defaults 16 80

override_dh_clean:
	dh_clean
	rm -rf obj*
