#!/usr/bin/make -f

include /usr/share/pkg-kde-tools/qt-kde-team/3/debian-qt-kde.mk

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_VERSION_UPSTREAM_REVISION := $(shell dpkg-parsechangelog | awk '/^Version: / { print $$2 }' | sed -e 's/^[0-9]*://')

# Do not pull plugins into the shlibs file, it makes lintian angry.
# This happens because dh_makeshlibs will look for sonames matching
# (.*)-(.*)\.so where it assumes \1 is the library name and \2 is the version.
# This will then assume that libfoo-backend.so has name 'libfoo' and version
# 'backend' which makes for bogus, pointless, silly shlibs entries.
# Couldn't be bothered to report this - sitter, 2015
override_dh_makeshlibs:
	dh_makeshlibs -Xusr/lib/$(DEB_HOST_MULTIARCH)/qt5/plugins/discover* -V

override_dh_gencontrol:
	dh_gencontrol -pmuon-discover -- -v4:$(DEB_VERSION_UPSTREAM_REVISION)
	dh_gencontrol -pmuon-updater -- -v4:$(DEB_VERSION_UPSTREAM_REVISION)
	dh_gencontrol -pmuon-notifier -- -v4:$(DEB_VERSION_UPSTREAM_REVISION)
	dh_gencontrol --remaining-packages

# FIXME: tests are broken at time
override_dh_auto_test:
	:
