diff options
Diffstat (limited to 'php-laminas-psr7bridge.spec')
-rw-r--r-- | php-laminas-psr7bridge.spec | 144 |
1 files changed, 102 insertions, 42 deletions
diff --git a/php-laminas-psr7bridge.spec b/php-laminas-psr7bridge.spec index 8de29c0..cc55c0b 100644 --- a/php-laminas-psr7bridge.spec +++ b/php-laminas-psr7bridge.spec @@ -1,17 +1,19 @@ -# remirepo/Fedora spec file for php-zendframework-zend-psr7bridge +# remirepo/Fedora spec file for php-laminas-psr7bridge # -# Copyright (c) 2016-2018 Remi Collet +# Copyright (c) 2016-2020 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # %global bootstrap 0 -%global gh_commit 86c0b53b0c6381391c4add4a93a56e51d5c74605 +%global gh_commit 61ab5a9908a968c363b9562645a8a7e7ea086c22 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) -%global gh_owner zendframework -%global gh_project zend-psr7bridge +%global gh_owner laminas +%global gh_project laminas-psr7bridge +%global zf_name zend-psr7bridge %global php_home %{_datadir}/php +%global namespace Laminas %global library Psr7Bridge %if %{bootstrap} %global with_tests 0%{?_with_tests:1} @@ -19,65 +21,92 @@ %global with_tests 0%{!?_without_tests:1} %endif -Name: php-%{gh_owner}-%{gh_project} -Version: 0.2.2 -Release: 4%{?dist} -Summary: Zend Framework %{library} component +Name: php-%{gh_project} +Version: 1.2.0 +Release: 1%{?dist} +Summary: %{namespace} Framework %{library} component License: BSD -URL: https://zendframework.github.io/%{gh_project}/ +URL: https://github.com/%{gh_owner}/%{gh_project} Source0: %{gh_commit}/%{name}-%{version}-%{gh_short}.tgz Source1: makesrc.sh +# Nedd investigation +Patch0: test.patch + BuildArch: noarch # Tests %if %{with_tests} -BuildRequires: php(language) >= 5.5 +BuildRequires: php(language) >= 5.6 BuildRequires: php-reflection BuildRequires: php-intl BuildRequires: php-pcre BuildRequires: php-spl -BuildRequires: php-autoloader(%{gh_owner}/zend-http) >= 2.5 -BuildRequires: php-composer(psr/http-message) >= 1.0 -BuildRequires: php-autoloader(%{gh_owner}/zend-diactoros) >= 1.1 +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires: (php-autoloader(%{gh_owner}/laminas-diactoros) >= 1.7 with php-autoloader(%{gh_owner}/laminas-diactoros) < 3) +BuildRequires: (php-autoloader(%{gh_owner}/laminas-http) >= 2.7 with php-autoloader(%{gh_owner}/laminas-http) < 3) +BuildRequires: (php-autoloader(%{gh_owner}/laminas-zendframework-bridge) >= 1.0 with php-autoloader(%{gh_owner}/laminas-zendframework-bridge) < 2) +BuildRequires: (php-composer(psr/http-message) >= 1.0 with php-composer(psr/http-message) < 2) +# remirepo:6 +%else +BuildRequires: php-laminas-diactoros +BuildRequires: php-laminas-http +BuildRequires: php-laminas-zendframework-bridge +BuildRequires: php-psr-http-message +%endif # From composer, "require-dev": { -# "phpunit/phpunit": "^4.7", -# "squizlabs/php_codesniffer": "^2.3" -BuildRequires: php-composer(phpunit/phpunit) >= 4.7 +# "laminas/laminas-coding-standard": "~1.0.0", +# "phpunit/phpunit": "^5.7.15 || ^6.5.6" +BuildRequires: phpunit6 >= 6.5.6 %endif # Autoloader BuildRequires: php-fedora-autoloader-devel # From composer, "require": { -# "php": ">=5.5", -# "zendframework/zend-http": "^2.5", -# "psr/http-message": "^1.0", -# "zendframework/zend-diactoros": "^1.1" -Requires: php(language) >= 5.5 -%if ! %{bootstrap} -Requires: php-autoloader(%{gh_owner}/zend-http) >= 2.5 -Requires: php-autoloader(%{gh_owner}/zend-http) < 3 -Requires: php-composer(psr/http-message) >= 1.0 -Requires: php-composer(psr/http-message) < 2 -Requires: php-autoloader(%{gh_owner}/zend-diactoros) >= 1.1 -Requires: php-autoloader(%{gh_owner}/zend-diactoros) < 2 +# "php": "^5.6 || ^7.0", +# "laminas/laminas-diactoros": "^1.7 || ^2.0", +# "laminas/laminas-http": "^2.7", +# "laminas/laminas-zendframework-bridge": "^1.0", +# "psr/http-message": "^1.0" +Requires: php(language) >= 5.6 +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +Requires: (php-autoloader(%{gh_owner}/laminas-diactoros) >= 1.7 with php-autoloader(%{gh_owner}/laminas-diactoros) < 3) +Requires: (php-autoloader(%{gh_owner}/laminas-http) >= 2.7 with php-autoloader(%{gh_owner}/laminas-http) < 3) +Requires: (php-autoloader(%{gh_owner}/laminas-zendframework-bridge) >= 1.0 with php-autoloader(%{gh_owner}/laminas-zendframework-bridge) < 2) +Requires: (php-composer(psr/http-message) >= 1.0 with php-composer(psr/http-message) < 2) +# remirepo:6 +%else +Requires: php-laminas-diactoros +Requires: php-laminas-http +Requires: php-laminas-zendframework-bridge +Requires: php-psr-http-message %endif # Autoloader Requires: php-composer(fedora/autoloader) -# From phpcompatinfo report for version 0.2.1 => Nothing - -Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} +# From phpcompatinfo report for version 1.2.0 +Requires: php-pcre +Requires: php-spl + +# Compatibily ensure by the bridge +Obsoletes: php-zendframework-%{zf_name} < 1.2.0-99 +Provides: php-zendframework-%{zf_name} = %{version}-99 +Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} +Provides: php-composer(zendframework/%{zf_name}) = %{version} Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version} +Provides: php-autoloader(zendframework/%{zf_name}) = %{version} %description -Code for converting PSR-7 messages to zend-http messages, and vice versa. +Code for converting PSR-7 messages to laminas-http messages, and vice versa. -Documentation: https://zendframework.github.io/%{gh_project}/ +Documentation: https://docs.laminas.dev/%{gh_project}/ %prep %setup -q -n %{gh_project}-%{gh_commit} +%patch0 -p0 -b .old mv LICENSE.md LICENSE @@ -87,16 +116,33 @@ mv LICENSE.md LICENSE phpab --template fedora --output src/autoload.php src cat << 'EOF' | tee -a src/autoload.php \Fedora\Autoloader\Dependencies::required([ - '%{php_home}/Zend/Http/autoload.php', + '%{php_home}/%{namespace}/Http/autoload.php', '%{php_home}/Psr/Http/Message/autoload.php', - '%{php_home}/Zend/Diactoros/autoload.php', + [ + '%{php_home}/%{namespace}/Diactoros2/autoload.php', + '%{php_home}/%{namespace}/Diactoros/autoload.php', + ], +]); +EOF + +cat << 'EOF' | tee zf.php +<?php +require_once '%{php_home}/Fedora/Autoloader/autoload.php'; +\Fedora\Autoloader\Dependencies::required([ + '%{php_home}/%{namespace}/ZendFrameworkBridge/autoload.php', + dirname(dirname(__DIR__)) . '/%{namespace}/%{library}/autoload.php', ]); EOF %install -mkdir -p %{buildroot}%{php_home}/Zend/ -cp -pr src %{buildroot}%{php_home}/Zend/%{library} +: Laminas library +mkdir -p %{buildroot}%{php_home}/%{namespace}/ +cp -pr src %{buildroot}%{php_home}/%{namespace}/%{library} + +: Zend equiv +mkdir -p %{buildroot}%{php_home}/Zend/%{library} +cp -pr zf.php %{buildroot}%{php_home}/Zend/%{library}/autoload.php %check @@ -104,14 +150,21 @@ cp -pr src %{buildroot}%{php_home}/Zend/%{library} mkdir vendor cat << 'EOF' | tee vendor/autoload.php <?php -require_once '%{buildroot}%{php_home}/Zend/%{library}/autoload.php'; -\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test'); +require_once '%{buildroot}%{php_home}/%{namespace}/%{library}/autoload.php'; +\Fedora\Autoloader\Autoload::addPsr4('%{namespace}Test\\%{library}\\', dirname(__DIR__) . '/test'); EOF +: check compat autoloader +php -r ' +require "%{buildroot}%{php_home}/Zend/%{library}/autoload.php"; +exit (class_exists("\\Zend\\%{library}\\Psr7Response") ? 0 : 1); +' + +: upstream test suite ret=0 -for cmd in php php56 php70 php71 php72; do +for cmd in php php72 php73 php74; do if which $cmd; then - $cmd %{_bindir}/phpunit || ret=1 + $cmd %{_bindir}/phpunit6 || ret=1 fi done exit $ret @@ -121,14 +174,21 @@ exit $ret %files +# remirepo:1 %{!?_licensedir:%global license %%doc} %license LICENSE %doc *.md %doc composer.json %{php_home}/Zend/%{library} +%{php_home}/%{namespace}/%{library} %changelog +* Fri Jan 10 2020 Remi Collet <remi@remirepo.net> - 1.2.0-1 +- switch to Laminas +- update to 1.2.0 +- raise dependency on PHP 5.6 + * Sat Dec 9 2017 Remi Collet <remi@remirepo.net> - 0.2.2-4 - switch from zend-loader to fedora/autoloader |