#!/usr/bin/make -f

override_dh_auto_install:
	dh_auto_install -- --install-lib /usr/share/games --install-script /usr/games/

override_dh_installman:
	dh_installman debian/mttroff.6

REV=$(shell dpkg-parsechangelog | sed -rne 's,^Version: .*[+~]svn([0-9]+).*,\1,p')
VER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p')
get-packaged-orig-source:
	rm -rf mttroff-$(VER).orig
	svn -q export -r $(REV) https://www.libavg.de/svn/trunk/avg_media/mtc/troff \
                      mttroff-$(VER).orig
	# Delete DFSG incompatible fonts
	rm -r mttroff-$(VER).orig/mttroff/fonts
	GZIP=--best tar -cz --owner root --group root --mode a+rX \
                        -f mttroff_$(VER).orig.tar.gz \
                        mttroff-$(VER).orig
	rm -r mttroff-$(VER).orig

%:
	dh $@ --with python2
