#!/usr/bin/make -f

export DEB_LDFLAGS_MAINT_APPEND += -Wl,-z,defs
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ -Scmake+ninja

execute_after_dh_clean:
	rm -rf docs/doxygen

override_dh_autoreconf:

override_dh_auto_configure-arch:
	dh_auto_configure -- \
		-DUPNP_BUILD_STATIC=OFF

override_dh_auto_configure-indep:

override_dh_auto_build-indep:
	cd docs && doxygen
	$(MAKE) -C docs/doxygen/latex
	find docs/doxygen/html -name "*.md5" -o -name "*.map" -delete

override_dh_auto_install-indep:

# Tests disabled because they access the network.
override_dh_auto_test-arch:
override_dh_auto_test-indep:
