From ccdc145b40fd4348eceeaf216e7d3f5f53fc9743 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 22 Jan 2020 16:55:03 +0100 Subject: update to 2.2.2 rename to php-laminas-diactoros2 install to /usr/share/php/Laminas/Diactoros2 raise dependency on PHP 7.1 add dependency on psr/http-factory switch to phpunit7 --- php-laminas-diactoros2.spec | 118 ++++++++++++++++++++++++++------------------ 1 file changed, 71 insertions(+), 47 deletions(-) (limited to 'php-laminas-diactoros2.spec') diff --git a/php-laminas-diactoros2.spec b/php-laminas-diactoros2.spec index 4b71c84..3165b15 100644 --- a/php-laminas-diactoros2.spec +++ b/php-laminas-diactoros2.spec @@ -11,33 +11,35 @@ %global gh_owner laminas %global gh_project laminas-diactoros %global zf_name zend-diactoros -%global gh_commit 56a9aca1f89231763d24d2ae13531b97fa5f4029 +%global gh_commit 95178c4751d737cdf9ab0a9f70a42754ac860e7b %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global php_home %{_datadir}/php %global namespace Laminas %global library Diactoros +%global major 2 + %global gh_psr7_owner php-http %global gh_psr7_name psr7-integration-tests -%global gh_psr7_version 0 -%global gh_psr7_commit 5dfefb2da33ca24ae20c971b725c9a6fe7403008 +%global gh_psr7_version 1.0.0 +%global gh_psr7_commit c3bb79ca4a276df57364ff45bf2f619f769ded4a %global gh_psr7_short %(c=%{gh_psr7_commit}; echo ${c:0:7}) -# "php": "^5.6 || ^7.0" -%global php_min_ver 5.6 -# "psr/http-message": "^1.0" -%global psr_http_message_min_ver 1.0 -%global psr_http_message_max_ver 2.0 +%global gh_factory_owner http-interop +%global gh_factory_name http-factory-tests +%global gh_factory_version 0.5.0 +%global gh_factory_commit 3c6c62052daeb67ca7dc3e1ea1b72c0f0cc19070 +%global gh_factory_short %(c=%{gh_factory_commit}; echo ${c:0:7}) # Build using "--without tests" to disable tests %global with_tests 0%{!?_without_tests:1} %{!?phpdir: %global phpdir %{_datadir}/php} -Name: php-%{gh_project} -Version: 1.8.7p1 -Release: 2%{?gh_release}%{?dist} -Summary: PSR HTTP Message implementations +Name: php-%{gh_project}%{major} +Version: 2.2.2 +Release: 1%{?gh_release}%{?dist} +Summary: PSR HTTP Message implementations v%{major} License: BSD URL: https://github.com/%{gh_owner}/%{gh_project} @@ -46,33 +48,43 @@ URL: https://github.com/%{gh_owner}/%{gh_project} # Run makesrc.sh to create full source. Source0: %{name}-%{version}-%{gh_short}.tgz Source1: makesrc.sh -# Temporarily bundled, no release, only used for tests +# Temporarily bundled, only used for tests Source2: %{gh_psr7_owner}-%{gh_psr7_name}-%{gh_psr7_version}-%{gh_psr7_short}.tgz Source3: %{gh_psr7_owner}-%{gh_psr7_name}-get-source.sh +# Temporarily bundled, only used for tests +Source4: php-%{gh_factory_owner}-%{gh_factory_name}-%{gh_factory_version}-%{gh_factory_short}.tgz +Source5: php-%{gh_factory_owner}-%{gh_factory_name}-get-source.sh BuildArch: noarch # Tests %if %{with_tests} ## composer.json -BuildRequires: php(language) >= %{php_min_ver} +BuildRequires: php(language) >= 7.1 # remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 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) >= %{psr_http_message_min_ver} with php-composer(psr/http-message) < %{psr_http_message_max_ver}) +BuildRequires: (php-composer(psr/http-message) >= 1.0 with php-composer(psr/http-message) < 2) +BuildRequires: (php-composer(psr/http-factory) >= 1.0 with php-composer(psr/http-factory) < 2) # remirepo:4 %else BuildRequires: php-laminas-zendframework-bridge BuildRequires: php-psr-http-message +BuildRequires: php-psr-http-factory %endif -%global phpunit %{_bindir}/phpunit6 -BuildRequires: %{phpunit} +# "require-dev": { +# "ext-curl": "*", +# "ext-dom": "*", +# "ext-libxml": "*", +# "http-interop/http-factory-tests": "^0.5.0", +# "laminas/laminas-coding-standard": "~1.0.0", +# "php-http/psr7-integration-tests": "dev-master", +# "phpunit/phpunit": "^7.5.18" +# }, +%global phpunit %{_bindir}/phpunit7 +BuildRequires: phpunit7 >= 7.5.18 BuildRequires: php-dom BuildRequires: php-libxml -## phpcompatinfo (computed from version 1.8.7p1) -### NOTE: curl, gd, gmp, and shmop are all optional for -### LaminasTest\Diactoros\StreamTest::getResourceFor67() -### (test/StreamTest.php) but the first one found wins -### so only curl is chosen as a requirement here. +## phpcompatinfo (computed from version 2.2.2) BuildRequires: php-curl BuildRequires: php-dom BuildRequires: php-json @@ -86,31 +98,37 @@ BuildRequires: php-spl BuildRequires: php-fedora-autoloader-devel # composer.json -Requires: php(language) >= %{php_min_ver} +# "require": { +# "php": "^7.1", +# "laminas/laminas-zendframework-bridge": "^1.0", +# "psr/http-factory": "^1.0", +# "psr/http-message": "^1.0" +Requires: php(language) >= 7.1 # remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 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) >= %{psr_http_message_min_ver} with php-composer(psr/http-message) < %{psr_http_message_max_ver}) +Requires: (php-composer(psr/http-message) >= 1.0 with php-composer(psr/http-message) < 2) +Requires: (php-composer(psr/http-factory) >= 1.0 with php-composer(psr/http-factory) < 2) # remirepo:4 %else Requires: php-laminas-zendframework-bridge Requires: php-psr-http-message +Requires: php-psr-http-factory %endif -# phpcompatinfo (computed from version 1.8.7p1) +# phpcompatinfo (computed from version 2.2.2) Requires: php-json Requires: php-pcre Requires: php-spl # Autoloader Requires: php-composer(fedora/autoloader) -# Composer # Compatibily ensure by the bridge -Obsoletes: php-zendframework-%{zf_name} < 1.8.7p1 -Provides: php-zendframework-%{zf_name} = %{version} 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} + +Provides: php-composer(psr/http-factory-implementation) = 1.0 Provides: php-composer(psr/http-message-implementation) = 1.0 @@ -121,16 +139,17 @@ http.Server [2]. Documentation: https://docs.laminas.dev/%{gh_project}/ -Autoloader: %{phpdir}/%{namespace}/Diactoros/autoload.php +Autoloader: %{phpdir}/%{namespace}/%{library}%{major}/autoload.php [1] http://www.php-fig.org/psr/psr-7/ [2] http://nodejs.org/api/http.html %prep -%setup -qn %{gh_project}-%{gh_commit} -a2 +%setup -qn %{gh_project}-%{gh_commit} -a2 -a4 mv %{gh_psr7_name}-%{gh_psr7_commit} psr7 +mv %{gh_factory_name}-%{gh_factory_commit} factory mv LICENSE.md LICENSE @@ -140,6 +159,7 @@ phpab --template fedora --output src/autoload.php src cat <<'AUTOLOAD' | tee -a src/autoload.php \Fedora\Autoloader\Dependencies::required(array( '%{phpdir}/Psr/Http/Message/autoload.php', + '%{phpdir}/Psr/Http/Message/http-factory-autoload.php', __DIR__.'/functions/create_uploaded_file.php', __DIR__.'/functions/marshal_headers_from_sapi.php', __DIR__.'/functions/marshal_method_from_sapi.php', @@ -154,7 +174,7 @@ AUTOLOAD cat << 'EOF' | tee zf.php - 2.2.2-1 +- update to 2.2.2 +- rename to php-laminas-diactoros2 +- install to /usr/share/php/Laminas/Diactoros2 +- raise dependency on PHP 7.1 +- add dependency on psr/http-factory +- switch to phpunit7 + * Fri Jan 17 2020 Remi Collet - 1.8.7p1-2 - cleanup -- cgit