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
|
#!/usr/bin/make -f
include /usr/share/dpkg/default.mk
UPSTREAM := $(DEB_VERSION_UPSTREAM)
%:
dh $@ --with phpcomposer
override_dh_auto_build:
# Build static classloader for shipping
phpab --output src/Autoload.php \
--template debian/Autoload.php.tpl src
# Build classloader for tests
mkdir --parents vendor
phpab \
--output vendor/autoload.php \
--template debian/autoload.test.php.tpl \
--exclude tests/_files/BankAccountTest2.php \
--exclude tests/end-to-end/regression/Trac/783/OneTest.php \
tests
# Workaround to ensure the local class takes precedence during tests.
ln -s src PHPUnit
# Provide phpunit.xsd where it belongs
cp phpunit.xsd src
override_dh_auto_clean:
override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
./phpunit
else
@echo "** tests disabled"
endif
override_dh_installman:
mkdir --parent $(CURDIR)/debian/tmp
help2man \
--help-option=\ \
--version-string=$(UPSTREAM) \
--no-info \
--include=$(CURDIR)/debian/phpunit.1.in \
"./phpunit --help|tail -n+3|sed 's/^ phpunit/ or: phpunit/'" \
> $(CURDIR)/debian/tmp/phpunit.1
dh_installman
override_dh_installchangelogs:
for i in $$(ls ChangeLog-*.md -r); do cat $$i >> CHANGELOG; done
dh_installchangelogs
|