#!/usr/bin/make -f

include /usr/share/dpkg/default.mk

%:
	dh $@

# Configuration arguments
CONFIG_ARGS = -Dpam=true -Dpam_modules_dir=/usr/lib/$(DEB_HOST_MULTIARCH)/security
BUILDDIR = $(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)

ifeq ($(DEB_HOST_ARCH_OS),linux)
	CONFIG_ARGS += -Dsystemd_system_unit_dir=/usr/lib/systemd/system
else
	CONFIG_ARGS += -Dsystemd=false
endif

ifneq (,$(filter fprintd-doc,$(shell dh_listpackages)))
	CONFIG_ARGS += -Dgtk_doc=true
endif

override_dh_auto_configure:
	dh_auto_configure -- $(CONFIG_ARGS)

override_dh_auto_test:
	# FIXME: PAM suite should not be skipped but tests pass upstream.
	dh_auto_test -- -C $(BUILDDIR) --print-errorlogs --timeout-multiplier 5 \
		--no-suite PAM
