#!/usr/bin/make -f
# -*- makefile-gmake -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

RUBY = ruby1.9.1
RUBYLIBDIR = $(shell ruby1.9.1 -rrbconfig -e 'puts RbConfig::CONFIG["rubylibdir"]')
RUBYARCHDIR = $(shell ruby1.9.1 -rrbconfig -e 'puts RbConfig::CONFIG["archdir"]')

%:
	dh $@

override_dh_auto_clean:
	dh_auto_clean
	rm -f config.sub config.guess

override_dh_auto_configure:
	ln -sf /usr/share/misc/config.sub .
	ln -sf /usr/share/misc/config.guess .
	dh_auto_configure -- --with-ruby=$(RUBY) \
	    --with-rubylibdir=$(RUBYLIBDIR) --with-rubyarchdir=$(RUBYARCHDIR)
