#!/usr/bin/make -f

l10npkgs_firstversion_ok := 4:16.04.3-4~
include /usr/share/pkg-kde-tools/qt-kde-team/2/l10n-packages.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

EXTRAFLAGS :=
ifeq ($(DEB_BUILD_ARCH_OS),kfreebsd)
	EXTRAFLAGS := -DNO_JOGSHUTTLE=YES
endif

%:
	dh $@ --with kf5

override_dh_auto_configure:
	dh_auto_configure -Skf5 -- $(EXTRAFLAGS)

override_dh_install:
	dh_install
	rm -rf $(CURDIR)/debian/kdenlive-data/usr/share/doc/Kdenlive/
	rm -rf $(CURDIR)/debian/kdenlive-data/usr/share/icons/breeze-dark

override_dh_auto_test:

override_dh_gencontrol: l10npkgs_firstversion_ok
	dh_gencontrol

# TODO: fixes OBS running lintian -i with a non-existent .changes filename (Ubuntu/KF5? only)
ifeq ($(shell dpkg-vendor --query Vendor), Ubuntu)
override_dh_kubuntu_execute_lintian:
	dh_kubuntu_execute_lintian
	dpkg-genchanges -O../$(shell dpkg-parsechangelog -S Source)-xUbuntu_$(shell lsb_release -s -r)_$(shell dpkg-architecture -q DEB_BUILD_ARCH).changes
endif
