#!/usr/bin/make -f
%:
	dh $@ --with phpcomposer

override_dh_auto_build:
	dh_auto_build
	phpab \
		--output autoload.php \
		--template debian/autoload.php.tpl \
		--exclude Tests \
		.
	mkdir --parents vendor
	phpab \
		--output vendor/autoload.php \
		--template debian/autoload.tests.php.tpl \
		Tests
	# Mimic expected path for tests
	mkdir --parent Symfony
	ln -s .. Symfony/Contracts

override_dh_auto_clean:
	dh_auto_clean
	rm -rf vendor Symfony

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	phpunit
else
	@echo "** tests disabled"
endif
