#!/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=debian/bdb.gemspec

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

override_dh_installdocs:
	rdoc --op rdoc --main README.en \
		--title "Interface to Berkeley DB" \
		src doc README.en
	$(RM) $(CURDIR)/debian/ruby-bdb/usr/share/doc/ruby-bdb/rdoc/js/jquery.js
	dh_installdocs

override_dh_link:
	# link to jquery.js
	dh_link --package=ruby-bdb usr/share/javascript/jquery/jquery.js \
		usr/share/doc/ruby-bdb/rdoc/js/jquery.js

override_dh_clean:
	dh_clean
	$(RM) src/bdb_features.h
	$(RM) -R tmp
	$(RM) -R rdoc

	# This package is maintained in a Git repository, and empty
	# directories are not tracked by Git. In order to run the test
	# suite, create the needed tmp/ directories if they are not
	# present
	mkdir tmp
