#!/usr/bin/make -f

%:
	dh $@

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

ruby_versions = $(shell dh_ruby --print-supported)

.PHONY: $(ruby_versions)

override_dh_auto_install: $(ruby_versions)
	dh_auto_install

$(ruby_versions):
	debian/build $@

override_dh_strip:
	for i in atk cairo-gobject gio2 glib2 gobject-introspection gstreamer gtk2 gtk3 gtksourceview2 pango poppler rsvg2 ; do \
		dh_strip -pruby-$$i --ddeb-migration="ruby-$$i-dbg (<< 3.0.9-1~)" ; \
	done
	dh_strip

override_dh_fixperms-arch:
	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-gtk3/usr/share/doc/ruby-gtk3/examples/misc/properties.rb

override_dh_compress:
	dh_compress -X.rb

override_dh_shlibdeps:
	dh_shlibdeps
	dh_ruby_fixdepends
