summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore8
-rw-r--r--composer.json20
-rw-r--r--php-react-http.spec119
3 files changed, 109 insertions, 38 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..fc9aa8c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+clog
+package-*.xml
+*.tgz
+*.tar.gz
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/composer.json b/composer.json
index c186927..c3d46a9 100644
--- a/composer.json
+++ b/composer.json
@@ -1,18 +1,24 @@
{
"name": "react/http",
- "description": "Library for building an evented http server.",
- "keywords": ["http"],
+ "description": "Event-driven, streaming plaintext HTTP and secure HTTPS server for ReactPHP",
+ "keywords": ["event-driven", "streaming", "HTTP", "HTTPS", "server", "ReactPHP"],
"license": "MIT",
"require": {
- "php": ">=5.4.0",
- "guzzlehttp/psr7": "^1.0",
- "react/socket": "^0.4",
- "react/stream": "^0.4",
- "evenement/evenement": "^2.0"
+ "php": ">=5.3.0",
+ "ringcentral/psr7": "^1.2",
+ "react/socket": "^1.0 || ^0.8.3",
+ "react/stream": "^1.0 || ^0.7.1",
+ "react/promise": "^2.3 || ^1.2.1",
+ "evenement/evenement": "^3.0 || ^2.0 || ^1.0",
+ "react/promise-stream": "^1.1"
},
"autoload": {
"psr-4": {
"React\\Http\\": "src"
}
+ },
+ "require-dev": {
+ "clue/block-react": "^1.1",
+ "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35"
}
}
diff --git a/php-react-http.spec b/php-react-http.spec
index 9141ac8..6b0ad66 100644
--- a/php-react-http.spec
+++ b/php-react-http.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-react-http
#
-# 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,26 +12,39 @@
%global github_owner reactphp
%global github_name http
-%global github_version 0.4.2
-%global github_commit abedac54967d7ea237ad104cff8274e2c4077cf4
+%global github_version 0.8.3
+%global github_commit f8bcdab2dc0ecd94f35ff9657a263028b96f0c46
%global composer_vendor react
%global composer_project http
-# "php": ">= 5.4.0"
-%global php_min_ver 5.4.0
-# "evenement/evenement": "^2.0"
+# "php": ">=5.3.0"
+%global php_min_ver 5.3.0
+# "clue/block-react": "^1.1"
+%global clue_block_react_min_ver 1.1
+%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/socket": "^0.4"
-%global react_socket_min_ver 0.4
+# "react/promise": "^2.3 || ^1.2.1"
+# NOTE: Restricting to one major version
+%global react_promise_min_ver 2.3
+%global react_promise_max_ver 3.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.3"
+# NOTE: Restricting to one major version
+%global react_socket_min_ver 0.8.3
%global react_socket_max_ver 1.0
-# "react/stream": "^0.4"
-%global react_stream_min_ver 0.4
+# "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
+# "ringcentral/psr7": "^1.2"
+%global ringcentral_psr7_min_ver 1.2
+%global ringcentral_psr7_max_ver 2.0
# Build using "--without tests" to disable tests
%global with_tests 0%{!?_without_tests:1}
@@ -40,13 +53,13 @@
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
-Release: 2%{?github_release}%{?dist}
+Release: 1%{?github_release}%{?dist}
Summary: Library for building an evented http server
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/
+Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
BuildArch: noarch
# Tests
@@ -54,15 +67,33 @@ BuildArch: noarch
## composer.json
BuildRequires: 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/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/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) < %{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.2)
+BuildRequires: php-composer(ringcentral/psr7) < %{ringcentral_psr7_max_ver}
+BuildRequires: php-composer(ringcentral/psr7) >= %{ringcentral_psr7_min_ver}
+%endif
+## phpcompatinfo (computed from version 0.8.3)
+BuildRequires: php-date
+BuildRequires: php-pcre
BuildRequires: php-spl
## Autoloader
BuildRequires: php-composer(fedora/autoloader)
@@ -70,15 +101,30 @@ 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/promise-stream) >= %{react_promise_stream_min_ver} with php-composer(react/promise-stream) < %{react_promise_stream_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/promise-stream) < %{react_promise_stream_max_ver}
+Requires: php-composer(react/promise-stream) >= %{react_promise_stream_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) < %{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.2)
+Requires: php-composer(ringcentral/psr7) < %{ringcentral_psr7_max_ver}
+Requires: php-composer(ringcentral/psr7) >= %{ringcentral_psr7_min_ver}
+%endif
+# phpcompatinfo (computed from version 0.8.3)
+Requires: php-date
+Requires: php-pcre
Requires: php-spl
# Autoloader
Requires: php-composer(fedora/autoloader)
@@ -120,9 +166,11 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Dependencies::required(array(
'%{phpdir}/Evenement/autoload.php',
- '%{phpdir}/GuzzleHttp/Psr7/autoload.php',
+ '%{phpdir}/React/Promise/autoload.php',
+ '%{phpdir}/React/Promise/Stream/autoload.php',
'%{phpdir}/React/Socket/autoload.php',
'%{phpdir}/React/Stream/autoload.php',
+ '%{phpdir}/RingCentral/Psr7/autoload.php',
));
AUTOLOAD
@@ -138,20 +186,24 @@ cp -rp src %{buildroot}%{phpdir}/React/Http
cat <<'BOOTSTRAP' | tee bootstrap.php
<?php
require '%{buildroot}%{phpdir}/React/Http/autoload.php';
+
\Fedora\Autoloader\Autoload::addPsr4('React\\Tests\\Http\\', __DIR__.'/tests');
+
+\Fedora\Autoloader\Dependencies::required(array(
+ '%{phpdir}/Clue/React/Block/autoload.php',
+));
BOOTSTRAP
: Upstream tests
-%{_bindir}/phpunit --verbose --bootstrap bootstrap.php
-
-: Upstream tests with SCLs if available
-SCL_RETURN_CODE=0
-for SCL in %{?rhel:php55} php56 php70 php71; do
- if which $SCL; then
- $SCL %{_bindir}/phpunit --verbose --bootstrap bootstrap.php || SCL_RETURN_CODE=1
+RETURN_CODE=0
+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
-exit $SCL_RETURN_CODE
+exit $RETURN_CODE
%else
: Tests skipped
%endif
@@ -166,6 +218,11 @@ exit $SCL_RETURN_CODE
%changelog
+* Mon Jul 02 2018 Shawn Iwinski <shawn@iwin.ski> - 0.8.3-1
+- Update to 0.8.3 (RHBZ #1421136)
+- Add range version dependencies for Fedora >= 27 || RHEL >= 8
+- Add composer.json to repo
+
* Thu Jan 26 2017 Remi Collet <remi@remirepo.net> - 0.4.2-2
- backport