#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/ruby-pkg-tools/1/class/ruby-setup-rb.mk

common-binary-indep::
	# Deal with the catstomp and stompcat binaries by putting them
	# into libstomp-ruby and fixing them to use /usr/bin/ruby
	install -d -m 755 -o root -g root debian/libstomp-ruby/usr/
	cp -a debian/$(firstword $(DEB_RUBY_REAL_LIB_PACKAGES))/usr/bin/ debian/libstomp-ruby/usr/bin/
	for script in `find debian/libstomp-ruby/usr/bin/ -type f`; do \
		sed -i -e "1s%.*%#! /usr/bin/ruby%" $$script ; \
	done
	for pkg in $(DEB_RUBY_REAL_LIB_PACKAGES); do \
		rm -fr debian/$$pkg/usr/bin/; \
	done
