summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-11 15:16:22 +0100
committerRemi Collet <remi@remirepo.net>2017-12-11 15:16:22 +0100
commitf7b10d56532cc25b220e3a13a502b70cf2bb7ec6 (patch)
treec89bc31e19e3be18d25f22d6778e7ef24cbb59a8
parent8218fabb6187e7562462fd89e5b76c5f72a0d26d (diff)
switch from zend-loader to fedora/autoloaderHEADmaster
-rw-r--r--php-zendframework-zend-expressive-twigrenderer.spec76
1 files changed, 43 insertions, 33 deletions
diff --git a/php-zendframework-zend-expressive-twigrenderer.spec b/php-zendframework-zend-expressive-twigrenderer.spec
index 5d04ad7..a5e779a 100644
--- a/php-zendframework-zend-expressive-twigrenderer.spec
+++ b/php-zendframework-zend-expressive-twigrenderer.spec
@@ -22,7 +22,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 1.5.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Twig integration for %{library}
Group: Development/Libraries
@@ -40,9 +40,9 @@ BuildRequires: php-composer(psr/container) >= 1.0
# test suite fails with v2
BuildRequires: php-composer(twig/twig) < 2
BuildRequires: php-composer(twig/twig) >= 1.32
-BuildRequires: php-composer(%{gh_owner}/zend-expressive-helpers) >= 1.4
-BuildRequires: php-composer(%{gh_owner}/zend-expressive-router) >= 1.3.2
-BuildRequires: php-composer(%{gh_owner}/zend-expressive-template) >= 1.0
+BuildRequires: php-autoloader(%{gh_owner}/zend-expressive-helpers) >= 1.4
+BuildRequires: php-autoloader(%{gh_owner}/zend-expressive-router) >= 1.3.2
+BuildRequires: php-autoloader(%{gh_owner}/zend-expressive-template) >= 1.0
BuildRequires: php-pcre
BuildRequires: php-spl
# From composer, "require-dev": {
@@ -55,11 +55,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",
@@ -73,12 +71,14 @@ Requires: php-composer(psr/container) >= 1.0
Requires: php-composer(psr/container) < 2
Requires: php-composer(twig/twig) >= 1.32
Requires: php-composer(twig/twig) < 3
-Requires: php-composer(%{gh_owner}/zend-expressive-helpers) >= 1.4
-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) >= 1.4
+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-pcre
Requires: php-spl
@@ -88,15 +88,13 @@ Requires: php-spl
# "aura/di": "3.0.*@beta to make use of Aura.Di dependency injection container",
# "zendframework/zend-servicemanager": "^2.5 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-composer(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
@@ -110,7 +108,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
if (file_exists('%{php_home}/Twig/autoload.php')) {
@@ -124,9 +124,24 @@ if (file_exists('%{php_home}/Aura/Di/autoload.php')) {
require_once '%{php_home}/Psr/Container/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/Container/autoload.php',
+ [
+ '%{php_home}/Twig/autoload.php',
+ '%{php_home}/Twig2/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
@@ -141,16 +156,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
@@ -176,6 +183,9 @@ exit $ret
%changelog
+* Mon Dec 11 2017 Remi Collet <remi@remirepo.net> - 1.5.0-2
+- switch from zend-loader to fedora/autoloader
+
* Sun Aug 13 2017 Remi Collet <remi@remirepo.net> - 1.5.0-1
- Update to 1.5.0
- add dependency on psr/container