#!/usr/bin/make -f

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

# Ensure that we link against all needed libraries (cf. Policy 10.2)
export DEB_LDFLAGS_MAINT_APPEND=-Wl,-z,defs

%:
	dh $@

# Explicit BASHPATH fixes reproducible build on merged-usr vs non-merged:
override_dh_auto_configure:
	dh_auto_configure -- \
	    BASHPATH=/bin/bash \
	    ac_cv_prog_GROFF="" \
	    --with-initconfigdir=/etc/default \
	    --with-systemddir=/lib/systemd/system \
	    --enable-systemd

override_dh_auto_install:
	dh_auto_install
# we don't need the upstream license
	rm debian/tmp/usr/share/doc/corosync-qdevice/LICENSE
# install sysconfig files
	install -D -m 644 init/corosync-qdevice.sysconfig.example debian/tmp/etc/default/corosync-qdevice
	install -D -m 644 init/corosync-qnetd.sysconfig.example debian/tmp/etc/default/corosync-qnetd

override_dh_installsystemd:
	dh_installsystemd -p corosync-qdevice --no-enable --no-start
	dh_installsystemd --remaining-packages

# dh_dwz fails with "Too few files for multifile optimization", so:
override_dh_dwz:
