#!/usr/bin/make -f
#export DH_VERBOSE=1
#
# Uncomment to ignore all test failures (but the tests will run anyway)
#export DH_RUBY_IGNORE_TESTS=all
#
# Uncomment to ignore some test failures (but the tests will run anyway).
# Valid values:
#export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems
#
# If you need to specify the .gemspec (eg there is more than one)
#export DH_RUBY_GEMSPEC=gem.gemspec

%:
	dh $@ --buildsystem=ruby --with ruby

override_dh_installexamples:
	dh_installexamples
	chmod 755 debian/ruby-ttfunk/usr/share/doc/ruby-ttfunk/examples/metrics.rb

DEB_UPSTREAM_VERSION=$(shell dpkg-parsechangelog | sed -rne 's/^Version: ([^+]+).*/\1/p')
get-orig-source:
	uscan --noconf --force-download --rename --download-current-version --destdir=.
	rm -rf ruby-ttfunk-$(DEB_UPSTREAM_VERSION)
	tar -xf ruby-ttfunk_$(DEB_UPSTREAM_VERSION).orig.tar.gz
	rm ruby-ttfunk_$(DEB_UPSTREAM_VERSION).orig.tar.gz
	rm ttfunk-$(DEB_UPSTREAM_VERSION)/data/fonts/comicsans.ttf
	mv ttfunk-$(DEB_UPSTREAM_VERSION) ruby-ttfunk-$(DEB_UPSTREAM_VERSION).orig
	GZIP=--best tar -cz --owner root --group root --mode a+rX -f \
	     ../ruby-ttfunk_$(DEB_UPSTREAM_VERSION)+dfsg.orig.tar.gz ruby-ttfunk-$(DEB_UPSTREAM_VERSION).orig
	rm -r ruby-ttfunk-$(DEB_UPSTREAM_VERSION).orig
