summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-04 16:01:30 +0100
committerRemi Collet <remi@remirepo.net>2017-12-04 16:01:30 +0100
commit87698231b5fc1ef446e84de3744f247800fb58ad (patch)
treef5d7a3d9ddf60e6737bd45782dca44885d836a34
parent21ed5b81f6fa87e71b5e74c747d2760cd1c3b5f5 (diff)
switch from zend-loader to fedora/autoloader
-rw-r--r--php-zendframework-zend-crypt.spec54
1 files changed, 27 insertions, 27 deletions
diff --git a/php-zendframework-zend-crypt.spec b/php-zendframework-zend-crypt.spec
index ded9fa7..f9b27de 100644
--- a/php-zendframework-zend-crypt.spec
+++ b/php-zendframework-zend-crypt.spec
@@ -21,7 +21,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 3.2.1
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Zend Framework %{library} component
Group: Development/Libraries
@@ -43,18 +43,16 @@ BuildRequires: php-hash
BuildRequires: php-openssl
BuildRequires: php-pcre
BuildRequires: php-spl
-BuildRequires: php-composer(%{gh_owner}/zend-math) >= 2.5
-BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.5
+BuildRequires: php-autoloader(%{gh_owner}/zend-math) >= 2.5
+BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.5
BuildRequires: php-composer(container-interop/container-interop) >= 1.0
# From composer, "require-dev": {
# "squizlabs/php_codesniffer": "^2.3.1",
# "phpunit/PHPUnit": "^5.6.7"
BuildRequires: php-composer(phpunit/phpunit) >= 5.6.7
-# 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",
@@ -65,18 +63,17 @@ BuildRequires: php-zendframework-zend-loader >= 2.5.1-3
Requires: php(language) >= 5.6
Requires: php-mbstring
%if ! %{bootstrap}
-Requires: php-composer(%{gh_owner}/zend-math) >= 3.0
-Requires: php-composer(%{gh_owner}/zend-math) < 4
-Requires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7
-Requires: php-composer(%{gh_owner}/zend-stdlib) < 4
+Requires: php-autoloader(%{gh_owner}/zend-math) >= 3.0
+Requires: php-autoloader(%{gh_owner}/zend-math) < 4
+Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7
+Requires: php-autoloader(%{gh_owner}/zend-stdlib) < 4
Requires: php-composer(container-interop/container-interop) >= 1.0
Requires: php-composer(container-interop/container-interop) < 2
# From composer, "suggest": {
# "ext-openssl": "Required for most features of Zend\\Crypt"
Requires: php-openssl
# Autoloader
-Requires: php-composer(%{gh_owner}/zend-loader) >= 2.5
-Requires: php-zendframework-zend-loader >= 2.5.1-3
+Requires: php-composer(fedora/autoloader)
%endif
# From phpcompatinfo report for version 3.1.0
Requires: php-hash
@@ -89,6 +86,7 @@ Suggests: php-pecl(scrypt)
Obsoletes: php-ZendFramework2-%{library} < 2.5
Provides: php-ZendFramework2-%{library} = %{version}
Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
+Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version}
%description
@@ -116,15 +114,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}/Zend/Math/autoload.php',
+ '%{php_home}/Zend/Stdlib/autoload.php',
+ '%{php_home}/Interop/Container/autoload.php',
+]);
+EOF
%install
@@ -139,16 +144,8 @@ install -m644 autoload.php %{buildroot}%{php_home}/Zend/%{library}-autoload.php
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}' => dirname(__DIR__).'/test/',
- 'Zend\\%{library}' => '%{buildroot}%{php_home}/Zend/%{library}'
-))));
-require_once '%{php_home}/Zend/autoload.php';
+require_once '%{buildroot}%{php_home}/Zend/%{library}/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test');
EOF
%ifarch %arm
@@ -178,6 +175,9 @@ exit $ret
%changelog
+* Mon Dec 4 2017 Remi Collet <remi@remirepo.net> - 3.2.1-3
+- switch from zend-loader to fedora/autoloader
+
* Wed Nov 8 2017 Remi Collet <remi@remirepo.net> - 3.2.1-2
- fix erratic FTBFS from Koschei, ignore 1 failed test on arm
https://github.com/zendframework/zend-crypt/issues/53