From 45665b6eafb4d0eebf72a5471e8b516b8bac6cab Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 21 Dec 2020 16:10:12 +0100 Subject: add classmap autoloader --- php-nikic-fast-route-tests-autoloader.php | 10 -------- php-nikic-fast-route.spec | 38 +++++++++++++++++++++---------- 2 files changed, 26 insertions(+), 22 deletions(-) delete mode 100644 php-nikic-fast-route-tests-autoloader.php diff --git a/php-nikic-fast-route-tests-autoloader.php b/php-nikic-fast-route-tests-autoloader.php deleted file mode 100644 index c484d51..0000000 --- a/php-nikic-fast-route-tests-autoloader.php +++ /dev/null @@ -1,10 +0,0 @@ -= 5.4 BuildRequires: php-pcre @@ -35,13 +35,17 @@ BuildRequires: php-spl # "phpunit/phpunit": "^4.8.35|~5.7" BuildRequires: php-composer(phpunit/phpunit) >= 4.8.35 %endif +# Autoloader +BuildRequires: php-fedora-autoloader-devel # From composer.json, "require": { # "php": ">=5.4", Requires: php(language) >= 5.4 -# From phpcompatinfo 5.0.0 report for version 1.0.0 +# From phpcompatinfo report for version 1.3.0 Requires: php-pcre Requires: php-spl +# Autoloader +BuildRequires: php-composer(fedora/autoloader) Provides: php-composer(%{gh_owner}/%{pk_project}) = %{version} @@ -52,7 +56,7 @@ Fast implementation of a regular expression based router. Documentation: http://nikic.github.io/2014/02/18/Fast-request-routing-using-regular-expressions.html -Autoloader: %{php_home}/%{gh_project}/bootstrap.php +Autoloader: %{php_home}/%{gh_project}/autoload.php %prep @@ -60,7 +64,15 @@ Autoloader: %{php_home}/%{gh_project}/bootstrap.php %build -#Nothing to build +phpab --template fedora --output src/autoload.php src +cat << 'EOF' | tee -a src/autoload.php +require_once __DIR__ . '/functions.php'; +EOF + +phpab --template fedora --output test/bootstrap.php test +cat << 'EOF' | tee -a test/bootstrap.php +require_once '%{buildroot}%{php_home}/%{gh_project}/autoload.php'; +EOF %install @@ -70,15 +82,13 @@ cp -pr src %{buildroot}%{php_home}/%{gh_project} %check -%if %{with_tests} -#ensure tests are not ran against local sources +%if %{with tests} +# ensure tests are not ran against local sources rm -rf src -cp %{SOURCE1} test/bootstrap.php -sed -e "s|BUILDROOT_PATH|%{buildroot}/%{php_home}/%{gh_project}|" -i test/bootstrap.php : Run upstream test suite ret=0 -for cmd in php php70 php71 php72; do +for cmd in php php72 php73 php74 php80; do if which $cmd; then $cmd %{_bindir}/phpunit --verbose || ret=1 fi @@ -90,6 +100,7 @@ exit $ret %files +# remirepo:1 %{!?_licensedir:%global license %%doc} %license LICENSE %doc composer.json @@ -98,6 +109,9 @@ exit $ret %changelog +* Mon Dec 21 2020 Remi Collet - 1.3.0-6 +- add classmap autoloader + * Wed Feb 14 2018 Remi Collet - 1.3.0-1 - Update to 1.3.0 -- cgit