#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

export DEB_PKG_VERSION = "\"$(shell dpkg-parsechangelog -S Version)\""
export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

ifeq ($(DEB_HOST_ARCH),armhf)
	DEB_DH_AUTO_CONFIGURE_OPTS__ENABLE_TLS := --disable-tls
else
	DEB_DH_AUTO_CONFIGURE_OPTS__ENABLE_TLS := --enable-tls
endif

default:
	@uscan --no-conf --dehs --report || true

%:
	dh $@ --with autoreconf --parallel

override_dh_auto_configure-arch:
	dh_auto_configure -- --enable-clz $(DEB_DH_AUTO_CONFIGURE_OPTS__ENABLE_TLS) --disable-ansicontrols

override_dh_auto_configure-indep:
	@true

override_dh_auto_build-indep:
	@true

override_dh_auto_test-indep:
	@true

override_dh_auto_install-indep:
	@true

override_dh_installdocs:
	dh_installdocs -pnauty --link-doc=libnauty2
	dh_installdocs -plibnauty2-dev --link-doc=libnauty2
	dh_installdocs --remaining-packages

override_dh_installchangelogs:
	dh_installchangelogs --keep changes24-26.txt

override_dh_compress-indep:
	dh_compress -X.pdf -Xexamples

get-orig-source:
	uscan --no-conf --download-current-version --compression xz --verbose
