#!/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

# The tmpfiles postinst must be before the sysusers postinst
execute_after_dh_installtmpfiles:
	dh_installsysusers
	dh_installtmpfiles

override_dh_installsysusers:

ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),armhf s390x))
    TESTS_CAN_FAIL=true
else
    TESTS_CAN_FAIL=false
endif

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

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

override_dh_gnome_clean:
