#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#DH_VERBOSE = 1

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

export LC_ALL := en_US.UTF-8
export LANG := en_US.UTF-8

%:
	dh $@ --parallel

override_dh_auto_configure:
#	if [ -e src/zxcvbn/ ]; then rm -r src/zxcvbn/ ; fi
	dh_auto_configure -- \
		-DCMAKE_BUILD_TYPE=Release \
		-DKEEPASSXC_BUILD_TYPE=Release \
		-DWITH_TESTS=ON \
		-DWITH_GUI_TESTS=OFF  \
		-DWITH_XC_ALL=ON \
		-DWITH_XC_UPDATECHECK=OFF

override_dh_auto_test:
	env
	dh_auto_test -- ARGS+="-E 'test(cli|gui)'"
#	# testcli and testgui use X, and have horrible X clipboard tests that
#	# randomly fail, so ignore failures
#	xvfb-run -a --server-args="-screen 0 800x600x24" dh_auto_test -- ARGS+="-R 'test(cli|gui)'" || true

override_dh_makeshlibs:
	# keepassx only ships plugins
	dh_makeshlibs -X/usr/lib/$(DEB_HOST_MULTIARCH)/keepassxc
