#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

%:
	dh $@

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
CONFIGURE_ARGS = --enable-unit-tests
else
CONFIGURE_ARGS = --disable-unit-tests
endif

override_dh_auto_configure:
	dh_auto_configure -- --with-selinux $(CONFIGURE_ARGS)

# tests are known to pass only on the listed architectures
# They used to pass on arm(el,hf) where mocking is broken now.
ifeq (,$(filter amd64 arm64 i386 mipsel s390x x32,$(DEB_HOST_ARCH)))
override_dh_auto_test:
	-dh_auto_test
endif
