#!/usr/bin/make -f
# -*- Mode: Makefile; indent-tabs-mode: t; tab-width: 4 -*-

include /usr/share/dpkg/buildflags.mk

export DPKG_GENSYMBOLS_CHECK_LEVEL=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --parallel

override_dh_missing:
	dh_missing --fail-missing

override_dh_install:
	# drop any translations for locales we don't care about
	for mo in debian/tmp/usr/share/locale/*; do \
		export locale="$$(basename $${mo} .po)"; \
		if ! grep -q "^$${locale}[ ._]" /usr/share/i18n/SUPPORTED; then \
			rm -r "$${mo}"; \
		fi; \
	done
	
	dh_install

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	# Have to specify LC_ALL manually until https://launchpad.net/bugs/1566590
	# is fixed.
	LC_ALL=C.UTF-8 dh_auto_test -- VERBOSE=1
endif
