#!/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 (same as upstream's own libzpc.spec,
# which also installs it by hand in %install rather than via
# %cmake_install). Only generated/present on s390x builds.
override_dh_auto_install:
	dh_auto_install
	if [ -f obj-$(DEB_HOST_GNU_TYPE)/hbkzpcprovider.conf ]; then \
		install -D -m644 obj-$(DEB_HOST_GNU_TYPE)/hbkzpcprovider.conf \
			debian/tmp/etc/ssl/openssl.conf.d/hbkzpcprovider.conf; \
	fi
