#!/usr/bin/make -f

%:
	dh $@

override_dh_auto_build:
	# Build translations
	# Arabic translation directory does not exist, (reported upstream)
	mkdir -p system-monitor@paradoxxx.zero.gmail.com/locale/ar/LC_MESSAGES
	for POFILE in po/*/system-monitor.po; do \
		MOLANG=$$(echo $$POFILE | sed -e "s/po\///g" | sed -e "s/\/system-monitor.po//g"); \
		MOFILE="system-monitor@paradoxxx.zero.gmail.com/locale/$$MOLANG/LC_MESSAGES/system-monitor.mo"; \
		msgfmt -cv -o $$MOFILE $$POFILE; \
	done
	# Compile gschemas so that we don't ship upstream compiled version
	glib-compile-schemas --strict --targetdir=system-monitor@paradoxxx.zero.gmail.com/schemas/ system-monitor@paradoxxx.zero.gmail.com/schemas
	dh_auto_build

