#!/usr/bin/make -f

libpkgs_gen_strict_local_shlibs = $(libpkgs_all_packages) cantor
include /usr/share/pkg-kde-tools/qt-kde-team/3/library-packages.mk

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- -DBUILD_TESTING=OFF

override_dh_auto_build:
	# manually export CFLAGS with CPPFLAGS during build, because:
	# - ExternalProject is used, so cmake is run to configure discount
	# - cmake doesn't respect CPPFLAGS, see #653916
	CFLAGS="$(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS)" dh_auto_build

override_dh_auto_test:
	# Disable dh_auto_test at build time
	:

override_dh_gencontrol: libpkgs_gen_strict_local_shlibs
	dh_gencontrol

override_dh_auto_install:
	mkdir -p debian/tmp/etc/apparmor.d
	cp debian/cantor-apparmor debian/tmp/etc/apparmor.d/usr.bin.cantor
	dh_auto_install
	dh_apparmor --profile-name=usr.bin.cantor -pcantor
