#! /usr/bin/make -f

include /usr/share/dpkg/default.mk

export DEB_CPPFLAGS_MAINT_APPEND := -I/usr/include/PCSC

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		-DLIB_SUFFIX=/$(DEB_HOST_MULTIARCH) \
		-DRELEASE_BUILD=1 \
		-DYUBIHSM_INSTALL_PKGCONFIG_DIR=/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig

override_dh_auto_test:
	# Tests require a real YubiHSM 2 device.
	:

execute_after_dh_auto_install:
	# Remove unnecessary RPATH tags.
	chrpath -d \
		debian/tmp/usr/bin/* \
		debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.so* \
		debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkcs11/*.so*
