#!/usr/bin/make -f
export dh_verbose=1

export GIT_HEAD=$(shell [ -f debian/git_head ] && cat debian/git_head)
export GIT_DESCRIBE=$(shell [ -f debian/git_describe ] && cat debian/git_describe)
export GIT_COMMIT_DATE=$(shell [ -f debian/git_commit_date ] && cat debian/git_commit_date)

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

%:
	dh ${@} --buildsystem=cmake \
		--with quilt

# we build only core and client in a single run wit Qt 5
override_dh_auto_configure:
	dh_auto_configure -- \
		-DEMBED_DEFAULT=ON \
		-DHAVE_SSL=ON \
		-DCMAKE_SKIP_RPATH=ON \
		-DWANT_MONO=ON \
		-DWITH_KDE=OFF \
		-DWITH_LDAP=OFF \
		-DWITH_WEBENGINE=OFF \
		-DWITH_WEBKIT=ON

override_dh_auto_install:
	dh_auto_install
	find debian/tmp -name LICENSE -delete

override_dh_installinit:
	dh_installinit -r --error-handler=exit --name=quasselcore

override_dh_missing:
	dh_missing --fail-missing
