summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-13 11:20:10 +0100
committerRemi Collet <remi@remirepo.net>2017-12-13 11:20:10 +0100
commit0bb890d6fe5c986acc7f128f963c87400c2d6291 (patch)
tree73b6cefc085cb7ae4b4d7fcfd78e7fe55cd0ab59
parentd9247acf0bf64422da140840d301fe5323400ab1 (diff)
switch from zend-loader to fedora/autoloader
-rw-r--r--php-zendframework-zend-mvc-plugin-prg.spec56
1 files changed, 29 insertions, 27 deletions
diff --git a/php-zendframework-zend-mvc-plugin-prg.spec b/php-zendframework-zend-mvc-plugin-prg.spec
index 4b2df50..752ee23 100644
--- a/php-zendframework-zend-mvc-plugin-prg.spec
+++ b/php-zendframework-zend-mvc-plugin-prg.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,18 +34,16 @@ 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
# 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",
@@ -53,20 +51,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
# Nothing
-%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
@@ -84,7 +81,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
@@ -97,14 +102,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
@@ -128,6 +127,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