summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2022-09-23 16:42:50 +0200
committerRemi Collet <remi@php.net>2022-09-23 16:42:50 +0200
commitf70654e75f4e68f485541ca0346aee7813b17314 (patch)
tree9cc3952392383997259d6777120280ff82bb953b
parent74cab3de25b2a003c8207cc4714759ddfa7a73bc (diff)
update to 1.7.0
drop build dependency on clue/block-react add build dependency on react/async and react/promise-timer switch to classmap autoloader
-rw-r--r--composer.json5
-rw-r--r--php-react-http.spec62
2 files changed, 39 insertions, 28 deletions
diff --git a/composer.json b/composer.json
index 4c9a038..57adfc2 100644
--- a/composer.json
+++ b/composer.json
@@ -38,11 +38,12 @@
"ringcentral/psr7": "^1.2"
},
"require-dev": {
- "clue/block-react": "^1.5",
"clue/http-proxy-react": "^1.7",
"clue/reactphp-ssh-proxy": "^1.3",
"clue/socks-react": "^1.3",
- "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35"
+ "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35",
+ "react/async": "^4 || ^3 || ^2",
+ "react/promise-timer": "^1.9"
},
"autoload": {
"psr-4": { "React\\Http\\": "src" }
diff --git a/php-react-http.spec b/php-react-http.spec
index 88177ed..6f3800d 100644
--- a/php-react-http.spec
+++ b/php-react-http.spec
@@ -12,17 +12,14 @@
%global github_owner reactphp
%global github_name http
-%global github_version 1.6.0
-%global github_commit 59961cc4a5b14481728f07c591546be18fa3a5c7
+%global github_version 1.7.0
+%global github_commit 4a1e85382e8c2a9e0fdb8ac04e94585da2083bfa
%global composer_vendor react
%global composer_project http
# "php": ">=5.3.0"
%global php_min_ver 5.3.0
-# "clue/block-react": "^1.5"
-%global clue_block_react_min_ver 1.5
-%global clue_block_react_max_ver 2.0
# "clue/http-proxy-react": "^1.3", ignored as only used in examples
# "clue/reactphp-ssh-proxy": "^1.0", ignored as only used in examples
# "clue/socks-react": "^1.0", ignored as only used in examples
@@ -47,6 +44,12 @@
# "react/event-loop": "^1.2",
%global react_event_loop_min_ver 1.2
%global react_event_loop_max_ver 2.0
+# "react/async": "^4 || ^3 || ^2",
+%global react_async_min_ver 2.0
+%global react_async_max_ver 5
+# "react/promise-timer": "^1.9",
+%global react_promise_timer_min_ver 1.9
+%global react_promise_timer_max_ver 2
# "psr/http-message": "^1.0"
%global psr_http_message_min_ver 1.0
%global psr_http_message_max_ver 2.0
@@ -55,7 +58,7 @@
%global fig_http_message_util_max_ver 2
# Build using "--without tests" to disable tests
-%global with_tests 0%{!?_without_tests:1}
+%bcond_without tests
# Range dependencies supported?
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
@@ -81,7 +84,7 @@ Source1: %{name}-get-source.sh
BuildArch: noarch
# Tests
-%if %{with_tests}
+%if %{with tests}
## composer.json
BuildRequires: php(language) >= %{php_min_ver}
%if 0%{?fedora} >= 32 || 0%{?rhel} >= 9
@@ -93,7 +96,6 @@ BuildRequires: phpunit9 >= 9.3
BuildRequires: php-phpunit-PHPUnit >= 4.8.35
%endif
%if %{with_range_dependencies}
-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})
@@ -103,9 +105,9 @@ BuildRequires: (php-composer(react/stream) >= %{react_stream_min_ver} with php-c
BuildRequires: (php-composer(ringcentral/psr7) >= %{ringcentral_psr7_min_ver} with php-composer(ringcentral/psr7) < %{ringcentral_psr7_max_ver})
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(fig/http-message-util) >= %{fig_http_message_util_min_ver} with php-composer(fig/http-message-util) < %{fig_http_message_util_max_ver})
+BuildRequires: (php-composer(react/async) >= %{react_async_min_ver} with php-composer(react/async) < %{react_async_max_ver})
+BuildRequires: (php-composer(react/promise-timer) >= %{react_promise_timer_min_ver} with php-composer(react/promise-timer) < %{react_promise_timer_max_ver})
%else
-BuildRequires: php-clue-block-react < %{clue_block_react_max_ver}
-BuildRequires: php-clue-block-react >= %{clue_block_react_min_ver}
BuildRequires: php-evenement < %{evenement_max_ver}
BuildRequires: php-evenement >= %{evenement_min_ver}
BuildRequires: php-react-event-loop < %{react_event_loop_max_ver}
@@ -118,6 +120,10 @@ BuildRequires: php-react-socket < %{react_socket_max_ver}
BuildRequires: php-react-socket >= %{react_socket_min_ver}
BuildRequires: php-react-stream < %{react_stream_max_ver}
BuildRequires: php-react-stream >= %{react_stream_min_ver}
+BuildRequires: php-composer(react/async) < %{react_async_max_ver}
+BuildRequires: php-composer(react/async) >= %{react_async_min_ver}
+BuildRequires: php-composer(react/promise-timer) < %{react_promise_timer_max_ver}
+BuildRequires: php-composer(react/promise-timer) >= %{react_promise_timer_min_ver}
BuildRequires: php-ringcentral-psr7 < %{ringcentral_psr7_max_ver}
BuildRequires: php-ringcentral-psr7 >= %{ringcentral_psr7_min_ver}
BuildRequires: php-psr-http-message < %{psr_http_message_max_ver}
@@ -133,9 +139,9 @@ BuildRequires: php-json
BuildRequires: php-pcre
BuildRequires: php-sockets
BuildRequires: php-spl
-## Autoloader
-BuildRequires: php-composer(fedora/autoloader)
%endif
+## Autoloader
+BuildRequires: php-fedora-autoloader-devel
# composer.json
Requires: php(language) >= %{php_min_ver}
@@ -202,17 +208,14 @@ Autoloader: %{phpdir}/React/Http/autoload.php
%build
: Create autoloader
-cat <<'AUTOLOAD' | tee src/autoload.php
-<?php
-/**
- * Autoloader for %{name} and its' dependencies
- * (created by %{name}-%{version}-%{release}).
- */
-require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
+phpab --template fedora \
+ --output src/autoload.php \
+ src
-\Fedora\Autoloader\Autoload::addPsr4('React\\Http\\', __DIR__);
-\Fedora\Autoloader\Dependencies::required(array(
+cat <<'AUTOLOAD' | tee -a src/autoload.php
+
+\Fedora\Autoloader\Dependencies::required([
'%{phpdir}/Evenement/autoload.php',
'%{phpdir}/React/EventLoop/autoload.php',
'%{phpdir}/React/Promise/autoload.php',
@@ -222,7 +225,7 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
'%{phpdir}/RingCentral/Psr7/autoload.php',
'%{phpdir}/Psr/Http/Message/autoload.php',
'%{phpdir}/Fig/Http/Message/autoload.php',
-));
+]);
AUTOLOAD
@@ -232,7 +235,7 @@ cp -rp src %{buildroot}%{phpdir}/React/Http
%check
-%if %{with_tests}
+%if %{with tests}
: Create tests bootstrap
mkdir vendor
cat <<'BOOTSTRAP' | tee vendor/autoload.php
@@ -241,9 +244,10 @@ require '%{buildroot}%{phpdir}/React/Http/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('React\\Tests\\Http\\', dirname(__DIR__).'/tests');
-\Fedora\Autoloader\Dependencies::required(array(
- '%{phpdir}/Clue/React/Block/autoload.php',
-));
+\Fedora\Autoloader\Dependencies::required([
+ '%{phpdir}/React/Async/autoload.php',
+ '%{phpdir}/React/Promise/Timer/autoload.php',
+]);
BOOTSTRAP
: Skip test requiring network access and/or fail in restrictive buildroot env -- i.e. Bodhi
@@ -276,6 +280,12 @@ exit $RETURN_CODE
%changelog
+* Fri Sep 23 2022 Remi Collet <remi@remirepo.net> - 1.7.0-1
+- update to 1.7.0
+- drop build dependency on clue/block-react
+- add build dependency on react/async and react/promise-timer
+- switch to classmap autoloader
+
* Thu Feb 3 2022 Remi Collet <remi@remirepo.net> - 1.6.0-1
- update to 1.6.0
- raise dependency on clue/block-react 1.5