#!/usr/bin/make -f
#export DH_VERBOSE=1
#
# Uncomment to ignore some test failures (but the tests will run anyway).
# Valid values:
# export DH_RUBY_IGNORE_TESTS=ruby2.0 ruby2.1 ruby2.5 ruby2.7

# this is only for multi-binary packages which ours is not:
# export DH_RUBY_USE_DH_AUTO_INSTALL_DESTDIR

export GEM2DEB_TEST_RUNNER = --check-dependencies
export DH_RUBY = --gem-install

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

override_dh_auto_build:
	dh_auto_build
	rdoc --all --line-numbers --main API.rdoc\
		-o build-doc/rdoc lib API.rdoc
# get rid of rdoc compressed duplicates:
	rm build-doc/rdoc/js/*.js.gz

override_dh_auto_install:
	dh_auto_install

# get rid of these .gitignore-files
	find debian/webgen/usr/share/rubygems-integration/all/gems/webgen-1.7.2/data/webgen -type f -name .gitignore -delete

override_dh_installdocs:
	dh_installdocs --remaining-packages --link-doc=webgen
# replace rdoc duplicated templates with links:
	dh_link -A

