#!/usr/bin/make -f

PERL    ?= /usr/bin/perl

%:
	dh $@

override_dh_auto_configure:
	# Run network tests only if localhost is reachable, the perl snippet touch
	# run_network_tests if the loopback interface is available.
	$(PERL) -MNet::Ping -e '(Net::Ping->new()->ping("127.0.0.1", 1)) ? \
	        system("touch run_network_tests") : system("rm -rf run_network_tests");'
	dh_auto_configure

override_dh_auto_test:
	NO_NETWORK=1 AUTOMATED_TESTING=1 dh_auto_test
