#!/usr/bin/make -f

%:
	dh $@ --with python2

override_dh_auto_clean:
	rm -f po/*/gnome-shell-timer.mo

override_dh_auto_build:
	for po in po/*/gnome-shell-timer.po; do \
	    msgfmt -cv -o $${po%.po}.mo $$po; \
	done 

override_dh_auto_install:
	for mo in po/*/gnome-shell-timer.mo; do \
	    lang=$$(basename $$(dirname $$mo)); \
	    mkdir -p debian/gnome-shell-timer/usr/share/locale/$$lang/LC_MESSAGES; \
	    cp $$mo debian/gnome-shell-timer/usr/share/locale/$$lang/LC_MESSAGES/; \
	done
	mkdir -p debian/gnome-shell-timer/usr/bin/
	cp gnome-shell-timer-config.py debian/gnome-shell-timer/usr/bin/gnome-shell-timer-config
	sed -i -e '1 s/python2/python/' debian/gnome-shell-timer/usr/bin/gnome-shell-timer-config

