1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
#!/usr/bin/make -f
include /usr/share/dpkg/default.mk
UPSTREAM := $(DEB_VERSION_UPSTREAM)
%:
dh $@
override_dh_auto_build:
# Build static classloader for shipping
phpabtpl \
--basedir src \
composer.json > \
debian/autoload.php.tpl
phpab --output src/Autoload.php \
--template debian/autoload.php.tpl src
# Build classloader for tests
mkdir --parents vendor data
phpabtpl \
--require-file ../PHPUnit/Autoload.php \
--require-file ../tests/_files/CoverageNamespacedFunctionTest.php \
--require-file ../tests/_files/CoveredFunction.php \
--require-file ../tests/_files/NamespaceCoveredFunction.php \
> debian/autoload.tests.php.tpl
phpab \
--output vendor/autoload.php \
--template debian/autoload.tests.php.tpl \
--exclude tests/end-to-end/migration/_files/possibility-to-migrate-from-92-is-detected/src/Greeter.php \
--exclude tests/end-to-end/migration/_files/possibility-to-migrate-from-92-is-detected/tests/GreeterTest.php \
--exclude tests/end-to-end/regression/2448/Test.php \
--exclude tests/end-to-end/regression/4376/tests/Test.php \
tests
# Workaround to ensure the local class takes precedence during tests.
ln -s src PHPUnit
# Mimic phpunit.xsd path
ln -s .. data/PHPUnit
override_dh_auto_clean:
override_dh_auto_test:
./phpunit
execute_before_dh_installman:
mkdir --parent $(CURDIR)/debian/tmp
help2man \
--help-option=\ \
--version-string=$(UPSTREAM) \
--source="phpunit $(UPSTREAM)" \
--no-info \
--include=$(CURDIR)/debian/phpunit.1.in \
"echo -n Usage: && ./phpunit --help|tail -n+4|sed 's/^ phpunit \[options\] <directory>/ or: phpunit [options] <directory>/'" \
> $(CURDIR)/debian/tmp/phpunit.1
execute_before_dh_installchangelogs:
for i in $$(ls ChangeLog-*.md -r); do cat $$i >> CHANGELOG; done
|