#!/usr/bin/make -f

# In order to regenerate 'debian/control' :
#   DEB_AUTO_UPDATE_DEBIAN_CONTROL=yes fakeroot debian/rules clean
# Then check manually if everything's ok

include /usr/share/cdbs/1/rules/debhelper.mk

# work around a bug in the ruby CDBS class
include /usr/share/ruby-pkg-tools/1/class/ruby-common.mk
DEB_RUBY_SIMPLE_PACKAGES := $(strip $(filter-out %-doc,$(DEB_RUBY_SIMPLE_PACKAGES)))

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

DISABLED_PLUGINS = shortenurls dictclient

DEB_RUBY_CONFIG_ARGS += --shebang=never


build/rbot::
	rake makemo
	rake manpages

install/rbot::
	# disabled plugins
	for PL in $(DISABLED_PLUGINS); do \
		mv debian/rbot/usr/share/rbot/plugins/$${PL}.rb debian/rbot/usr/share/rbot/plugins/$${PL}.rb.disabled; \
	done
	# broken manpage install
	rm debian/$(cdbs_curpkg)/usr/share/man/*

clean::
	rm -rf data/locale
	rm -f man/*.1
	rm -f lib/rbot/pkgconfig.rb
	find . -empty \( -name '*.pot' -o -name '*.po' \) -delete

