summaryrefslogtreecommitdiffstats
path: root/php-zendframework-zend-expressive-platesrenderer.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-11 15:08:19 +0100
committerRemi Collet <remi@remirepo.net>2017-12-11 15:08:19 +0100
commit1299c439141331897ca37250df235976a45f3113 (patch)
tree4672dbaf3d1f667d3bb58992bac2908e9363874a /php-zendframework-zend-expressive-platesrenderer.spec
parent54bfcc9b410d2918e93a55bc007f656297ec1dad (diff)
switch from zend-loader to fedora/autoloaderHEADmaster
Diffstat (limited to 'php-zendframework-zend-expressive-platesrenderer.spec')
-rw-r--r--php-zendframework-zend-expressive-platesrenderer.spec73
1 files changed, 40 insertions, 33 deletions
diff --git a/php-zendframework-zend-expressive-platesrenderer.spec b/php-zendframework-zend-expressive-platesrenderer.spec
index 4e7a5e5..d75152a 100644
--- a/php-zendframework-zend-expressive-platesrenderer.spec
+++ b/php-zendframework-zend-expressive-platesrenderer.spec
@@ -22,7 +22,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 1.3.2
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Plates integration for %{library}
Group: Development/Libraries
@@ -37,9 +37,9 @@ BuildArch: noarch
BuildRequires: php(language) >= 5.6
BuildRequires: php-composer(container-interop/container-interop) >= 1.2
BuildRequires: php-composer(league/plates) >= 3.3
-BuildRequires: php-composer(%{gh_owner}/zend-expressive-helpers) >= 2.2
-BuildRequires: php-composer(%{gh_owner}/zend-expressive-router) >= 1.3.2
-BuildRequires: php-composer(%{gh_owner}/zend-expressive-template) >= 1.0.4
+BuildRequires: php-autoloader(%{gh_owner}/zend-expressive-helpers) >= 2.2
+BuildRequires: php-autoloader(%{gh_owner}/zend-expressive-router) >= 1.3.2
+BuildRequires: php-autoloader(%{gh_owner}/zend-expressive-template) >= 1.0.4
BuildRequires: php-reflection
BuildRequires: php-spl
# From composer, "require-dev": {
@@ -52,11 +52,9 @@ BuildRequires: php-spl
%global phpunit %{_bindir}/phpunit
%endif
BuildRequires: %{phpunit}
-# 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",
@@ -70,12 +68,14 @@ Requires: php-composer(container-interop/container-interop) >= 1.2
Requires: php-composer(container-interop/container-interop) < 2
Requires: php-composer(league/plates) >= 3.3
Requires: php-composer(league/plates) < 4
-Requires: php-composer(%{gh_owner}/zend-expressive-helpers) >= 2.2
-Requires: php-composer(%{gh_owner}/zend-expressive-helpers) < 5
-Requires: php-composer(%{gh_owner}/zend-expressive-router) >= 1.3.2
-Requires: php-composer(%{gh_owner}/zend-expressive-router) < 3
-Requires: php-composer(%{gh_owner}/zend-expressive-template) >= 1.0.4
-Requires: php-composer(%{gh_owner}/zend-expressive-template) < 2
+Requires: php-autoloader(%{gh_owner}/zend-expressive-helpers) >= 2.2
+Requires: php-autoloader(%{gh_owner}/zend-expressive-helpers) < 5
+Requires: php-autoloader(%{gh_owner}/zend-expressive-router) >= 1.3.2
+Requires: php-autoloader(%{gh_owner}/zend-expressive-router) < 3
+Requires: php-autoloader(%{gh_owner}/zend-expressive-template) >= 1.0.4
+Requires: php-autoloader(%{gh_owner}/zend-expressive-template) < 2
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# From phpcompatinfo report for version 1.2.0
Requires: php-reflection
Requires: php-spl
@@ -85,15 +85,13 @@ Requires: php-spl
# "aura/di": "^3.2 to make use of Aura.Di dependency injection container",
# "zendframework/zend-servicemanager": "^3.2 to use zend-servicemanager for dependency injection"
%if 0%{?fedora} >= 21
-Suggests: php-composer(%{gh_owner}/aura/di)
-Suggests: php-composer(%{gh_owner}/zend-servicemanager)
+Suggests: php-autoloader(aura/di)
+Suggests: php-autoloader(%{gh_owner}/zend-servicemanager)
%endif
-# Autoloader
-Requires: php-composer(%{gh_owner}/zend-loader) >= 2.5
-Requires: php-zendframework-zend-loader >= 2.5.1-4
%endif
Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
+Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version}
%description
@@ -107,7 +105,9 @@ Documentation: http://zend-expressive.readthedocs.io/
mv LICENSE.md LICENSE
-: Create dependency autoloader
+
+%build
+: Create dependency autoloader - deprecated
cat << 'EOF' | tee autoload.php
<?php
require_once '%{php_home}/League/Plates/autoload.php';
@@ -116,9 +116,21 @@ if (file_exists('%{php_home}/Aura/Di/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}/Interop/Container/autoload.php',
+ '%{php_home}/League/Plates/autoload.php',
+ '%{php_home}/Zend/Expressive/Helper/autoload.php',
+ '%{php_home}/Zend/Expressive/Router/autoload.php',
+ '%{php_home}/Zend/Expressive/Template/autoload.php',
+]);
+\Fedora\Autoloader\Dependencies::optional([
+ '%{php_home}/Aura/Di/autoload.php',
+ '%{php_home}/Zend/ServiceManager/autoload.php',
+]);
+EOF
%install
@@ -133,16 +145,8 @@ install -m644 autoload.php %{buildroot}%{php_home}/Zend/%{library}-%{sublib}-aut
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}\\%{sublib}' => dirname(__DIR__).'/test/',
- 'Zend\\%{library}\\%{sublib}' => '%{buildroot}%{php_home}/Zend/%{library}/%{sublib}'
-))));
-require_once '%{php_home}/Zend/autoload.php';
+require_once '%{buildroot}%{php_home}/Zend/%{library}/%{sublib}/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\%{sublib}', dirname(__DIR__) . '/test');
EOF
ret=0
@@ -168,6 +172,9 @@ exit $ret
%changelog
+* Mon Dec 11 2017 Remi Collet <remi@remirepo.net> - 1.3.2-2
+- switch from zend-loader to fedora/autoloader
+
* Thu Nov 2 2017 Remi Collet <remi@remirepo.net> - 1.3.2-1
- Update to 1.3.2