#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --buildsystem=cmake

# Upstream's CMakeLists.txt generates hbkzpcprovider.conf (an OpenSSL
# config snippet activating the hbkzpc provider) into the build
# directory, but never installs it; it is only generated on s390x, where
# the provider is built. Install debian/hbkzpcprovider.conf instead: it
# also activates the default provider, which Ubuntu's openssl.cnf
# activates only implicitly, so the upstream snippet alone would disable
# it system-wide (LP: #2178514).
override_dh_auto_install:
	dh_auto_install
	if [ -f obj-$(DEB_HOST_GNU_TYPE)/hbkzpcprovider.conf ]; then \
		install -D -m644 debian/hbkzpcprovider.conf \
			debian/tmp/etc/ssl/openssl.conf.d/hbkzpcprovider.conf; \
	fi
