#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk

# Disable fixfilepath, as it triggers build failures.
export DEB_BUILD_MAINT_OPTIONS = reproducible=-fixfilepath

ifeq ($(DEB_HOST_ARCH_CPU),i386)
  export DEB_CXXFLAGS_MAINT_APPEND = -ffloat-store
endif

testsuite_failing_archs := ia64 sparc64
ifneq (,$(filter $(DEB_HOST_ARCH),$(testsuite_failing_archs)))
  fail_param := || true
endif

%:
	dh $@ --with pkgkde_symbolshelper

override_dh_auto_configure:
	dh_auto_configure -- -DBUILD_TESTS=ON -DLIB_SUFFIX="/$(DEB_HOST_MULTIARCH)"

execute_after_dh_auto_build-arch:
	pod2man debian/dh/dh_grantlee > dh_grantlee.1

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