#!/usr/bin/make -f

# Enable compiler hardening flags.
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# Ensure that we link against all needed libraries (cf. Policy 10.2)
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-z,defs

# The Shibboleth project decided to replace the C++ SP code with JAVA
# remoting, so substantial changes probably won't happen, see
# https://shibboleth.atlassian.net/wiki/spaces/DEV/pages/2981429255/Service+Provider+V4+Redesign
export DEB_CXXFLAGS_MAINT_APPEND = -Wno-deprecated-declarations

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
	    PTHREAD_CFLAGS=-pthread PTHREAD_LIBS=-lpthread \
	    --with-xmlsec

override_dh_auto_build-indep:
	$(MAKE) doxygen-doc
	$(MAKE) -C schemas

override_dh_auto_install-indep:
	$(MAKE) -C doc     DESTDIR="$(CURDIR)/debian/tmp" install
	$(MAKE) -C schemas DESTDIR="$(CURDIR)/debian/tmp" install

override_dh_auto_test-indep:

override_dh_auto_test-arch:
	python3 debian/tests/run_with_httpd.py dh_auto_test

override_dh_installdocs:
	dh_installdocs -A doc/README.txt doc/NOTICE.txt

# Work around https://shibboleth.atlassian.net/browse/CPPXT-146
override_dh_clean:
	dh_clean -X .bak
