#!/usr/bin/make -f

export DPKG_GENSYMBOLS_CHECK_LEVEL=4
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

DPKG_EXPORT_BUILDFLAGS = 1

include /usr/share/dpkg/default.mk

VERSION = $(shell echo $(DEB_VERSION_UPSTREAM) | sed -e 's/+.*//')
MAJOR = $(shell echo $(VERSION) | cut -d. -f1)
MINOR = $(shell echo $(VERSION) | cut -d. -f2)
PATCH = $(shell echo $(VERSION) | cut -d. -f3)

%:
	dh $@ --with pkgkde_symbolshelper

override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_INSTALL_LIBEXECDIR=/usr/lib/$(DEB_HOST_MULTIARCH)/dbus-cpp \
		-DDBUS_CPP_VERSION_MAJOR=$(MAJOR) \
		-DDBUS_CPP_VERSION_MINOR=$(MINOR) \
		-DDBUS_CPP_VERSION_PATCH=$(PATCH)

get-orig-source:
	uscan --noconf --force-download --rename --download-current-version --destdir=..
