#!/usr/bin/make -f
TEMPDIR=debian/tmp/usr/share/gnome-shell/extensions/flypie@schneegans.github.com
%:
	dh $@

override_dh_auto_build:
	$(MAKE) zip

override_dh_auto_test:
	# this requires podman (and hence network access)

override_dh_auto_install:
	mkdir -p $(TEMPDIR)
	unzip flypie@schneegans.github.com.zip -d $(TEMPDIR)
	cd schemas && glib-compile-schemas .
	cp schemas/gschemas.compiled $(TEMPDIR)/schemas/

override_dh_gencontrol:
	dh_gencontrol -- \
		-Vgnome:MinimumVersion=$(shell python3 -c "import json; print(min(int(x) for x in json.load(open('metadata.json', 'rt'))['shell-version']))") \
		-Vgnome:MaximumVersion=$(shell python3 -c "import json; print(1+max(int(x) for x in json.load(open('metadata.json', 'rt'))['shell-version']))")