#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

DEB_GNOME_VERSION := $(firstword $(subst ., ,$(DEB_VERSION_UPSTREAM)))

%:
	dh $@

execute_after_dh_auto_install:
	find debian -name gschemas.compiled -print -delete

override_dh_gencontrol:
	dh_gencontrol -- \
		-Vgnome-shell:MinimumVersion=$(shell \
			debian/find-supported-shell-versions.py $(DEB_SOURCE) --min-version \
			--must-support $(DEB_GNOME_VERSION)) \
		-Vgnome-shell:MaximumVersion=$(shell \
			debian/find-supported-shell-versions.py $(DEB_SOURCE) --max-version) \
		$(NULL)

execute_after_dh_install:
	dh_apparmor --profile-name=desktop-icons-ng

override_dh_fixperms:
	dh_fixperms \
		-XcreateThumbnail.js \
		-Xding.js \
		$(NULL)

override_dh_gnome_clean:
	# Ensure subprojects are populated.
	find subprojects -name .meson-subproject-wrap-hash.txt | grep -qs .

update-subprojects:
	meson subprojects purge --confirm
	meson subprojects download
