#!/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_auto_install:
	# copy specs' data to data dir in order to install them correctly to run the specs
	cp -R spec/data/ data/spec
	# install manually and temporarily data
	mkdir -p debian/ruby-prawn/usr/share/ruby-prawn
	cp -R data/* debian/ruby-prawn/usr/share/ruby-prawn
	dh_auto_install
	ruby -I "debian/ruby-prawn/usr/lib/ruby/vendor_ruby" manual/manual/manual.rb
	# remove the copy of data in debian/ruby-prawn (will be reinstalled by dh_install)
	rm -rf debian/ruby-prawn/usr/share/ruby-prawn
	rm -rf data/spec

override_dh_auto_clean:
	# remove the copy of spec/data in data/
	rm -rf data/spec
	rm -f manual.pdf
	dh_auto_clean

get-orig-source:
	chmod +x debian/repack.sh
	debian/repack.sh
