#!/usr/bin/make -f

# cmake.pm does not pass LDFLAGS on to cmake, so do it explicitly to keep
# the linker hardening flags.
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_SHARED_LINKER_FLAGS="$(LDFLAGS)"

execute_after_dh_install:
	d-shlibmove --commit \
		    --multiarch \
		    --devunversioned \
		    --exclude-la \
		    --movedev debian/tmp/usr/include/kff_io.hpp usr/include \
		    debian/tmp/usr/lib/*/*.so
