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

override_dh_auto_build:
	phpab \
		--output phpseclib/phpseclib.autoloader.php \
		--template debian/autoload.php.tpl \
		phpseclib
	cp phpseclib/bootstrap.php phpseclib/phpseclib.bootstrap.php
	mkdir --parents vendor
	phpab \
		--output vendor/autoload.php \
		--template debian/autoload.test.php.tpl \
	tests

override_dh_auto_test:
	phpunit --include-path phpseclib --bootstrap vendor/autoload.php
	phpcs -s --extensions=php --standard=build/code-sniffer-ruleset.xml phpseclib
	phpcs -s --extensions=php --standard=build/code-sniffer-ruleset-tests.xml tests

override_dh_install:
	dh_install -Xopenssl.cnf -Xphpseclib/bootstrap.php