#!/usr/bin/make -f

%:
	dh $@

override_dh_auto_build:
	dh_auto_build -- ttf otf

override_dh_builddeb:
	dh_builddeb -- -Zxz

URL="https://googlefontdirectory.googlecode.com/hg/"
# Can't get date of last hg commit easily, use current date as fallback
DATE=$(shell date +%Y%m%d)
# This needs changing in case of an actual version bump
VER="1.002"
DIR=fonts-play-$(VER)+$(DATE).1.orig
TAR=fonts-play_$(VER)+$(DATE).1.orig.tar.xz
get-orig-source:
	hg clone $(URL) $(DIR)
	find $(DIR) -mindepth 1 -not -wholename "$(DIR)/play/*" \
				-not -wholename "$(DIR)/play" \
				-not -wholename "$(DIR)/tools/*" \
				-not -wholename "$(DIR)/tools" \
				-not -name "Makefile" \
				-delete
	rm -f $(DIR)/play/Play*
	rm -rf $(DIR)/tools/ttfautohint/
	ZX_OPT="-9" tar -cJ --owner root --group root --mode a+rX \
							-f $(TAR) $(DIR)
