#!/usr/bin/make -f ifeq ($(shell dpkg-vendor --is Ubuntu && echo yes),yes) export EXTENSION_UUID=tiling-assistant@ubuntu.com else export EXTENSION_UUID=tiling-assistant@leleat-on-github endif %: dh $@ execute_before_dh_auto_build: ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes) mkdir -p $(EXTENSION_UUID) jq -r '.uuid = "$(EXTENSION_UUID)" '\ '| .name = "Ubuntu Tiling Assistant" '\ '| .url = "https://launchpad.net/ubuntu/+source/gnome-shell-extension-tiling-assistant"' \ tiling-assistant@leleat-on-github/metadata.json > \ $(EXTENSION_UUID)/metadata.json endif ./update-locale.sh override_dh_install: set -e; for x in $(EXTENSION_UUID)/locale/*; do \ install -d debian/tmp/usr/share/locale/$$(basename $$x)/LC_MESSAGES; \ install -m644 $$x/LC_MESSAGES/*.mo debian/tmp/usr/share/locale/$$(basename $$x)/LC_MESSAGES; \ done dh_install ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes) extension_path=debian/gnome-shell-extension-ubuntu-tiling-assistant/usr/share/gnome-shell/extensions; \ mv $(EXTENSION_UUID)/metadata.json \ $$extension_path/$(EXTENSION_UUID)/metadata.json endif ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes) rm -rf $(EXTENSION_UUID) endif override_dh_translations: mv translations/main.pot translations/main.pot.in dh_translations --domain=${EXTENSION_UUID} mv translations/main.pot.in translations/main.pot override_dh_gnome_clean: override_dh_gencontrol: dh_gencontrol -- \ -Vgnome:MinimumVersion=$(shell python3 -c "import json; print(min(int(x) for x in json.load(open('${EXTENSION_UUID}/metadata.json', 'rt'))['shell-version']))") \ -Vgnome:MaximumVersion=$(shell python3 -c "import json; print(1+max(int(x) for x in json.load(open('${EXTENSION_UUID}/metadata.json', 'rt'))['shell-version']))")