summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore5
-rw-r--r--php-guzzlehttp-guzzle6-upstream-pull-1792.patch36
-rw-r--r--php-guzzlehttp-guzzle6.spec125
3 files changed, 97 insertions, 69 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..13c9439
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+/php-guzzlehttp-guzzle6-6.1.1-c6851d6e48f63b69357cbfa55bca116448140e0c.tar.gz
+/php-guzzlehttp-guzzle6-6.2.0-d094e337976dff9d8e2424e8485872194e768662.tar.gz
+/php-guzzlehttp-guzzle6-6.2.1-3f808fba627f2c5b69e2501217bf31af349c1427.tar.gz
+/php-guzzlehttp-guzzle6-6.2.2-ebf29dee597f02f09f4d5bbecc68230ea9b08f60.tar.gz
+/php-guzzlehttp-guzzle6-6.2.3-8d6c6cc55186db87b7dc5009827429ba4e9dc006.tar.gz
diff --git a/php-guzzlehttp-guzzle6-upstream-pull-1792.patch b/php-guzzlehttp-guzzle6-upstream-pull-1792.patch
new file mode 100644
index 0000000..dbf6168
--- /dev/null
+++ b/php-guzzlehttp-guzzle6-upstream-pull-1792.patch
@@ -0,0 +1,36 @@
+From 60f134a2cd7149fa063bc797bc9db1d8ccdb4031 Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Thu, 30 Mar 2017 08:59:56 +0200
+Subject: [PATCH] Fix #1790 proxy should not end with /
+
+---
+ src/Handler/StreamHandler.php | 2 +-
+ tests/Handler/StreamHandlerTest.php | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/Handler/StreamHandler.php b/src/Handler/StreamHandler.php
+index d36787a..1f868b8 100644
+--- a/src/Handler/StreamHandler.php
++++ b/src/Handler/StreamHandler.php
+@@ -381,7 +381,7 @@ private function add_proxy(RequestInterface $request, &$options, $value, &$param
+ $value['no']
+ )
+ ) {
+- $options['http']['proxy'] = $value[$scheme];
++ $options['http']['proxy'] = rtrim($value[$scheme], '/');
+ }
+ }
+ }
+diff --git a/tests/Handler/StreamHandlerTest.php b/tests/Handler/StreamHandlerTest.php
+index c04a824..8449549 100644
+--- a/tests/Handler/StreamHandlerTest.php
++++ b/tests/Handler/StreamHandlerTest.php
+@@ -272,7 +272,7 @@ public function testAddsProxyByProtocol()
+ $url = str_replace('http', 'tcp', Server::$url);
+ $res = $this->getSendResult(['proxy' => ['http' => $url]]);
+ $opts = stream_context_get_options($res->getBody()->detach());
+- $this->assertEquals($url, $opts['http']['proxy']);
++ $this->assertEquals(rtrim($url, '/'), $opts['http']['proxy']);
+ }
+
+ public function testAddsProxyButHonorsNoProxy()
diff --git a/php-guzzlehttp-guzzle6.spec b/php-guzzlehttp-guzzle6.spec
index 4d39d1c..2b437ab 100644
--- a/php-guzzlehttp-guzzle6.spec
+++ b/php-guzzlehttp-guzzle6.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-guzzlehttp-guzzle6
#
-# Copyright (c) 2015-2016 Shawn Iwinski <shawn@iwin.ski>
+# Copyright (c) 2015-2017 Shawn Iwinski <shawn@iwin.ski>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -12,8 +12,8 @@
%global github_owner guzzle
%global github_name guzzle
-%global github_version 6.2.2
-%global github_commit ebf29dee597f02f09f4d5bbecc68230ea9b08f60
+%global github_version 6.2.3
+%global github_commit 8d6c6cc55186db87b7dc5009827429ba4e9dc006
%global composer_vendor guzzlehttp
%global composer_project guzzle
@@ -23,21 +23,16 @@
# "guzzlehttp/promises": "^1.0"
%global promises_min_ver 1.0
%global promises_max_ver 2.0
-# "guzzlehttp/psr7": "^1.3.1"
-%global psr7_min_ver 1.3.1
+# "guzzlehttp/psr7": "^1.4"
+%global psr7_min_ver 1.4
%global psr7_max_ver 2.0
# "psr/log": "^1.0"
# NOTE: Min version not 1.0 because autoloader required
%global psr_log_min_ver 1.0.1
%global psr_log_max_ver 2.0
-%if 0%{?rhel} == 5
-# no nodejs available in RHEL-5
-%global with_tests 0%{?_with_tests:1}
-%else
# Build using "--without tests" to disable tests
%global with_tests 0%{!?_without_tests:1}
-%endif
%{!?phpdir: %global phpdir %{_datadir}/php}
%{!?testsdir: %global testsdir %{_datadir}/tests}
@@ -56,18 +51,25 @@ URL: http://guzzlephp.org
Source0: %{name}-%{github_version}-%{github_commit}.tar.gz
Source1: %{name}-get-source.sh
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+# Proxy should not end with /
+# https://github.com/guzzle/guzzle/pull/1792
+# https://github.com/guzzle/guzzle/pull/1792.patch
+Patch0: %{name}-upstream-pull-1792.patch
+
BuildArch: noarch
# Tests
%if %{with_tests}
BuildRequires: nodejs
## composer.json
-BuildRequires: php(language) >= %{php_min_ver}
+BuildRequires: php(language) >= %{php_min_ver}
BuildRequires: php-composer(guzzlehttp/promises) >= %{promises_min_ver}
-BuildRequires: php-composer(guzzlehttp/psr7) >= %{psr7_min_ver}
+BuildRequires: php-composer(guzzlehttp/promises) < %{promises_max_ver}
+BuildRequires: php-composer(guzzlehttp/psr7) >= %{psr7_min_ver}
+BuildRequires: php-composer(guzzlehttp/psr7) < %{psr7_max_ver}
BuildRequires: php-composer(phpunit/phpunit)
-BuildRequires: php-composer(psr/log) >= %{psr_log_min_ver}
-## phpcompatinfo (computed from version 6.2.2)
+BuildRequires: php-composer(psr/log) >= %{psr_log_min_ver}
+BuildRequires: php-composer(psr/log) < %{psr_log_max_ver}
+## phpcompatinfo (computed from version 6.2.3)
BuildRequires: php-curl
BuildRequires: php-date
BuildRequires: php-filter
@@ -77,23 +79,20 @@ BuildRequires: php-pcre
BuildRequires: php-reflection
BuildRequires: php-spl
BuildRequires: php-zlib
-# Autoloader
-## NOTE: Min version 2.5 because class
-## \Symfony\Component\ClassLoader\Psr4ClassLoader required
-BuildRequires: php-composer(symfony/class-loader) >= 2.5
+## Autoloader
+BuildRequires: php-composer(fedora/autoloader)
%endif
-# use path as ca-certificates doesn't exists on EL-5
-Requires: /etc/pki/tls/certs/ca-bundle.crt
+Requires: ca-certificates
# composer.json
-Requires: php(language) >= %{php_min_ver}
+Requires: php(language) >= %{php_min_ver}
Requires: php-composer(guzzlehttp/promises) >= %{promises_min_ver}
Requires: php-composer(guzzlehttp/promises) < %{promises_max_ver}
-Requires: php-composer(guzzlehttp/psr7) >= %{psr7_min_ver}
-Requires: php-composer(guzzlehttp/psr7) < %{psr7_max_ver}
-Requires: php-composer(psr/log) >= %{psr_log_min_ver}
-Requires: php-composer(psr/log) < %{psr_log_max_ver}
-# phpcompatinfo (computed from version 6.2.2)
+Requires: php-composer(guzzlehttp/psr7) >= %{psr7_min_ver}
+Requires: php-composer(guzzlehttp/psr7) < %{psr7_max_ver}
+Requires: php-composer(psr/log) >= %{psr_log_min_ver}
+Requires: php-composer(psr/log) < %{psr_log_max_ver}
+# phpcompatinfo (computed from version 6.2.3)
Requires: php-curl
Requires: php-date
Requires: php-filter
@@ -101,9 +100,7 @@ Requires: php-json
Requires: php-pcre
Requires: php-spl
# Autoloader
-## NOTE: Min version 2.5 because class
-## \Symfony\Component\ClassLoader\Psr4ClassLoader required
-Requires: php-composer(symfony/class-loader) >= 2.5
+Requires: php-composer(fedora/autoloader)
# Composer
Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
@@ -129,6 +126,9 @@ Autoloader: %{phpdir}/GuzzleHttp6/autoload.php
%prep
%setup -qn %{github_name}-%{github_commit}
+# Proxy should not end with /
+%patch0 -p1
+
%build
: Create common autoloader
@@ -138,29 +138,22 @@ cat <<'AUTOLOAD' | tee src/autoload.php
* Autoloader for %{name} and its' dependencies
* (created by %{name}-%{version}-%{release}).
*/
+require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
-if (!isset($fedoraPsr4ClassLoader) || !($fedoraPsr4ClassLoader instanceof \Symfony\Component\ClassLoader\Psr4ClassLoader)) {
- if (!class_exists('Symfony\\Component\\ClassLoader\\Psr4ClassLoader', false)) {
- require_once '%{phpdir}/Symfony/Component/ClassLoader/Psr4ClassLoader.php';
- }
-
- $fedoraPsr4ClassLoader = new \Symfony\Component\ClassLoader\Psr4ClassLoader();
- $fedoraPsr4ClassLoader->register(true);
-}
-
-$fedoraPsr4ClassLoader->addPrefix('GuzzleHttp\\', __DIR__);
-
+\Fedora\Autoloader\Autoload::addPsr4('GuzzleHttp\\', __DIR__);
require_once __DIR__.'/functions_include.php';
-require_once '%{phpdir}/GuzzleHttp/Promise/autoload.php';
-require_once '%{phpdir}/GuzzleHttp/Psr7/autoload.php';
-require_once '%{phpdir}/Psr/Log/autoload.php';
+
+\Fedora\Autoloader\Dependencies::required([
+ '%{phpdir}/GuzzleHttp/Promise/autoload.php',
+ '%{phpdir}/GuzzleHttp/Psr7/autoload.php',
+ '%{phpdir}/Psr/Log/autoload.php',
+]);
AUTOLOAD
%install
-rm -rf %{buildroot}
-mkdir -p %{buildroot}%{phpdir}/GuzzleHttp6
-cp -pr src/* %{buildroot}%{phpdir}/GuzzleHttp6/
+mkdir -p %{buildroot}%{phpdir}
+cp -pr src %{buildroot}%{phpdir}/GuzzleHttp6
%check
@@ -170,40 +163,27 @@ mkdir vendor
cat <<'AUTOLOAD' | tee vendor/autoload.php
<?php
require_once '%{buildroot}%{phpdir}/GuzzleHttp6/autoload.php';
-$fedoraPsr4ClassLoader->addPrefix('GuzzleHttp\\Tests\\', __DIR__.'/tests');
+\Fedora\Autoloader\Autoload::addPsr4('GuzzleHttp\\Tests\\', __DIR__.'/tests');
AUTOLOAD
: Skip tests known to fail
sed 's/function testDescribesType/function SKIP_testDescribesType/' \
-i tests/functionsTest.php
-ret=0
-run=0
-
-if which php71; then
- php71 %{_bindir}/phpunit --verbose || ret=1
- run=1
-fi
-if which php56; then
- php56 %{_bindir}/phpunit --verbose || ret=1
- run=1
-fi
-if [ $run -eq 0 ]; then
- %{_bindir}/phpunit --verbose || ret=1
-fi
-
-exit $ret
+: Upstream tests
+RETURN_CODE=0
+for PHP_EXEC in php php56 php70 php71; do
+ if [ "php" == "$PHP_EXEC" ] || which $PHP_EXEC; then
+ $PHP_EXEC %{_bindir}/phpunit --verbose
+ fi
+done
+exit $RETURN_CODE
%else
: Tests skipped
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
@@ -212,6 +192,13 @@ rm -rf %{buildroot}
%changelog
+* Fri Apr 07 2017 Shawn Iwinski <shawn@iwin.ski> - 6.2.3-1
+- Update to 6.2.3
+- Fix rawhide (F27) FTBS
+- Add max versions to BuildRequires
+- Switch autoloader to php-composer(fedora/autoloader)
+- Test with SCLs if available
+
* Sun Oct 09 2016 Shawn Iwinski <shawn@iwin.ski> - 6.2.2-1
- Update to 6.2.2 (RHBZ #1383050)