#! /usr/bin/make -f

LINGUAS = de
package = lure-of-the-temptress
podir = $(CURDIR)/debian/po
localedir = /usr/share/locale

$(podir)/templates.pot:
	xgettext \
	  --language=Shell \
	  --copyright-holder="" \
	  --output=$(podir)/templates.pot \
	  $(CURDIR)/debian/lure

$(podir)/$(LINGUAS).mo: %.mo: %.po
	msgfmt -c -v --statistics -o $@ $<

.PHONY: build-stamp
build-stamp: $(podir)/templates.pot $(podir)/$(LINGUAS).mo
	touch build-stamp

.PHONY: build
build: build-stamp
build-indep: build

%:
	dh $@

override_dh_auto_build:

override_dh_clean:
	dh_clean
	dh_clean $(podir)/*.mo 

override_dh_install:
	for lang in $(LINGUAS); do					\
		dir=$(localedir)/$$lang/LC_MESSAGES/;			\
		dh_installdirs $$dir;					\
		cp $(podir)/$$lang.mo $(CURDIR)/debian/$(package)$$dir/lure.mo;	\
	done
	dh_install

override_dh_builddeb:
	dh_builddeb -- -Zxz

override_dh_compress:
	dh_compress -X.pdf -X.PDF

