From 9bc455eee19df0cc4027d9e08d23b28dd11c864d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 8 Jun 2016 16:42:03 +0200 Subject: php-pecl-http: add upstream patch for php 7.1 --- pecl_http-upstream.patch | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ php-pecl-http-php7.spec | 24 +++++++++++++++++++++--- 2 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 pecl_http-upstream.patch diff --git a/pecl_http-upstream.patch b/pecl_http-upstream.patch new file mode 100644 index 0000000..d07660b --- /dev/null +++ b/pecl_http-upstream.patch @@ -0,0 +1,49 @@ +From 9f18b5395f9c937105d698ce564920dc06dce8f5 Mon Sep 17 00:00:00 2001 +From: Michael Wallner +Date: Wed, 25 May 2016 12:06:57 +0200 +Subject: [PATCH] fix tests for master + +--- + tests/client008.phpt | 2 +- + tests/etag001.phpt | 2 +- + tests/skipif.inc | 3 ++- + 3 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/tests/client008.phpt b/tests/client008.phpt +index 98fc8f8..3f5641f 100644 +--- a/tests/client008.phpt ++++ b/tests/client008.phpt +@@ -1,5 +1,5 @@ + --TEST-- +-client features ++client configuration + --SKIPIF-- + append("Hello, my old fellow."); + foreach (hash_algos() as $algo) { +- if (strncmp($algo, "sha3-", 5)) { ++ if (strncmp($algo, "sha3-", 5) && strncmp($algo, "sha512/", 7)) { + ini_set("http.etag.mode", $algo); + printf("%10s: %s\n", + $algo, +diff --git a/tests/skipif.inc b/tests/skipif.inc +index 4ab631e..770cf5d 100644 +--- a/tests/skipif.inc ++++ b/tests/skipif.inc +@@ -21,7 +21,8 @@ function skip_client_test($message = "skip need a client driver\n") { + } + + function skip_http2_test($message = "skip need http2 support (nghttpd in PATH)\n") { +- if (defined("http\\Client\\Curl\\HTTP_VERSION_2_0")) { ++ if (defined("http\\Client\\Curl\\HTTP_VERSION_2_0") ++ && (http\Client\Curl\FEATURES & http\Client\Curl\Features\HTTP2)) { + foreach (explode(":", $_ENV["PATH"]) as $path) { + if (is_executable($path . "/nghttpd")) { + return; diff --git a/php-pecl-http-php7.spec b/php-pecl-http-php7.spec index 8451033..8e5ecd7 100644 --- a/php-pecl-http-php7.spec +++ b/php-pecl-http-php7.spec @@ -11,10 +11,11 @@ # %if 0%{?scl:1} %global sub_prefix %{scl_prefix} +%scl_package php-pecl-http +%else +%global _root_prefix %{_prefix} %endif -%{?scl: %scl_package php-pecl-http} -%{!?scl: %global _root_prefix %{_prefix}} %global gh_commit a84b499418ee7b8992fd9e7e2abc661735a869bd %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) @@ -42,7 +43,7 @@ Version: 3.0.1 Release: 0.1.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz %else -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source0: http://pecl.php.net/get/%{proj_name}-%{version}%{?prever}.tgz %endif Summary: Extended HTTP support @@ -54,6 +55,8 @@ URL: http://pecl.php.net/package/pecl_http # From http://www.php.net/manual/en/http.configuration.php Source1: %{proj_name}.ini +Patch0: %{proj_name}-upstream.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: %{?scl_prefix}php-devel >= 7 BuildRequires: %{?scl_prefix}php-hash @@ -104,8 +107,10 @@ Requires: %{?scl_prefix}php-pecl(apfd)%{?_isa} Provides: %{?scl_prefix}php-pecl(%{proj_name}) = %{version}%{?prever} Provides: %{?scl_prefix}php-pecl(%{proj_name})%{?_isa} = %{version}%{?prever} +%if "%{?scl_prefix}" != "%{?sub_prefix}" Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}%{?prever} Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}%{?prever} +%endif Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}%{?prever} Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}%{?prever} Provides: %{?scl_prefix}php-%{pecl_name} = %{version}%{?prever} @@ -123,6 +128,10 @@ Obsoletes: php56u-pecl-http <= %{version} Obsoletes: php56w-pecl-http <= %{version} Obsoletes: php70u-pecl-http <= %{version} Obsoletes: php70w-pecl-http <= %{version} +%if "%{php_version}" > "7.1" +Obsoletes: php71u-pecl-http <= %{version} +Obsoletes: php71w-pecl-http <= %{version} +%endif %endif %if 0%{?fedora} < 20 && 0%{?rhel} < 7 @@ -182,6 +191,8 @@ mv %{proj_name}-%{version}%{?prever} NTS %{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml} cd NTS +%patch0 -p1 -b .upstream + extver=$(sed -n '/#define PHP_PECL_HTTP_VERSION/{s/.* "//;s/".*$//;p}' php_http.h) if test "x${extver}" != "x%{version}%{?prever}%{?gh_date:dev}"; then : Error: Upstream HTTP version is now ${extver}, expecting %{version}%{?prever}%{?gh_date:dev}. @@ -277,6 +288,10 @@ done --modules | grep %{pecl_name} %if %{with_tests} +%if "%{php_version}" > "7.1" +rm ?TS/tests/client022.phpt +%endif + : Upstream test suite NTS extension cd NTS TEST_PHP_EXECUTABLE=%{__php} \ @@ -351,6 +366,9 @@ rm -rf %{buildroot} %changelog +* Wed Jun 8 2016 Remi Collet - 3.0.1-2 +- add upstream patch, fix test suite with PHP 7.1 + * Wed Mar 9 2016 Remi Collet - 3.0.1-1 - Update to 3.0.1 (php 7, stable) -- cgit