summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-06 16:22:01 +0100
committerRemi Collet <remi@remirepo.net>2017-12-06 16:22:01 +0100
commit5adc127d8d325159ba7567401f67741cab3e0979 (patch)
tree63fbf2f9e51811b7f655634020cf3296fa0f14f8
parent83e0ad93aa72de70b6ab49fb65c9f52a94eee6a5 (diff)
switch from zend-loader to fedora/autoloader
-rw-r--r--php-zendframework-zend-xml2json.spec43
1 files changed, 25 insertions, 18 deletions
diff --git a/php-zendframework-zend-xml2json.spec b/php-zendframework-zend-xml2json.spec
index 795cb3d..2235b20 100644
--- a/php-zendframework-zend-xml2json.spec
+++ b/php-zendframework-zend-xml2json.spec
@@ -21,7 +21,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 3.1.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Provides functionality for converting XML to JSON
Group: Development/Libraries
@@ -36,8 +36,8 @@ BuildArch: noarch
BuildRequires: php(language) >= 5.6
BuildRequires: php-pcre
BuildRequires: php-spl
-BuildRequires: php-composer(%{gh_owner}/zend-json) >= 2.6.1
-BuildRequires: php-composer(%{gh_owner}/zendxml) >= 1.0.2
+BuildRequires: php-autoloader(%{gh_owner}/zend-json) >= 2.6.1
+BuildRequires: php-autoloader(%{gh_owner}/zendxml) >= 1.0.2
# From composer, "require-dev": {
# "phpunit/phpunit": "^5.7.22 || ^6.4.1",
# "zendframework/zend-coding-standard": "~1.0.0"
@@ -47,9 +47,9 @@ BuildRequires: php-composer(%{gh_owner}/zendxml) >= 1.0.2
%global phpunit %{_bindir}/phpunit
%endif
BuildRequires: %{phpunit}
-# 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",
@@ -57,16 +57,19 @@ BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5
# "zendframework/zendxml": "^1.0.2"
Requires: php(language) >= 5.6
%if ! %{bootstrap}
-Requires: php-composer(%{gh_owner}/zend-json) >= 2.6.1
-Requires: php-composer(%{gh_owner}/zend-json) < 4
-Requires: php-composer(%{gh_owner}/zendxml) >= 1.0.2
-Requires: php-composer(%{gh_owner}/zendxml) < 2
+Requires: php-autoloader(%{gh_owner}/zend-json) >= 2.6.1
+Requires: php-autoloader(%{gh_owner}/zend-json) < 4
+Requires: php-autoloader(%{gh_owner}/zendxml) >= 1.0.2
+Requires: php-autoloader(%{gh_owner}/zendxml) < 2
%endif
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# From phpcompatinfo report for version 3.0.0
Requires: php-pcre
Requires: php-spl
Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
+Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version}
%description
@@ -83,7 +86,14 @@ 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::required([
+ '%{php_home}/Zend/Json/autoload.php',
+ '%{php_home}/ZendXml/autoload.php',
+]);
+EOF
%install
@@ -96,14 +106,8 @@ cp -pr src %{buildroot}%{php_home}/Zend/%{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\\%{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
ret=0
@@ -128,6 +132,9 @@ exit $ret
%changelog
+* Wed Dec 6 2017 Remi Collet <remi@remirepo.net> - 3.1.0-2
+- switch from zend-loader to fedora/autoloader
+
* Tue Oct 17 2017 Remi Collet <remi@remirepo.net> - 3.1.0-1
- Update to 3.1.0
- raise dependency on PHP 5.6