#!/usr/bin/make -f

include /usr/share/dpkg/default.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1 -Wl,-z,defs

%:
	dh $@

# https://bugs.debian.org/981285
# https://launchpad.net/bugs/1977614
override_dh_auto_configure:
	dh_auto_configure -- \
		-Dfdk_aac=false \
		-Dtests=$(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),false,true)

# We manually handle tmpfiles & sysusers in postinst
# Remove these 2 empty overrides when postinst is dropped
override_dh_installtmpfiles:

override_dh_installsysusers:

override_dh_auto_test:
ifeq ($(shell dpkg-vendor --is Ubuntu && echo yes),yes)
	dh_auto_test
else
	dh_auto_test || true
endif

# https://launchpad.net/bugs/1973028
override_dh_installsystemduser:
	dh_installsystemduser --no-enable

override_dh_gnome_clean:
