#!/usr/bin/make -f

export GEM2DEB_TEST_RUNNER = --check-dependencies
export DH_RUBY = --gem-install
export DH_RUBY_GEM_INSTALL_EXCLUDE = sample/*

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

override_dh_installdocs:
	dh_installdocs
	# move distributed binaries to documentation directory as examples
	mv $(CURDIR)/debian/ruby-soap4r/usr/bin $(CURDIR)/debian/ruby-soap4r/usr/share/doc/ruby-soap4r/examples

override_dh_installexamples:
	dh_installexamples
	find $(CURDIR)/debian/ruby-soap4r/usr/share/doc/ruby-soap4r/examples/ -type f -executable -exec chmod -x '{}' ';'

override_dh_clean:
	dh_clean $(shell find lib/ -name \*.orig | xargs -n 1 echo -X)
