#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1

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

# see ENVIRONMENT in dpkg-buildflags(1)
export DEB_CFLAGS_MAINT_APPEND  = -std=gnu17 -fno-strict-aliasing 

PACKAGE = argus-client

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

%:
	dh ${@} 

override_dh_auto_configure:
	touch .threads
	dh_auto_configure -- --with-libmaxminddb 

override_dh_autoreconf:
	# don't do this

override_dh_auto_install:
	# done by dh_install

override_dh_install:
	dh_install
	rm -rf debian/$(PACKAGE)/usr/share/doc/argus-clients-*

override_dh_installexamples:
	dh_installexamples
	chmod -x debian/$(PACKAGE)/usr/share/doc/argus-client/examples/Config/racolor.conf
	gzip debian/$(PACKAGE)/usr/share/doc/argus-client/examples/Config/delegated-ipv4-latest

override_dh_installsystemd:
	# Do not start/enable by default on purpose.
	# The user should start it only after making sure the configuration is
	# appropriate for his/her computer.
	dh_installsystemd --no-enable --no-start --name radium
	dh_installsystemd --no-enable --no-start --name rastream
