summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2015-02-13 10:18:17 +0100
committerRemi Collet <fedora@famillecollet.com>2015-02-13 10:18:17 +0100
commite89f311490c3caa5dadadf1361fc0f58093fd6fc (patch)
tree900c134d78d21c3df075666cf1a6e4482b362bec
parent7cbb1951ae115035b93de9aa4ed7f25a5188978d (diff)
php-guzzlehttp-streams: 3.0.0 (backport)
-rw-r--r--php-guzzlehttp-streams-ad4c07ea55d02789a65ae75f6e4a9ee2cb9dab3f.patch60
-rw-r--r--php-guzzlehttp-streams.spec52
2 files changed, 93 insertions, 19 deletions
diff --git a/php-guzzlehttp-streams-ad4c07ea55d02789a65ae75f6e4a9ee2cb9dab3f.patch b/php-guzzlehttp-streams-ad4c07ea55d02789a65ae75f6e4a9ee2cb9dab3f.patch
new file mode 100644
index 0000000..0d212aa
--- /dev/null
+++ b/php-guzzlehttp-streams-ad4c07ea55d02789a65ae75f6e4a9ee2cb9dab3f.patch
@@ -0,0 +1,60 @@
+From ad4c07ea55d02789a65ae75f6e4a9ee2cb9dab3f Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Wed, 21 Jan 2015 13:45:19 +0100
+Subject: [PATCH] Fix #29 feof need a failed read
+
+---
+ tests/AppendStreamTest.php | 1 +
+ tests/FnStreamTest.php | 1 +
+ tests/GuzzleStreamWrapperTest.php | 1 +
+ tests/LimitStreamTest.php | 1 +
+ 4 files changed, 4 insertions(+)
+
+diff --git a/tests/AppendStreamTest.php b/tests/AppendStreamTest.php
+index a1d302d..2a0adb6 100644
+--- a/tests/AppendStreamTest.php
++++ b/tests/AppendStreamTest.php
+@@ -109,6 +109,7 @@ public function testCanReadFromMultipleStreams()
+ $this->assertEquals('foo', $a->read(3));
+ $this->assertEquals('bar', $a->read(3));
+ $this->assertEquals('baz', $a->read(3));
++ $this->assertEmpty($a->read(1));
+ $this->assertTrue($a->eof());
+ $this->assertSame(9, $a->tell());
+ $this->assertEquals('foobarbaz', (string) $a);
+diff --git a/tests/FnStreamTest.php b/tests/FnStreamTest.php
+index 39b495b..0597a7a 100644
+--- a/tests/FnStreamTest.php
++++ b/tests/FnStreamTest.php
+@@ -59,6 +59,7 @@ public function testDecoratesStream()
+ $this->assertEquals($b->read(3), 'foo');
+ $this->assertEquals($b->tell(), 3);
+ $this->assertEquals($a->tell(), 3);
++ $this->assertEmpty($b->read(1));
+ $this->assertEquals($b->eof(), true);
+ $this->assertEquals($a->eof(), true);
+ $b->seek(0);
+diff --git a/tests/GuzzleStreamWrapperTest.php b/tests/GuzzleStreamWrapperTest.php
+index 33c3ecc..f10cc78 100644
+--- a/tests/GuzzleStreamWrapperTest.php
++++ b/tests/GuzzleStreamWrapperTest.php
+@@ -18,6 +18,7 @@ public function testResource()
+ $this->assertSame(3, fwrite($handle, 'bar'));
+ $this->assertSame(0, fseek($handle, 0));
+ $this->assertSame('foobar', fread($handle, 6));
++ $this->assertEmpty(fread($handle, 1));
+ $this->assertTrue(feof($handle));
+
+ // This fails on HHVM for some reason
+diff --git a/tests/LimitStreamTest.php b/tests/LimitStreamTest.php
+index efb1dc5..6137e82 100644
+--- a/tests/LimitStreamTest.php
++++ b/tests/LimitStreamTest.php
+@@ -31,6 +31,7 @@ public function testReturnsSubset()
+ $body->seek(0);
+ $this->assertFalse($body->eof());
+ $this->assertEquals('oo', $body->read(100));
++ $this->assertEmpty($body->read(1));
+ $this->assertTrue($body->eof());
+ }
+
diff --git a/php-guzzlehttp-streams.spec b/php-guzzlehttp-streams.spec
index a94d595..59b0a4c 100644
--- a/php-guzzlehttp-streams.spec
+++ b/php-guzzlehttp-streams.spec
@@ -1,7 +1,7 @@
#
# RPM spec file for php-guzzlehttp-streams
#
-# Copyright (c) 2014 Shawn Iwinski <shawn.iwinski@gmail.com>
+# Copyright (c) 2014-2015 Shawn Iwinski <shawn.iwinski@gmail.com>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -11,8 +11,8 @@
%global github_owner guzzle
%global github_name streams
-%global github_version 1.5.1
-%global github_commit fb0d1ee29987c2bdc59867bffaade6fc88c2675f
+%global github_version 3.0.0
+%global github_commit 47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5
%global composer_vendor guzzlehttp
%global composer_project streams
@@ -23,9 +23,12 @@
# Build using "--without tests" to disable tests
%global with_tests %{?_without_tests:0}%{!?_without_tests:1}
+%{!?phpdir: %global phpdir %{_datadir}/php}
+%{!?__phpunit: %global __phpunit %{_bindir}/phpunit}
+
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
-Release: 2%{?github_release}%{?dist}
+Release: 1%{?github_release}%{?dist}
Summary: Provides a simple abstraction over streams of data
Group: Development/Libraries
@@ -33,20 +36,26 @@ License: MIT
URL: http://docs.guzzlephp.org/en/guzzle4/streams.html
Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
+# Test suite start failing with upcoming 5.5.21RC1 / 5.6.5RC1
+# https://github.com/guzzle/streams/issues/29
+# https://github.com/guzzle/streams/commit/ad4c07ea55d02789a65ae75f6e4a9ee2cb9dab3f.patch
+Patch0: %{name}-ad4c07ea55d02789a65ae75f6e4a9ee2cb9dab3f.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
%if %{with_tests}
-# For tests: composer.json
+# composer.json
BuildRequires: php(language) >= %{php_min_ver}
-BuildRequires: php-phpunit-PHPUnit
-# For tests: phpcompatinfo (computed from version 1.5.1)
+BuildRequires: %{__phpunit}
+# phpcompatinfo (computed from version 3.0.0)
BuildRequires: php-hash
BuildRequires: php-spl
+BuildRequires: php-zlib
%endif
# composer.json
Requires: php(language) >= %{php_min_ver}
-# phpcompatinfo (computed from version 1.5.1)
+# phpcompatinfo (computed from version 3.0.0)
Requires: php-hash
Requires: php-spl
@@ -59,14 +68,16 @@ Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
%prep
%setup -qn %{github_name}-%{github_commit}
+%patch0 -p1 -b .ad4c07ea55d02789a65ae75f6e4a9ee2cb9dab3f
+
%build
# Empty build section, nothing required
%install
-mkdir -pm 0755 %{buildroot}%{_datadir}/php/GuzzleHttp/Stream
-cp -pr src/* %{buildroot}%{_datadir}/php/GuzzleHttp/Stream/
+mkdir -p %{buildroot}%{phpdir}/GuzzleHttp/Stream
+cp -pr src/* %{buildroot}%{phpdir}/GuzzleHttp/Stream/
%check
@@ -76,18 +87,13 @@ mkdir vendor
cat > vendor/autoload.php <<'AUTOLOAD'
<?php
-require_once __DIR__ . '/../src/functions.php';
-
spl_autoload_register(function ($class) {
$src = str_replace(array('\\', '_'), '/', $class).'.php';
@include_once $src;
});
AUTOLOAD
-# Create PHPUnit config w/ colors turned off
-sed 's/colors\s*=\s*"true"/colors="false"/' phpunit.xml.dist > phpunit.xml
-
-%{_bindir}/phpunit --include-path="%{buildroot}%{_datadir}/php" -d date.timezone="UTC"
+%{__phpunit} --include-path="%{buildroot}%{phpdir}"
%else
: Tests skipped
%endif
@@ -97,12 +103,20 @@ sed 's/colors\s*=\s*"true"/colors="false"/' phpunit.xml.dist > phpunit.xml
%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
-%doc README.rst composer.json
-%dir %{_datadir}/php/GuzzleHttp
- %{_datadir}/php/GuzzleHttp/Stream
+%doc *.rst
+%doc composer.json
+%dir %{phpdir}/GuzzleHttp
+ %{phpdir}/GuzzleHttp/Stream
%changelog
+* Sun Feb 08 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 3.0.0-1
+- Updated to 3.0.0 (BZ #1131103)
+
+* Thu Jan 22 2015 Remi Collet <remi@fedoraproject.org> - 1.5.1-3
+- add upstream patch for test suite against latest PHP
+ see https://github.com/guzzle/streams/issues/29, thank Koschei
+
* Tue Aug 26 2014 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.5.1-2
- Updated URL and description per upstream
- Fix test suite when previous version installed