#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# see FEATURE AREAS in dpkg-buildflags(1)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
export QT_SELECT := 5

# Force aligned access to fix FTBFS / Bus Error on armhf
export DEB_CFLAGS_MAINT_APPEND = -mno-unaligned-access

# Skip tests on the archs they are known to be flaky
testskip_architectures := powerpc armhf

include /usr/share/dpkg/architecture.mk

override_dh_install:
	rm -rf debian/*/usr/tests
	dh_install

override_dh_missing:
	dh_missing --fail-missing

override_dh_auto_test:
ifneq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(testskip_architectures)))
	QT_QPA_PLATFORM=minimal LD_LIBRARY_PATH=../src GSETTINGS_BACKEND=memory GSETTINGS_SCHEMA_DIR=. xvfb-run -a dh_auto_test
endif

override_dh_makeshlibs:
	# passed to dpkg-gensymbols
	dh_makeshlibs -- -c4

%:
	dh $@ --with pkgkde_symbolshelper
