#!/usr/bin/make -f
# -*- makefile -*-

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

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

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
	dh $@ --buildsystem=cmake

override_dh_auto_configure:
	dh_auto_configure -- -DLIB_SUFFIX="/$(DEB_HOST_MULTIARCH)"

override_dh_installdocs:
	dh_installdocs --link-doc=soapyosmo-common0.7

# dh_makeshlibs creates an unnecessary ldconfig trigger for the common
# package containing a shared library in a private location (see
# https://bugs.debian.org/204975), override it to prevent that
override_dh_makeshlibs:
	dh_makeshlibs -psoapyosmo-common0.7 --no-scripts
	dh_makeshlibs --remaining-packages
