summaryrefslogtreecommitdiffstats
path: root/php-zendframework-zend-json.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-11-23 15:55:53 +0100
committerRemi Collet <remi@remirepo.net>2017-11-23 15:55:53 +0100
commit64ff860869794d90b47912add7dece37933c4649 (patch)
treeb087dea941fd81e2f11b99212f00eb6b1527526d /php-zendframework-zend-json.spec
parent35a24adadc73c367e3a535a284a3c372062842b4 (diff)
switch from zend-loader to fedora/autoloader
Diffstat (limited to 'php-zendframework-zend-json.spec')
-rw-r--r--php-zendframework-zend-json.spec69
1 files changed, 34 insertions, 35 deletions
diff --git a/php-zendframework-zend-json.spec b/php-zendframework-zend-json.spec
index 9e35946..5cc9d8b 100644
--- a/php-zendframework-zend-json.spec
+++ b/php-zendframework-zend-json.spec
@@ -21,7 +21,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 3.0.0
-Release: 1%{?dist}
+Release: 5%{?dist}
Summary: Zend Framework %{library} component
Group: Development/Libraries
@@ -30,7 +30,8 @@ URL: https://zendframework.github.io/%{gh_project}/
Source0: %{gh_commit}/%{name}-%{version}-%{gh_short}.tgz
Source1: makesrc.sh
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+Patch0: https://patch-diff.githubusercontent.com/raw/zendframework/zend-json/pull/33.patch
+
BuildArch: noarch
# Tests
%if %{with_tests}
@@ -44,10 +45,10 @@ BuildRequires: php-spl
# "zendframework/zend-stdlib": "^2.7 || ^3.0",
# "squizlabs/php_codesniffer": "^2.3",
# "phpunit/PHPUnit": "~4.0"
-BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7
+BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7
BuildRequires: php-composer(phpunit/phpunit) >= 4.0
# Autoloader
-BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5
+BuildRequires: php-fedora-autoloader-devel
%endif
# From composer, "require": {
@@ -62,16 +63,19 @@ Suggests: php-composer(%{gh_owner}/zend-json-server)
Suggests: php-composer(%{gh_owner}/zend-xml2json)
%endif
%endif
-# From phpcompatinfo report for version 2.6.0
+# From phpcompatinfo report for version 3.0.0
Requires: php-json
Requires: php-mbstring
Requires: php-pcre
Requires: php-reflection
Requires: php-spl
+# Autoloader
+Requires: php-composer(fedora/autoloader)
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
@@ -83,17 +87,22 @@ Documentation: https://zendframework.github.io/%{gh_project}/
%prep
%setup -q -n %{gh_project}-%{gh_commit}
+%patch0 -p1
mv LICENSE.md LICENSE
%build
-# Empty build section, nothing required
+phpab --template fedora --output src/autoload.php src
+cat << 'EOF' | tee -a src/autoload.php
+\Fedora\Autoloader\Dependencies::optional([
+ '%{php_home}/Zend/Json/Server/autoload.php',
+ '%{php_home}/Zend/Xml2Json/autoload.php',
+]);
+EOF
%install
-rm -rf %{buildroot}
-
mkdir -p %{buildroot}%{php_home}/Zend/
cp -pr src %{buildroot}%{php_home}/Zend/%{library}
@@ -103,43 +112,26 @@ 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\Dependencies::required([
+ '%{php_home}/Zend/Stdlib/autoload.php',
+]);
+\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\Json\\', dirname(__DIR__) . '/test');
EOF
-# remirepo:11
-run=0
ret=0
-if which php56; then
- php56 %{_bindir}/phpunit --include-path=%{buildroot}%{php_home} || ret=1
- run=1
-fi
-if which php71; then
- php70 %{_bindir}/phpunit --include-path=%{buildroot}%{php_home} || ret=1
- run=1
-fi
-if [ $run -eq 0 ]; then
-%{_bindir}/phpunit --include-path=%{buildroot}%{php_home} --verbose
-# remirepo:2
-fi
+for cmd in php php56 php70 php71 php72; do
+ if which $cmd; then
+ $cmd %{_bindir}/phpunit --verbose || ret=1
+ fi
+done
exit $ret
%else
: Test suite disabled
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
@@ -148,6 +140,13 @@ rm -rf %{buildroot}
%changelog
+* Thu Nov 23 2017 Remi Collet <remi@remirepo.net> - 3.1.0-5
+- switch from zend-loader to fedora/autoloader
+
+* Mon Oct 23 2017 Remi Collet <remi@remirepo.net> - 3.0.0-4
+- fix FTBFS from Koschei, add patch for PHP 7.2 from
+ https://github.com/zendframework/zend-json/pull/33
+
* Wed Jun 29 2016 Remi Collet <remi@fedoraproject.org> - 3.0.0-1
- update to 3.0.0 for ZendFramework 3
- add optional dependencies on zend-json-server and zend-xml2json