#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

DISTVER := $(shell lsb_release -rs 2>/dev/null)

cmpver = $(shell dpkg --compare-versions '$(1)' '$(2)' '$(3)' && echo yes || echo no)

ifeq (yes, $(call cmpver,$(DISTVER),lt,22.04))
	SUBSTVARS = -Vdist:Depends="qml-module-qtquick2"
else ifeq ($(DISTVER), 22.04)
	SUBSTVARS = -Vdist:Depends="qml6-module-qtquick, qml6-module-qtqml-workerscript, qt6-qpa-plugins" -Vdist:Recommends="qt6-wayland"
else
	SUBSTVARS = -Vdist:Depends="qml6-module-qtquick, qml6-module-qtqml-workerscript" -Vdist:Recommends="qt6-wayland"
endif

%:
	dh $@

override_dh_gencontrol:
	dh_gencontrol -- $(SUBSTVARS)

override_dh_auto_configure:
	#dh_auto_configure -- dukto.pro
	dh_auto_configure -- -DUSE_SINGLE_APP=ON -DUSE_NOTIFY_LIBNOTIFY=ON

