#!/usr/bin/make -f

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

ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
ENABLE_TESTS := -Dtests=all
else
ENABLE_TESTS := -Dtests=none
endif

ifeq ($(DEB_HOST_ARCH_OS),linux)
ENABLE_SELINUX := -Dselinux=true
else
ENABLE_SELINUX := -Dselinux=false
endif

ifeq ($(shell dpkg-vendor --is Ubuntu && echo yes), yes)
# Not in main repository
ENABLE_CLOUD += -Dcloudproviders=false
else
ENABLE_CLOUD += -Dcloudproviders=true
endif

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		-Ddocs=true \
		-Dpackagekit=true \
		$(ENABLE_TESTS) \
		$(ENABLE_CLOUD) \
		$(ENABLE_SELINUX)

override_dh_auto_test:
	touch $(CURDIR)/debian/.debhelper/generated/_source/home/.gtk-bookmarks
	GTK_A11Y=none dbus-run-session -- xvfb-run --auto-servernum dh_auto_test

override_dh_gnome_clean:
