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

# libgrdpcsc is dlopened by OpenSC (provider_library), never linked.
# No header, no .pc, so the linker symlink has no consumer.
execute_after_dh_auto_install:
	rm debian/gnome-remote-desktop/usr/lib/$(DEB_HOST_MULTIARCH)/libgrdpcsc.so

# 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:
	dh_auto_test

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

override_dh_installsystemd:
	dh_installsystemd --no-enable

# Skip. We only use dh_gnome for dh_translations for Ubuntu
override_dh_gnome:
