summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-13 11:09:19 +0100
committerRemi Collet <remi@remirepo.net>2017-12-13 11:09:19 +0100
commitc54e94d87910e59bb5138293f19f9067103bd8fa (patch)
treee79d354944054da4c0cb5071254ea87045d78508
parentb729aec85eeb83c3baa62a540dda902afb169dec (diff)
switch from zend-loader to fedora/autoloader
-rw-r--r--php-zendframework-zend-mvc-plugin-flashmessenger.spec56
1 files changed, 29 insertions, 27 deletions
diff --git a/php-zendframework-zend-mvc-plugin-flashmessenger.spec b/php-zendframework-zend-mvc-plugin-flashmessenger.spec
index 8551534..d1c481c 100644
--- a/php-zendframework-zend-mvc-plugin-flashmessenger.spec
+++ b/php-zendframework-zend-mvc-plugin-flashmessenger.spec
@@ -21,7 +21,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 1.0.0
-Release: 1%{?dist}
+Release: 4%{?dist}
Summary: Zend Framework Mvc-Plugin-%{library} component
Group: Development/Libraries
@@ -34,19 +34,17 @@ BuildArch: noarch
# Tests
%if %{with_tests}
BuildRequires: php(language) >= 5.6
-BuildRequires: php-composer(%{gh_owner}/zend-mvc) >= 3.0
-BuildRequires: php-composer(%{gh_owner}/zend-session) >= 2.6.2
-BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7.5
+BuildRequires: php-autoloader(%{gh_owner}/zend-mvc) >= 3.0
+BuildRequires: php-autoloader(%{gh_owner}/zend-session) >= 2.6.2
+BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7.5
BuildRequires: php-spl
# From composer, "require-dev": {
# "phpunit/PHPUnit": "^4.5",
# "squizlabs/php_codesniffer": "^2.3.1"
BuildRequires: php-composer(phpunit/phpunit) >= 4.5
-BuildRequires: php-composer(%{gh_owner}/zend-filter) >= 2.6.1
-BuildRequires: php-composer(%{gh_owner}/zend-form) >= 2.7
-# Autoloader
-BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5
%endif
+# Autoloader
+BuildRequires: php-fedora-autoloader-devel
# From composer, "require": {
# "php": "^5.6 || ^7.0",
@@ -54,20 +52,19 @@ BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5
# "zendframework/zend-session": "^2.6.2",
# "zendframework/zend-stdlib": "^2.7 || ^3.0"
Requires: php(language) >= 5.6
-Requires: php-composer(%{gh_owner}/zend-mvc) >= 3.0
-Requires: php-composer(%{gh_owner}/zend-mvc) < 4
-Requires: php-composer(%{gh_owner}/zend-session) >= 2.6.2
-Requires: php-composer(%{gh_owner}/zend-session) < 3
-Requires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7
-Requires: php-composer(%{gh_owner}/zend-stdlib) < 4
+Requires: php-autoloader(%{gh_owner}/zend-mvc) >= 3.0
+Requires: php-autoloader(%{gh_owner}/zend-mvc) < 4
+Requires: php-autoloader(%{gh_owner}/zend-session) >= 2.6.2
+Requires: php-autoloader(%{gh_owner}/zend-session) < 3
+Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7
+Requires: php-autoloader(%{gh_owner}/zend-stdlib) < 4
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# From phpcompatinfo report for version 1.0.0
Requires: php-spl
-%if ! %{bootstrap}
-# 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
@@ -90,7 +87,15 @@ mv LICENSE.md LICENSE
%build
-# Empty build section, nothing required
+: Generate autoloader
+phpab --template fedora --output src/autoload.php src
+cat << 'EOF' | tee -a src/autoload.php
+\Fedora\Autoloader\Dependencies::required([
+ '%{php_home}/Zend/Mvc/autoload.php',
+ '%{php_home}/Zend/Session/autoload.php',
+ '%{php_home}/Zend/Stdlib/autoload.php',
+]);
+EOF
%install
@@ -103,14 +108,8 @@ cp -pr src %{buildroot}%{php_home}/Zend/Mvc/Plugin/%{library}
mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
-require_once '%{php_home}/Zend/Loader/AutoloaderFactory.php';
-Zend\Loader\AutoloaderFactory::factory(array(
- 'Zend\Loader\StandardAutoloader' => array(
- 'namespaces' => array(
- 'ZendTest\\Mvc\\Plugin\\%{library}' => dirname(__DIR__).'/test/',
- 'Zend\\Mvc\\Plugin\\%{library}' => '%{buildroot}%{php_home}/Zend/Mvc/Plugin/%{library}'
-))));
-require_once '%{php_home}/Zend/autoload.php';
+require_once '%{buildroot}%{php_home}/Zend/Mvc/Plugin/%{library}/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\Mvc\\Plugin\\%{library}\\', dirname(__DIR__) . '/test');
EOF
ret=0
@@ -134,6 +133,9 @@ exit $ret
%changelog
+* Wed Dec 13 2017 Remi Collet <remi@remirepo.net> - 1.0.0-4
+- switch from zend-loader to fedora/autoloader
+
* Wed Jun 29 2016 Remi Collet <remi@fedoraproject.org> - 1.0.0-1
- initial package