#!/usr/bin/make -f
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

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

%:
	dh $@ --with gir,gnome

# Some tests hang on Launchpad builders on s390x
override_dh_autoreconf:
ifeq (yes,$(shell dpkg-vendor --is Ubuntu && echo yes))
ifneq (,$(filter $(DEB_HOST_ARCH),s390x))
	sed -i -e '/^TESTS/s/\$$(PY_TESTS)//' -e '/^TESTS/s/\$$(VALA_TESTS)//' \
		 libsecret/Makefile.am
endif
endif
	dh_autoreconf --as-needed

override_dh_install:
	find debian/tmp -name '*.la' -print -delete
	dh_install

override_dh_missing:
	dh_missing --fail-missing

override_dh_makeshlibs:
	dh_makeshlibs -- -c4

override_dh_auto_test:
ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	env -u LD_PRELOAD dbus-run-session -- make check
endif
