#!/usr/bin/make -f

ALLPOFILES:=$(wildcard *.po)
POFILES:=$(filter-out gcp.po,$(ALLPOFILES))
MOPATH:=i18n/%/LC_MESSAGES
MOFILES:=$(patsubst %.po,$(MOPATH)/gcp.mo,$(POFILES))

clean:
	rm -f $(MOFILES)
	rm -rf .dbus .gcp
	dh clean

build: $(MOFILES)

$(MOPATH)/gcp.mo: %.po
	mkdir -p $(@D)
	msgfmt -o $@ $<

override_dh_auto_clean:
override_dh_auto_configure:
override_dh_auto_build:
override_dh_auto_install:

override_dh_auto_test:
ifeq "$(filter nocheck,$(DEB_BUILD_OPTIONS))" ""
	unset DBUS_SESSION_BUS_ADDRESS ; \
	HOME="$$PWD" PATH="$$PWD:$$PATH" xvfb-run -a ./test_gcp.py
endif

%:
	dh $@
