#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow

DEBPKGNAME := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')

CMAKE_EXTRA_FLAGS += -DBUILD_TESTING=OFF

## The following has no visible effect ->
## W: libbpp-core2v5: hardening-no-relro usr/lib/x86_64-linux-gnu/libbpp-core.so.2.0.3
## remains
# export DEB_BUILD_MAINT_OPTIONS = hardening=+all
##
## A workaround is provided here:
##   https://sources.debian.net/src/keyutils/1.5.9-9/debian/patches/hardening.patch/
## See also the thread starting at
##   https://lists.debian.org/debian-devel/2016/05/msg00297.html

%:
	dh $@

override_dh_install:
	dh_install
	d-shlibmove --commit \
		    --multiarch \
		    --v5 \
		    --devunversioned \
		    --exclude-la \
                    --movedev debian/tmp/usr/include/* usr/include \
                    debian/tmp/usr/lib/*.so
