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

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

CMAKE_EXTRA_FLAGS :=
CMAKE_EXTRA_FLAGS += -DENABLE_OPENSSL=ON
CMAKE_EXTRA_FLAGS += -DENABLE_SYSTEMD=ON
CMAKE_EXTRA_FLAGS += -DENABLE_LIBSODIUM=ON
CMAKE_EXTRA_FLAGS += -DENABLE_LTO=ON

binary binary-arch binary-indep build build-arch build-indep clean install install-arch install-indep:
	dh $@ --with sphinxdoc

override_dh_auto_build:
	dh_auto_build
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	$(MAKE) -C doc html
endif

override_dh_auto_configure:
	dh_auto_configure -- $(CMAKE_EXTRA_FLAGS)

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

.PHONY: binary binary-arch binary-indep build build-arch build-indep clean install install-arch install-indep \
	override_dh_auto_build override_dh_auto_configure override_dh_installinit
