#!/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=rubysetuprb --with ruby

override_dh_clean:
	dh_clean
	# Remove unneeded files created during the build process
	rm -f ext/RMagick/mkmf.log *.miff *.gif *.png

target_doc_dir = debian/ruby-rmagick-doc/usr/share/doc/ruby-rmagick-doc
override_dh_auto_install:
	dh_auto_install
# Then, we move the documentation to its proper package
# Not very elegant, but effective
	mkdir -p $(target_doc_dir)
	mv debian/ruby-rmagick/usr/share/RMagick $(target_doc_dir)/html
# And now very uncleanly remove files not wanted
	-find $(target_doc_dir) -name .cvsignore | xargs rm
	-find $(target_doc_dir) -name .rmagick | xargs rm
