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

%:
	dh $@

# Only the shared library is built; Debian does not ship the static one.
override_dh_auto_build:
	dh_auto_build -- dynamic-library

override_dh_auto_install:
	$(MAKE) install-dynamic-library install-pc install-doc \
		DESTDIR=$(CURDIR)/debian/tmp PREFIX=/usr \
		LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)

execute_after_dh_auto_install:
	sed -i 's|^libdir=.*|libdir=$${prefix}/lib/$(DEB_HOST_MULTIARCH)|' \
		debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/monocypher.pc
