#!/usr/bin/make -f

# DH_VERBOSE := 1

# Enable hardening build flags
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

# Remove buildpath from binaries
export DEB_CFLAGS_MAINT_APPEND=-DNDEBUG
export DEB_CXXFLAGS_MAINT_APPEND=-DNDEBUG

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- -DCMAKE_INSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH)

override_dh_install:
	dh_install --list-missing

	# Strip RPATH
	chrpath --delete debian/*/usr/lib/*/*.so.?.?.?

override_dh_makeshlibs:
	dh_makeshlibs -V
