#!/usr/bin/make -f

%:
	dh $@

override_dh_auto_configure:
	debian/check-upstream-versus-debian
	dh_auto_configure -- $(shell dpkg-buildflags --export=configure)

override_dh_auto_install:
	debian/build ruby1.8
	debian/build ruby1.9.1
	dh_auto_install

override_dh_strip:
	for i in $$(sed -n '/Package: ruby-.*-dbg/ { s/Package: \(.*\)-dbg/\1/ p }' debian/control) ; do \
		dh_strip -p$$i --dbg-package=$$i-dbg ; \
	done
	dh_strip

override_dh_fixperms:
	dh_fixperms
	# Remove executable flag from some examples that aren't actually executable.
	chmod -x debian/ruby-glib2/usr/share/doc/ruby-glib2/examples/type-register*.rb
	chmod -x debian/ruby-gtk2/usr/share/doc/ruby-gtk2/examples/misc/properties.rb
	chmod -x debian/ruby-goocanvas/usr/share/doc/ruby-goocanvas/examples/demo.rb

override_dh_compress:
	dh_compress -X.rb
