summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-09 09:19:38 +0100
committerRemi Collet <remi@remirepo.net>2017-12-09 09:19:38 +0100
commit47fec4af1024dcb53ca0e09788ac54fbaea2877c (patch)
treea98559d794e401f28e591c3fc76a97c2a313b668
parente1aa329769a786d57f8f20683a8654dda42616b1 (diff)
switch from zend-loader to fedora/autoloader
-rw-r--r--php-zendframework-zend-stratigility.spec57
1 files changed, 30 insertions, 27 deletions
diff --git a/php-zendframework-zend-stratigility.spec b/php-zendframework-zend-stratigility.spec
index 608f75d..97af6db 100644
--- a/php-zendframework-zend-stratigility.spec
+++ b/php-zendframework-zend-stratigility.spec
@@ -21,7 +21,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 1.3.3
-Release: 1%{?dist}
+Release: 4%{?dist}
Summary: Middleware for PHP
Group: Development/Libraries
@@ -35,7 +35,7 @@ BuildArch: noarch
%if %{with_tests}
BuildRequires: php(language) >= 5.6
BuildRequires: php-composer(psr/http-message) >= 1.0
-BuildRequires: php-composer(%{gh_owner}/zend-escaper) >= 2.3
+BuildRequires: php-autoloader(%{gh_owner}/zend-escaper) >= 2.3
BuildRequires: php-composer(http-interop/http-middleware) >= 0.2
BuildRequires: php-pcre
BuildRequires: php-reflection
@@ -44,13 +44,11 @@ BuildRequires: php-spl
# "zendframework/zend-diactoros": "^1.0",
# "phpunit/phpunit": "^5.6",
# "zendframework/zend-coding-standard": "~1.0.0"
-BuildRequires: php-composer(%{gh_owner}/zend-diactoros) >= 1.0
+BuildRequires: php-autoloader(%{gh_owner}/zend-diactoros) >= 1.0
BuildRequires: php-composer(phpunit/phpunit) >= 5.6
-# Autoloader
-BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5
-# For dependencies autoloader
-BuildRequires: php-zendframework-zend-loader >= 2.5.1-4
%endif
+# Autoloader
+BuildRequires: php-fedora-autoloader-devel
# From composer, "require": {
# "php": "^5.6 || ^7.0",
@@ -60,23 +58,23 @@ BuildRequires: php-zendframework-zend-loader >= 2.5.1-4
Requires: php(language) >= 5.6
Requires: php-composer(psr/http-message) >= 1.0
Requires: php-composer(psr/http-message) < 2
-Requires: php-composer(%{gh_owner}/zend-escaper) >= 2.3
-Requires: php-composer(%{gh_owner}/zend-escaper) < 3
+Requires: php-autoloader(%{gh_owner}/zend-escaper) >= 2.3
+Requires: php-autoloader(%{gh_owner}/zend-escaper) < 3
Requires: php-composer(http-interop/http-middleware) >= 0.2
# From composer, "suggest": {
# "psr/http-message-implementation": "Please install a psr/http-message-implementation to consume Stratigility; e.g., zendframework/zend-diactoros"
%if 0%{?fedora} >= 21
-Suggests: php-composer(%{gh_owner}/zend-diactoros)
+Suggests: php-autoloader(%{gh_owner}/zend-diactoros)
%endif
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# From phpcompatinfo report for version 2.7.4
Requires: php-pcre
Requires: php-reflection
Requires: php-spl
-# Autoloader
-Requires: php-composer(%{gh_owner}/zend-loader) >= 2.5
-Requires: php-zendframework-zend-loader >= 2.5.1-4
Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
+Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version}
%description
@@ -97,15 +95,25 @@ It allows you to create and dispatch middleware pipelines.
mv LICENSE.md LICENSE
-: Create dependency autoloader
+%build
+: Create dependency autoloader - deprecated
cat << 'EOF' | tee autoload.php
<?php
require_once '%{php_home}/Interop/Http/Middleware/autoload.php';
EOF
-
-%build
-# Empty build section, nothing required
+: Create autoloader
+phpab --template fedora --output src/autoload.php src
+cat << 'EOF' | tee -a src/autoload.php
+\Fedora\Autoloader\Dependencies::required([
+ '%{php_home}/Psr/Http/Message/autoload.php',
+ '%{php_home}/Zend/Escaper/autoload.php',
+ '%{php_home}/Interop/Http/Middleware/autoload.php',
+]);
+\Fedora\Autoloader\Dependencies::optional([
+ '%{php_home}/Zend/Diactoros/autoload.php',
+]);
+EOF
%install
@@ -120,16 +128,8 @@ install -m644 autoload.php %{buildroot}%{php_home}/Zend/%{library}-autoload.php
mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
-define('RPM_BUILDROOT', '%{buildroot}%{php_home}/Zend');
-
-require_once '%{php_home}/Zend/Loader/AutoloaderFactory.php';
-Zend\Loader\AutoloaderFactory::factory(array(
- 'Zend\Loader\StandardAutoloader' => array(
- 'namespaces' => array(
- 'ZendTest\\%{library}' => dirname(__DIR__).'/test/',
- 'Zend\\%{library}' => '%{buildroot}%{php_home}/Zend/%{library}'
-))));
-require_once '%{php_home}/Zend/autoload.php';
+require_once '%{buildroot}%{php_home}/Zend/%{library}/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test');
EOF
ret=0
@@ -154,6 +154,9 @@ exit $ret
%changelog
+* Sat Dec 9 2017 Remi Collet <remi@remirepo.net> - 1.3.3-4
+- switch from zend-loader to fedora/autoloader
+
* Tue Jan 24 2017 Remi Collet <remi@fedoraproject.org> - 1.3.3-1
- update to 1.3.3