#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

testsuite_failing_archs := mipsel powerpc
ifneq (,$(filter $(DEB_HOST_ARCH),$(testsuite_failing_archs)))
  fail_param := || true
endif

%:
	dh $@ --with kf5

override_dh_auto_configure:
	dh_auto_configure -Skf5 -- -DBUILD_KF5=ON

override_dh_auto_test:
	xvfb-run -a dh_auto_test $(fail_param)

execute_after_dh_auto_install:
	# drop translations of unbuilt components
	rm debian/tmp/usr/share/locale/*/LC_MESSAGES/umbrello_kdevphp.mo
	rm debian/tmp/usr/share/locale/*/LC_MESSAGES/umbrello_kdevphp5.mo
	find debian/tmp/usr/share/locale/*/LC_MESSAGES -type d -empty -delete
	find debian/tmp/usr/share/locale/* -type d -empty -delete
