#!/usr/bin/make -f
#export DH_VERBOSE = 1

%:
	dh $@

execute_before_dh_auto_build:

	phpabtpl \
	        --basedir . \
	        composer.json \
	        > debian/autoload.php.tpl

	phpab --output autoload.php \
	        --template debian/autoload.php.tpl .

# not really needed yet
#execute_before_dh_auto_test:
#	mkdir --parents vendor matomo
#	phpabtpl \
#	        --require matomo/device-detector \
#	        --require phpspec/prophecy-phpunit \
#	        > debian/autoload.tests.php.tpl
#	phpab \
#	        --output vendor/autoload.php \
#	        --template debian/autoload.tests.php.tpl
#	        tests
#	# Workaround to ensure the local class takes precedence during tests.
#	ln -sr src matomo/device-detector

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	phpunit .
endif
