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

include /usr/share/dpkg/architecture.mk

ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
export QT_SELECT=qt5-$(DEB_BUILD_MULTIARCH)-$(DEB_HOST_MULTIARCH)
endif

export PKG_CONFIG_PATH=/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk


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

%:
	dh $@

override_dh_install:
	sed -i debian/tmp/usr/lib/*/libqofono-qt5.prl -e '/^QMAKE_PRL_BUILD_DIR.*=.*/d'
	dh_install

override_dh_missing:
	dh_missing --fail-missing

override_dh_fixperms:
	dh_fixperms
	chmod a-x debian/libqofono-tests/usr/libexec/libqofono-qt5/tests/tests.xml

# FIXME: disable tests for now. These require ofono to be running and probably
#  need more love before they can be run during build-time (LP: #1334652)
override_dh_auto_test:
#	LD_LIBRARY_PATH=../../../src dh_auto_test

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