#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@  --with autoreconf

override_dh_auto_configure:
	# OpenSSL 4.0 removed the legacy ENGINE API, so only the IBMCA
	# provider is built (--disable-engine).  Install the provider module
	# straight into the OpenSSL modules directory (ossl-modules) by
	# pointing libdir there.
	dh_auto_configure -- \
		--libdir=/usr/lib/$(DEB_HOST_MULTIARCH)/ossl-modules \
		--disable-engine \
		--enable-provider \
		--with-provider-libica-full

override_dh_auto_build:
	dh_auto_build
	src/provider/ibmca-provider-opensslconfig

override_dh_auto_install:
	dh_auto_install
	find debian -name '*.la' -delete

override_dh_auto_test:
	dh_auto_test
