#!/usr/bin/make -f

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

include /usr/share/dpkg/architecture.mk

ifeq ($(DEB_HOST_ARCH_CPU),$(findstring $(DEB_HOST_ARCH_CPU),amd64 i386))
  VC_DEV_VERSION = $(shell dpkg-query -Wf '$${source:Package} (= $${source:Version})' vc-dev)
else
  VC_DEV_VERSION =
endif

%:
	dh $@ --with kf5

override_dh_auto_configure:
	dh_auto_configure -Skf5 -- -DFOUNDATION_BUILD=OFF -DBUILD_TESTING=OFF -DENABLE_UPDATERS=OFF

execute_after_dh_auto_install:
	# remove symlinks of private libraries
	find debian/tmp -name '*.so' -type l -print -delete
	# remove development headers
	rm -rfv debian/tmp/usr/include/
	# remove the testing x-test "translations"
	rm -rfv debian/tmp/usr/share/locale/x-test/

override_dh_gencontrol:
	dh_gencontrol -pkrita -- -Vvc:Built-Using='$(VC_DEV_VERSION)'
	dh_gencontrol --remaining-packages

.PHONY: override_dh_auto_test
