#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all


%:
	dh $@

override_dh_auto_configure:
	[ -e  po/ca.po.orig ] || cp -p po/ca.po po/ca.po.orig
	[ -e  po/cs.po.orig ] || cp -p po/cs.po po/cs.po.orig
	[ -e  po/de.po.orig ] || cp -p po/de.po po/de.po.orig
	[ -e  po/es_ES.po.orig ] || cp -p po/es_ES.po po/es_ES.po.orig
	[ -e  po/fr_FR.po.orig ] || cp -p po/fr_FR.po po/fr_FR.po.orig
	[ -e  po/gPlanarity.pot.orig ] || cp -p po/gPlanarity.pot \
		po/gPlanarity.pot.orig
	docbook-to-man debian/gplanarity.sgml > gplanarity.6
	dh_auto_configure
	echo '#define VERSION "'$(DEB_VERSION_UPSTREAM)'"' > version.h

execute_after_dh_auto_install:
	mv $(CURDIR)/debian/gplanarity/usr/games/gPlanarity \
		$(CURDIR)/debian/gplanarity/usr/games/gplanarity

execute_after_dh_auto_clean:
	[ ! -e po/ca.po.orig ] || mv po/ca.po.orig po/ca.po
	[ ! -e po/cs.po.orig ] || mv po/cs.po.orig po/cs.po
	[ ! -e po/de.po.orig ] || mv po/de.po.orig po/de.po
	[ ! -e po/es_ES.po.orig ] || mv po/es_ES.po.orig po/es_ES.po
	[ ! -e po/fr_FR.po.orig ] || mv po/fr_FR.po.orig po/fr_FR.po
	[ ! -e po/gPlanarity.pot.orig ] || mv po/gPlanarity.pot.orig \
		po/gPlanarity.pot
