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

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

# This has to be exported to make some magic below work.
export DH_OPTIONS

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

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

include /usr/share/dpkg/pkg-info.mk

UPSTREAM_VERSION = $(shell echo $(DEB_VERSION_UPSTREAM) | sed -e 's/\+.*//')

%:
	dh $@ --with pkgkde_symbolshelper

override_dh_auto_configure:
	dh_auto_configure -- -DSIDX_LIB_SUBDIR=lib/$(DEB_HOST_MULTIARCH) \
	                     -DCMAKE_SKIP_RPATH=ON

override_dh_install:
	$(RM) $(CURDIR)/debian/tmp/usr/lib/*/*.la

	dh_install

override_dh_makeshlibs:
	dh_makeshlibs -- -c0 -v$(UPSTREAM_VERSION)
