summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-06 16:17:48 +0100
committerRemi Collet <remi@remirepo.net>2017-12-06 16:17:48 +0100
commit978486b2b145f9d9b4b953821ba0e2260c484a43 (patch)
treee8b74430f619fe14f101311aee85772923bec858
parent03820074d7eb75dfbcf878455fff51df0b3f20e6 (diff)
switch from zend-loader to fedora/autoloader
-rw-r--r--php-zendframework-zend-servicemanager-di.spec56
1 files changed, 27 insertions, 29 deletions
diff --git a/php-zendframework-zend-servicemanager-di.spec b/php-zendframework-zend-servicemanager-di.spec
index eef6714..97e397e 100644
--- a/php-zendframework-zend-servicemanager-di.spec
+++ b/php-zendframework-zend-servicemanager-di.spec
@@ -21,7 +21,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 1.1.1
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Zend Framework ServiceManager-%{library} component
Group: Development/Libraries
@@ -35,18 +35,16 @@ BuildArch: noarch
%if %{with_tests}
BuildRequires: php(language) >= 5.6
BuildRequires: php-composer(container-interop/container-interop) >= 1.1
-BuildRequires: php-composer(%{gh_owner}/zend-di) >= 2.6
-BuildRequires: php-composer(%{gh_owner}/zend-servicemanager) >= 3.0.3
+BuildRequires: php-autoloader(%{gh_owner}/zend-di) >= 2.6
+BuildRequires: php-autoloader(%{gh_owner}/zend-servicemanager) >= 3.0.3
BuildRequires: php-spl
# From composer, "require-dev": {
# "phpunit/phpunit": "^4.5",
# "zendframework/zend-coding-standard": "~1.0.0"
BuildRequires: php-composer(phpunit/phpunit) >= 4.0
-# Autoloader
-BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5
-# For dependencies autoloader
-BuildRequires: php-zendframework-zend-loader >= 2.5.1-3
%endif
+# Autoloader
+BuildRequires: php-fedora-autoloader-devel
# From composer, "require": {
# "php": "^5.6 || ^7.0",
@@ -56,19 +54,17 @@ BuildRequires: php-zendframework-zend-loader >= 2.5.1-3
Requires: php(language) >= 5.6
Requires: php-composer(container-interop/container-interop) >= 1.1
Requires: php-composer(container-interop/container-interop) < 2
-Requires: php-composer(%{gh_owner}/zend-di) >= 2.6
-Requires: php-composer(%{gh_owner}/zend-di) < 3
-Requires: php-composer(%{gh_owner}/zend-servicemanager) >= 3.0.3
-Requires: php-composer(%{gh_owner}/zend-servicemanager) < 4
+Requires: php-autoloader(%{gh_owner}/zend-di) >= 2.6
+Requires: php-autoloader(%{gh_owner}/zend-di) < 3
+Requires: php-autoloader(%{gh_owner}/zend-servicemanager) >= 3.0.3
+Requires: php-autoloader(%{gh_owner}/zend-servicemanager) < 4
# From phpcompatinfo report for version 1.1.0
Requires: php-spl
-%if ! %{bootstrap}
# Autoloader
-Requires: php-composer(%{gh_owner}/zend-loader) >= 2.5
-Requires: php-zendframework-zend-loader >= 2.5.1-3
-%endif
+Requires: php-composer(fedora/autoloader)
Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
+Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version}
%description
@@ -82,15 +78,22 @@ Documentation: https://zendframework.github.io/%{gh_project}/
mv LICENSE.md LICENSE
-: Create dependency autoloader
+%build
+: Create dependency autoloader - deprecated
cat << 'EOF' | tee autoload.php
<?php
require_once '%{php_home}/Interop/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}/Interop/Container/autoload.php',
+ '%{php_home}/Zend/Di/autoload.php',
+ '%{php_home}/Zend/ServiceManager/autoload.php',
+]);
+EOF
%install
@@ -105,16 +108,8 @@ install -m644 autoload.php %{buildroot}%{php_home}/Zend/ServiceManager-%{library
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\\ServiceManager\\%{library}' => dirname(__DIR__).'/test/',
- 'Zend\\ServiceManager\\%{library}' => '%{buildroot}%{php_home}/Zend/ServiceManager/%{library}'
-))));
-require_once '%{php_home}/Zend/autoload.php';
+require_once '%{buildroot}%{php_home}/Zend/ServiceManager/%{library}/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\ServiceManager\\%{library}\\', dirname(__DIR__) . '/test');
EOF
ret=0
@@ -139,6 +134,9 @@ exit $ret
%changelog
+* Wed Dec 6 2017 Remi Collet <remi@remirepo.net> - 1.1.1-2
+- switch from zend-loader to fedora/autoloader
+
* Fri Sep 29 2017 Remi Collet <remi@remirepo.net> - 1.1.1-1
- Update to 1.1.1