#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

TESTS_HOME=$(CURDIR)/debian/tests.home

override_dh_auto_configure:
	dh_auto_configure -- -DBUILD_TESTING=OFF

execute_after_dh_auto_install:
	# TODO: talk to usptream about getting these not installed. they are not used.
	rm -rf debian/kdepim-runtime/usr/share/dbus-1/interfaces/
	# At the end, remove empty directories
	find debian/kdepim-runtime -type d -empty -delete
override_dh_auto_test:
	# Disable dh_auto_test at build time (they are utterly broken)
	:
#ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
#	mkdir -p "$(TESTS_HOME)"
#	HOME=$(TESTS_HOME) xvfb-run -a --server-args="-screen 0 1024x768x24" dbus-run-session debian/testsuite.xsession
#	rm -rf "$(TESTS_HOME)"
#endif
