summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-zendframework-zend-expressive-template.spec43
1 files changed, 24 insertions, 19 deletions
diff --git a/php-zendframework-zend-expressive-template.spec b/php-zendframework-zend-expressive-template.spec
index b9d02f4..d900baa 100644
--- a/php-zendframework-zend-expressive-template.spec
+++ b/php-zendframework-zend-expressive-template.spec
@@ -22,7 +22,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 1.0.4
-Release: 1%{?dist}
+Release: 4%{?dist}
Summary: %{sublib} subcomponent for %{library}
Group: Development/Libraries
@@ -40,13 +40,15 @@ BuildRequires: php-spl
# "phpunit/phpunit": "^4.7",
# "zendframework/zend-coding-standard": "~1.0.0"
BuildRequires: php-composer(phpunit/phpunit) >= 4.7
-# Autoloader
-BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5
%endif
+# Autoloader
+BuildRequires: php-fedora-autoloader-devel
# From composer, "require": {
# "php": ">=5.5"
Requires: php(language) >= 5.5
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# From phpcompatinfo report for version 1.0.3
Requires: php-spl
%if ! %{bootstrap}
@@ -55,15 +57,14 @@ Requires: php-spl
# "zendframework/zend-expressive-twigrenderer": "^0.1 to use the Twig template renderer",
# "zendframework/zend-expressive-zendviewrenderer": "^0.1 to use the zend-view PhpRenderer template renderer"
%if 0%{?fedora} >= 21
-Suggests: php-composer(%{gh_owner}/zend-expressive-platesrenderer)
-Suggests: php-composer(%{gh_owner}/zend-expressive-twigrenderer)
-Suggests: php-composer(%{gh_owner}/zend-expressive-zendviewrenderer)
+Suggests: php-autoloader(%{gh_owner}/zend-expressive-platesrenderer)
+Suggests: php-autoloader(%{gh_owner}/zend-expressive-twigrenderer)
+Suggests: php-autoloader(%{gh_owner}/zend-expressive-zendviewrenderer)
%endif
-# Autoloader
-Requires: php-composer(%{gh_owner}/zend-loader) >= 2.5
%endif
Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
+Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version}
%description
@@ -92,7 +93,15 @@ mv LICENSE.md LICENSE
%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::optional([
+ '%{php_home}/Zend/%{library}/Plates/autoload.php',
+ '%{php_home}/Zend/%{library}/Twig/autoload.php',
+ '%{php_home}/Zend/%{library}/ZendView/autoload.php',
+]);
+EOF
%install
@@ -105,16 +114,8 @@ cp -pr src %{buildroot}%{php_home}/Zend/%{library}/%{sublib}
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
@@ -134,11 +135,15 @@ exit $ret
%license LICENSE
%doc *.md
%doc composer.json
+%dir %{php_home}/Zend
%dir %{php_home}/Zend/%{library}/
%{php_home}/Zend/%{library}/%{sublib}/
%changelog
+* Mon Dec 11 2017 Remi Collet <remi@remirepo.net> - 1.1.10-4
+- switch from zend-loader to fedora/autoloader
+
* Thu Jan 12 2017 Remi Collet <remi@fedoraproject.org> - 1.0.4-1
- update to 1.0.4