#!/usr/bin/make -f

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

%:
	dh $@ --with gir,gnome

override_dh_makeshlibs:
	dh_makeshlibs -- -c4

override_dh_missing:
	dh_missing --fail-missing

# This is needed to keep notification-daemon out of Ubuntu main
# since germinate (?) doesn't handle alternate virtual depends well
# Something like this might be safe for Debian too but why bother if it's not needed?
# gnome-shell isn't currently available on s390x so don't recommend either dependency there
# i386 is partial arch
override_dh_gencontrol:
ifneq ($(shell dpkg-vendor --query vendor),Ubuntu)
	dh_gencontrol -- -Vnotification-daemon:Recommends='notification-daemon'
else
ifeq (,$(filter i386 s390x,$(DEB_HOST_ARCH)))
	dh_gencontrol -- -Vnotification-daemon:Recommends='gnome-shell | notification-daemon'
else
	dh_gencontrol
endif
endif
