#!/usr/bin/make -f

export GOFLAGS = -buildvcs=false -trimpath

%:
	dh $@

# Fix the permissions for "/etc/icinga-notifications" set in the Makefile after dh_fixperms(1) has done its stuff.
override_dh_fixperms:
	dh_fixperms
	chmod -R o= debian/icinga-notifications/etc/icinga-notifications

# By default, dh_dwz(1) tries to optimise the DWARF information of binary files and libraries, which adds
# way too much build time overhead given that GO binaries do not need such optimisations. So override
# the dh_dwz processing step and make it a no-op by using a dummy command (true).
override_dh_dwz:
	true

# By default, dh_strip(1) automatically generates debug symbols for the executables which are not required
# for our GO binaries. So override the dh command and run dh_strip with the no-automatic-dbgsym flag set.
override_dh_strip:
	dh_strip --no-automatic-dbgsym

# By default, Debian will try to automatically start the systemd service right after installation in the postinst script.
# However, using the default DB config will always result in an error and Icinga Notifications will retry these errors
# for 5m before giving up and crashing, causing "deb-systemd-invoke" to timeout and abort the installation with an
# error. So override this section here and run it with the no-start flag set.
override_dh_installsystemd:
	dh_installsystemd --no-start
