#!/usr/bin/make -f

PACKAGE = $(shell dh_listpackages)
TMP     = $(CURDIR)/debian/$(PACKAGE)

%:
	dh $@

override_dh_auto_test:
	#Since debian build systems do not have internet accessuse, we need to avoid all the tests that needs it
	#use CONNECTED_TO_NET=1 when the build host does have internet access.
	CONNECTED_TO_NET=0 dh_auto_test

override_dh_auto_install:
	dh_auto_install
	rm $(TMP)/usr/bin/bot-basicbot-pluggable-cgi
	rm $(TMP)/usr/bin/bot-basicbot-pluggable-cli
	rm $(TMP)/usr/bin/bot-basicbot-pluggable-infobot-upgrade
	rm $(TMP)/usr/bin/storable2dbi.pl

override_dh_installexamples:
	dh_installexamples
	sed -i '1s|^#!perl|#!/usr/bin/perl|' $(TMP)/usr/share/doc/$(PACKAGE)/examples/storable2dbi.pl
	sed -i '1s|^#!/usr/local/bin/perl|#!/usr/bin/perl -w|' $(TMP)/usr/share/doc/$(PACKAGE)/examples/bot-basicbot-pluggable-cgi
