#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- -Dtests=true

override_dh_install:
	dh_install -XXFONT.txt -XTERMINUS.txt

execute_after_dh_auto_test:
	# make sure we do not forget to drop the override when packaging
	# the next upstream  version which can run the testsuite natively
	# from the buildsystem.
	if test -e tests/meson.build ; then \
		echo update debian/rules ; false ;  fi
	cd tests && \
		env HOME=$(shell mktemp -d) \
		./run_tests.sh -v -t ../*/src/bin/tytest \
		-s /bin/bash --debug
