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

include debian/config/systemd.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# https://perl-team.pages.debian.net/debhelper.html#Occasionally_Useful
PACKAGE = $(shell dh_listpackages)
TMP     = $(CURDIR)/debian/$(PACKAGE)

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- $(confflags)

override_dh_install:
	dh_install
	# Treat '/path/to/irqbalance.env' in the upstream service file as a
	# template and substitute it, rather than handling it with a patch.
	sed -Ei 's|/path/to/irqbalance.env|/etc/default/irqbalance|' $(TMP)/lib/systemd/system/irqbalance.service
