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

override_dh_auto_build:
	phpabtpl composer.json > debian/autoload.php.tpl
	sed -i "s#'/usr/share/php/Symfony#__DIR__ . '/..#" debian/autoload.php.tpl
	phpab \
		--output src/autoload.php \
		--template debian/autoload.php.tpl \
		src

execute_before_dh_auto_test:
	mkdir --parents vendor
	phpabtpl \
		--require-file ../src/autoload.php \
		--require symfony/framework-bundle \
		--require symfony/http-client \
		--require symfony/twig-bundle \
		--require symfony/web-link \
		> debian/autoload.tests.php.tpl
	phpab \
		--output vendor/autoload.php \
		--template debian/autoload.tests.php.tpl \
		tests
	ln -s /usr/share/php/Symfony/Bundle
	ln -s /usr/share/php/Symfony/Component
	ln -s /usr/share/php/Symfony/Contracts

override_dh_auto_test:
	phpunit --exclude-group Composer
