#!/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
export QMAKE_LIBDIR=/usr/lib
export QT_SELECT=qt5
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
DOXYGEN_VERSION = $(shell dpkg-query -Wf '$${Version}' doxygen)
include /usr/share/dpkg/architecture.mk


%:
	dh $@ --with pkgkde_symbolshelper

override_dh_auto_configure:
	dh_auto_configure -- LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
		CONFIG+=enable-p2p \
		DEFINES+=QT_NO_DEBUG_OUTPUT

execute_after_dh_auto_clean:
	-rm src/signond/backupifadaptor.*

execute_after_dh_auto_install:
	rm -f debian/tmp/usr/include/signon-plugins/*example*.h
	rm -f debian/tmp/usr/include/signon-plugins/*test*.h
	rm -f $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libsignon-qt*.*a
	rm -f $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/signon/libexampleplugin.so

execute_after_dh_install-indep:
	dh_doxygen -i

override_dh_gencontrol-indep:
	dh_gencontrol -i -- -Vsignond:DoxygenVersion='$(DOXYGEN_VERSION)'

# as of 8.59 tests fail.
#  SsoTestClient: "No such object path '/com/google/code/AccountsSSO/SingleSignOn'"
override_dh_auto_test:
	dbus-run-session -- dh_auto_test

# .PHONY: override_dh_auto_test
