summaryrefslogtreecommitdiffstats
path: root/php-react-http-client.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-react-http-client.spec')
-rw-r--r--php-react-http-client.spec128
1 files changed, 85 insertions, 43 deletions
diff --git a/php-react-http-client.spec b/php-react-http-client.spec
index 33267ae..afe1500 100644
--- a/php-react-http-client.spec
+++ b/php-react-http-client.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-react-http-client
#
-# Copyright (c) 2017 Shawn Iwinski <shawn@iwin.ski>
+# Copyright (c) 2017-2018 Shawn Iwinski <shawn@iwin.ski>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -12,35 +12,43 @@
%global github_owner reactphp
%global github_name http-client
-%global github_version 0.4.17
-%global github_commit 75ee8a113f156834aaabfe0055e8db531cb4892c
+%global github_version 0.5.9
+%global github_commit f8e81a022b61938e0b37c94c6351fc170b7d87f6
%global composer_vendor react
%global composer_project http-client
# "php": ">= 5.4.0"
%global php_min_ver 5.4.0
-# "evenement/evenement": "~2.0"
+# "clue/block-react": "^1.2"
+%global clue_block_react_min_ver 1.2
+%global clue_block_react_max_ver 2.0
+# "evenement/evenement": "^3.0 || ^2.0 || ^1.0"
+# NOTE: Restricting to one major version
%global evenement_min_ver 2.0
%global evenement_max_ver 3.0
-# "guzzlehttp/psr7": "^1.0"
-%global guzzlehttp_psr7_min_ver 1.0
-%global guzzlehttp_psr7_max_ver 2.0
-# "react/dns": "0.4.*"
-%global react_dns_min_ver 0.4.0
-%global react_dns_max_ver 0.5.0
-# "react/event-loop": "0.4.*"
-%global react_event_loop_min_ver 0.4.0
-%global react_event_loop_max_ver 0.5.0
-# "react/promise": "~2.2"
-%global react_promise_min_ver 2.2
+# "ringcentral/psr7": "^1.2"
+%global ringcentral_psr7_min_ver 1.2
+%global ringcentral_psr7_max_ver 2.0
+# "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3"
+# NOTE: Restricting to one major version
+%global react_event_loop_min_ver 0.5
+%global react_event_loop_max_ver 1.0
+# "react/promise": "^2.1 || ^1.2.1"
+# NOTE: Restricting to one major version
+%global react_promise_min_ver 2.1
%global react_promise_max_ver 3.0
-# "react/socket-client": "^0.5 || ^0.4 || ^0.3"
-%global react_socket_client_min_ver 0.3
-%global react_socket_client_max_ver 1.0
-# "react/stream": "0.4.*"
-%global react_stream_min_ver 0.4.0
-%global react_stream_max_ver 0.5.0
+# "react/promise-stream": "^1.1"
+%global react_promise_stream_min_ver 1.1
+%global react_promise_stream_max_ver 2.0
+# "react/socket": "^1.0 || ^0.8.4"
+# NOTE: Restricting to one major version
+%global react_socket_min_ver 0.8.4
+%global react_socket_max_ver 1.0
+# "react/stream": "^1.0 || ^0.7.1"
+# NOTE: Restricting to one major version
+%global react_stream_min_ver 0.7.1
+%global react_stream_max_ver 1.0
# Build using "--without tests" to disable tests
%global with_tests 0%{!?_without_tests:1}
@@ -54,8 +62,8 @@ Summary: Asynchronous HTTP client library
Group: Development/Libraries
License: MIT
-URL: https://github.com/%{github_owner}/%{github_name}
-Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
+URL: https://reactphp.org/http-client/
+Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
BuildArch: noarch
# Tests
@@ -63,21 +71,34 @@ BuildArch: noarch
## composer.json
Requires: php(language) >= %{php_min_ver}
BuildRequires: php-composer(phpunit/phpunit)
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+BuildRequires: (php-composer(clue/block-react) >= %{clue_block_react_min_ver} with php-composer(clue/block-react) < %{clue_block_react_max_ver})
+BuildRequires: (php-composer(evenement/evenement) >= %{evenement_min_ver} with php-composer(evenement/evenement) < %{evenement_max_ver})
+BuildRequires: (php-composer(react/event-loop) >= %{react_event_loop_min_ver} with php-composer(react/event-loop) < %{react_event_loop_max_ver})
+BuildRequires: (php-composer(react/promise-stream) >= %{react_promise_stream_min_ver} with php-composer(react/promise-stream) < %{react_promise_stream_max_ver})
+BuildRequires: (php-composer(react/promise) >= %{react_promise_min_ver} with php-composer(react/promise) < %{react_promise_max_ver})
+BuildRequires: (php-composer(react/socket) >= %{react_socket_min_ver} with php-composer(react/socket) < %{react_socket_max_ver})
+BuildRequires: (php-composer(react/stream) >= %{react_stream_min_ver} with php-composer(react/stream) < %{react_stream_max_ver})
+BuildRequires: (php-composer(ringcentral/psr7) >= %{ringcentral_psr7_min_ver} with php-composer(ringcentral/psr7) < %{ringcentral_psr7_max_ver})
+%else
+BuildRequires: php-composer(clue/block-react) < %{clue_block_react_max_ver}
+BuildRequires: php-composer(clue/block-react) >= %{clue_block_react_min_ver}
BuildRequires: php-composer(evenement/evenement) < %{evenement_max_ver}
BuildRequires: php-composer(evenement/evenement) >= %{evenement_min_ver}
-BuildRequires: php-composer(guzzlehttp/psr7) < %{guzzlehttp_psr7_max_ver}
-BuildRequires: php-composer(guzzlehttp/psr7) >= %{guzzlehttp_psr7_min_ver}
-BuildRequires: php-composer(react/dns) < %{react_dns_max_ver}
-BuildRequires: php-composer(react/dns) >= %{react_dns_min_ver}
BuildRequires: php-composer(react/event-loop) < %{react_event_loop_max_ver}
BuildRequires: php-composer(react/event-loop) >= %{react_event_loop_min_ver}
+BuildRequires: php-composer(react/promise-stream) < %{react_promise_stream_max_ver}
+BuildRequires: php-composer(react/promise-stream) >= %{react_promise_stream_min_ver}
BuildRequires: php-composer(react/promise) < %{react_promise_max_ver}
BuildRequires: php-composer(react/promise) >= %{react_promise_min_ver}
-BuildRequires: php-composer(react/socket-client) < %{react_socket_client_max_ver}
-BuildRequires: php-composer(react/socket-client) >= %{react_socket_client_min_ver}
+BuildRequires: php-composer(react/socket) < %{react_socket_max_ver}
+BuildRequires: php-composer(react/socket) >= %{react_socket_min_ver}
BuildRequires: php-composer(react/stream) < %{react_stream_max_ver}
BuildRequires: php-composer(react/stream) >= %{react_stream_min_ver}
-## phpcompatinfo (computed from version 0.4.17)
+BuildRequires: php-composer(ringcentral/psr7) < %{ringcentral_psr7_max_ver}
+BuildRequires: php-composer(ringcentral/psr7) >= %{ringcentral_psr7_min_ver}
+%endif
+## phpcompatinfo (computed from version 0.5.9)
BuildRequires: php-json
BuildRequires: php-spl
## Autoloader
@@ -86,21 +107,28 @@ BuildRequires: php-composer(fedora/autoloader)
# composer.json
Requires: php(language) >= %{php_min_ver}
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+Requires: (php-composer(evenement/evenement) >= %{evenement_min_ver} with php-composer(evenement/evenement) < %{evenement_max_ver})
+Requires: (php-composer(react/event-loop) >= %{react_event_loop_min_ver} with php-composer(react/event-loop) < %{react_event_loop_max_ver})
+Requires: (php-composer(react/promise) >= %{react_promise_min_ver} with php-composer(react/promise) < %{react_promise_max_ver})
+Requires: (php-composer(react/socket) >= %{react_socket_min_ver} with php-composer(react/socket) < %{react_socket_max_ver})
+Requires: (php-composer(react/stream) >= %{react_stream_min_ver} with php-composer(react/stream) < %{react_stream_max_ver})
+Requires: (php-composer(ringcentral/psr7) >= %{ringcentral_psr7_min_ver} with php-composer(ringcentral/psr7) < %{ringcentral_psr7_max_ver})
+%else
Requires: php-composer(evenement/evenement) < %{evenement_max_ver}
Requires: php-composer(evenement/evenement) >= %{evenement_min_ver}
-Requires: php-composer(guzzlehttp/psr7) < %{guzzlehttp_psr7_max_ver}
-Requires: php-composer(guzzlehttp/psr7) >= %{guzzlehttp_psr7_min_ver}
-Requires: php-composer(react/dns) < %{react_dns_max_ver}
-Requires: php-composer(react/dns) >= %{react_dns_min_ver}
Requires: php-composer(react/event-loop) < %{react_event_loop_max_ver}
Requires: php-composer(react/event-loop) >= %{react_event_loop_min_ver}
Requires: php-composer(react/promise) < %{react_promise_max_ver}
Requires: php-composer(react/promise) >= %{react_promise_min_ver}
-Requires: php-composer(react/socket-client) < %{react_socket_client_max_ver}
-Requires: php-composer(react/socket-client) >= %{react_socket_client_min_ver}
+Requires: php-composer(react/socket) < %{react_socket_max_ver}
+Requires: php-composer(react/socket) >= %{react_socket_min_ver}
Requires: php-composer(react/stream) < %{react_stream_max_ver}
Requires: php-composer(react/stream) >= %{react_stream_min_ver}
-# phpcompatinfo (computed from version 0.4.17)
+Requires: php-composer(ringcentral/psr7) < %{ringcentral_psr7_max_ver}
+Requires: php-composer(ringcentral/psr7) >= %{ringcentral_psr7_min_ver}
+%endif
+# phpcompatinfo (computed from version 0.5.9)
Requires: php-spl
# Autoloader
Requires: php-composer(fedora/autoloader)
@@ -132,12 +160,11 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Dependencies::required(array(
'%{phpdir}/Evenement/autoload.php',
- '%{phpdir}/GuzzleHttp/Psr7/autoload.php',
- '%{phpdir}/React/Dns/autoload.php',
'%{phpdir}/React/EventLoop/autoload.php',
'%{phpdir}/React/Promise/autoload.php',
- '%{phpdir}/React/SocketClient/autoload.php',
+ '%{phpdir}/React/Socket/autoload.php',
'%{phpdir}/React/Stream/autoload.php',
+ '%{phpdir}/RingCentral/Psr7/autoload.php',
));
AUTOLOAD
@@ -153,14 +180,24 @@ cp -rp src %{buildroot}%{phpdir}/React/HttpClient
cat <<'BOOTSTRAP' | tee bootstrap.php
<?php
require '%{buildroot}%{phpdir}/React/HttpClient/autoload.php';
+
\Fedora\Autoloader\Autoload::addPsr4('React\\Tests\\HttpClient\\', __DIR__.'/tests');
+
+\Fedora\Autoloader\Dependencies::required(array(
+ '%{phpdir}/Clue/React/Block/autoload.php',
+ '%{phpdir}/React/Promise/Stream/autoload.php',
+));
BOOTSTRAP
+: Skip tests requiring network access
+rm -f tests/FunctionalIntegrationTest.php
+
: Upstream tests
RETURN_CODE=0
-for PHP_EXEC in php %{?rhel:php55} php56 php70 php71; do
- if [ "php" == "$PHP_EXEC" ] || which $PHP_EXEC; then
- $PHP_EXEC %{_bindir}/phpunit --bootstrap bootstrap.php --verbose \
+PHPUNIT=$(which phpunit)
+for PHP_EXEC in "" %{?rhel:php54 php55} php70 php71 php72 php73; do
+ if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then
+ $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php \
|| RETURN_CODE=1
fi
done
@@ -179,6 +216,11 @@ exit $RETURN_CODE
%changelog
+* Mon Jul 02 2018 Shawn Iwinski <shawn@iwin.ski> - 0.5.9-1
+- Update to 0.5.9 (RHBZ #1454517)
+- Add range version dependencies for Fedora >= 27 || RHEL >= 8
+- Add composer.json to repo
+
* Sat Apr 08 2017 Shawn Iwinski <shawn@iwin.ski> - 0.4.17-1
- Update to 0.4.17 (RHBZ #1434200)