#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# These configure/build flags can be modified by a vendor-specific
# Makefile snippet. See debian/vendors/100ubuntu.mk for an example.
dhflags = --with runit
confflags = --with-systemd

# Incude vendor specific configuration. The vendor files have to be created
# so their order respects the taxonomy of the downstream distributions.
include debian/vendors/*.mk

%:
	dh $@ $(dhflags)

override_dh_auto_configure:
	dh_auto_configure -- $(confflags)

execute_before_dh_installsystemd:
	# Treat '/path/to/irqbalance.env' in the upstream service file as a
	# template and substitute it, rather than handling it with a patch.
	#
	# Write the modified file to debian/ so that dh_installsystemd will
	# choose its placement according the Debian standards and conventions.
	sed 's|/path/to/irqbalance.env|/etc/default/irqbalance|' < misc/irqbalance.service > debian/irqbalance.service
