#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

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

# Local Lintian after dpkg-buildpackage (uses debian/lintianrc). For sbuild, see debian/README.sbuild
# and debian/sbuild.suryaos.conf (set SBUILD_CONFIG to that file).
.PHONY: run-lintian
run-lintian:
	@if ! ls ../*.changes >/dev/null 2>&1; then \
		echo "run-lintian: no ../*.changes — run dpkg-buildpackage from this directory first." >&2; \
		exit 1; \
	fi; \
	export LINTIAN_CFG="$(CURDIR)/debian/lintianrc"; \
	for c in ../*.changes; do lintian "$$c"; done; \
	if ls ../*.dsc >/dev/null 2>&1; then for d in ../*.dsc; do lintian "$$d"; done; fi

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -Skf5 -- -DBUILD_TESTING=OFF

override_dh_auto_test:
	# Disable auto tests at build time
	:

override_dh_fixperms-arch:
	chmod -x debian/plasma-workspace/etc/xdg/autostart/klipper.desktop
	chmod -x debian/plasma-workspace/usr/lib/*/libexec/plasma-sourceenv.sh
	dh_fixperms -a

override_dh_gencontrol-arch: libpkgs_gen_strict_local_shlibs
	dh_gencontrol -a
