From 814c23a7a04d4e128581200bb922c1ce422a1ec5 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 7 Sep 2020 10:30:35 +0200 Subject: v1.6.0 from Fedora --- composer.json | 29 +++++++++++++++-- makesrc.sh | 1 + php-react-socket-get-source.sh | 74 ++++++++++++++++++++++++++++++++++++++++++ php-react-socket.198690e.patch | 34 ------------------- php-react-socket.spec | 70 +++++++++++++++++++++++++-------------- 5 files changed, 146 insertions(+), 62 deletions(-) create mode 120000 makesrc.sh create mode 100755 php-react-socket-get-source.sh delete mode 100644 php-react-socket.198690e.patch diff --git a/composer.json b/composer.json index bffd7bb..5a43ed9 100644 --- a/composer.json +++ b/composer.json @@ -3,18 +3,41 @@ "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", "keywords": ["async", "socket", "stream", "connection", "ReactPHP"], "license": "MIT", + "authors": [ + { + "name": "Christian Lück", + "homepage": "https://clue.engineering/", + "email": "christian@clue.engineering" + }, + { + "name": "Cees-Jan Kiewiet", + "homepage": "https://wyrihaximus.net/", + "email": "reactphp@ceesjankiewiet.nl" + }, + { + "name": "Jan Sorgalla", + "homepage": "https://sorgalla.com/", + "email": "jsorgalla@gmail.com" + }, + { + "name": "Chris Boden", + "homepage": "https://cboden.dev/", + "email": "cboden@gmail.com" + } + ], "require": { "php": ">=5.3.0", "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "react/dns": "^1.0 || ^0.4.13", - "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", + "react/dns": "^1.1", + "react/event-loop": "^1.0 || ^0.5", "react/promise": "^2.6.0 || ^1.2.1", "react/promise-timer": "^1.4.0", "react/stream": "^1.1" }, "require-dev": { "clue/block-react": "^1.2", - "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", + "react/promise-stream": "^1.2" }, "autoload": { "psr-4": { diff --git a/makesrc.sh b/makesrc.sh new file mode 120000 index 0000000..b77c61b --- /dev/null +++ b/makesrc.sh @@ -0,0 +1 @@ +php-react-socket-get-source.sh \ No newline at end of file diff --git a/php-react-socket-get-source.sh b/php-react-socket-get-source.sh new file mode 100755 index 0000000..c614ff3 --- /dev/null +++ b/php-react-socket-get-source.sh @@ -0,0 +1,74 @@ +#/bin/sh + +GIT=`which git` +RPM=`which rpm` + +if [ -z "$GIT" ] +then + echo "ERROR: 'git' command not found" 1>&2 + exit 1 +elif [ -z "$RPM" ] +then + echo "ERROR: 'rpm' command not found" 1>&2 + exit 1 +fi + +function print { + echo -e "\e[0;33m>>>>> ${1}\e[0m" +} + +if [ -n "$1" ] +then + SPEC=$1 +else + SPEC=`ls *.spec | head -1` +fi + +SPEC_DIR=`pwd` + +print "SPEC_DIR = $SPEC_DIR" + +NAME=`echo $SPEC | sed 's#\.spec##'` +VERSION=`egrep '%global\s*github_version' $SPEC | awk '{print $3}'` + +print "SPEC = $SPEC" +print "NAME = $NAME" + +GIT_OWNER=`egrep '%global\s*github_owner' $SPEC | awk '{print $3}'` +GIT_NAME=`egrep '%global\s*github_name' $SPEC | awk '{print $3}'` +GIT_COMMIT=`egrep '%global\s*github_commit' $SPEC | awk '{print $3}'` +GIT_REPO=https://github.com/${GIT_OWNER}/${GIT_NAME} +GIT_DIR=`echo $GIT_REPO | sed 's#.*/##'` + +print "GIT_OWNER = $GIT_OWNER" +print "GIT_NAME = $GIT_NAME" +print "GIT_COMMIT = $GIT_COMMIT" +print "GIT_REPO = $GIT_REPO" +print "GIT_DIR = $GIT_DIR" + +TEMP_DIR=$(mktemp --dir) + +pushd $TEMP_DIR + print "Cloning git repo..." + $GIT clone $GIT_REPO + + pushd $GIT_DIR + print "Checking out commit..." + $GIT checkout $GIT_COMMIT + cp composer.json ${SPEC_DIR}/ + popd + + TAR_DIR=${GIT_NAME}-${GIT_COMMIT} + print "TAR_DIR = $TAR_DIR" + + mv $GIT_DIR $TAR_DIR + + TAR_FILE=${SPEC_DIR}/${NAME}-${VERSION}-${GIT_COMMIT}.tar.gz + print "TAR_FILE = $TAR_FILE" + + [ -e $TAR_FILE ] && rm -f $TAR_FILE + tar --exclude-vcs -czf $TAR_FILE $TAR_DIR + chmod 0644 $TAR_FILE +popd + +rm -rf $TEMP_DIR diff --git a/php-react-socket.198690e.patch b/php-react-socket.198690e.patch deleted file mode 100644 index b213982..0000000 --- a/php-react-socket.198690e.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 198690e6b736d3501cf272fa9e4ed59f3ee08a34 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Christian=20L=C3=BCck?= -Date: Sun, 17 Nov 2019 00:30:30 +0100 -Subject: [PATCH] Improve test suite to exclude TLS 1.3 tests on PHP 7.3 - -Explicit TLS 1.3 support will be available in PHP 7.4: -https://github.com/php/php-src/pull/3909 - -Older PHP versions implicitly support TLS 1.3 provided that the -underlying OpenSSL version supports TLS 1.3. However, for PHP 7.3 some -recent changes implicitly disable TLS 1.3, so we skip TLS 1.3 tests on -affected PHP versions: https://github.com/php/php-src/pull/3317 ---- - tests/FunctionalSecureServerTest.php | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/tests/FunctionalSecureServerTest.php b/tests/FunctionalSecureServerTest.php -index 7e7b0cc..226c380 100644 ---- a/tests/FunctionalSecureServerTest.php -+++ b/tests/FunctionalSecureServerTest.php -@@ -50,8 +50,11 @@ public function testClientCanConnectToServer() - - public function testClientUsesTls13ByDefaultWhenSupportedByOpenSSL() - { -- if (PHP_VERSION_ID < 70000 || !$this->supportsTls13()) { -- $this->markTestSkipped('Test requires PHP 7+ for crypto meta data and OpenSSL 1.1.1+ for TLS 1.3'); -+ if (PHP_VERSION_ID < 70000 || (PHP_VERSION_ID >= 70300 && PHP_VERSION_ID < 70400) || !$this->supportsTls13()) { -+ // @link https://github.com/php/php-src/pull/3909 explicitly adds TLS 1.3 on PHP 7.4 -+ // @link https://github.com/php/php-src/pull/3317 implicitly limits to TLS 1.2 on PHP 7.3 -+ // all older PHP versions support TLS 1.3 (provided OpenSSL supports it), but only PHP 7 allows checking the version -+ $this->markTestSkipped('Test requires PHP 7+ for crypto meta data (but excludes PHP 7.3 because it implicitly limits to TLS 1.2) and OpenSSL 1.1.1+ for TLS 1.3'); - } - - $loop = Factory::create(); diff --git a/php-react-socket.spec b/php-react-socket.spec index 94f607f..5667e02 100644 --- a/php-react-socket.spec +++ b/php-react-socket.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-react-socket # -# Copyright (c) 2017-2019 Shawn Iwinski +# Copyright (c) 2017-2020 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT @@ -12,8 +12,8 @@ %global github_owner reactphp %global github_name socket -%global github_version 1.3.0 -%global github_commit 10f0629ec83ea0fa22597f348623f554227e3ca0 +%global github_version 1.6.0 +%global github_commit e2b96b23a13ca9b41ab343268dbce3f8ef4d524a %global composer_vendor react %global composer_project socket @@ -26,15 +26,18 @@ # "evenement/evenement": "^3.0 || ^2.0 || ^1.0" %global evenement_min_ver 1.0 %global evenement_max_ver 4.0 -# "react/dns": "^1.0 || ^0.4.13" -%global react_dns_min_ver 0.4.13 +# "react/dns": "^1.1" +%global react_dns_min_ver 1.1 %global react_dns_max_ver 2.0 -# "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5" -%global react_event_loop_min_ver 0.3.5 +# "react/event-loop": "^1.0 || ^0.5" +%global react_event_loop_min_ver 0.5 %global react_event_loop_max_ver 2.0 # "react/promise": "^2.6.0 || ^1.2.1" %global react_promise_min_ver 1.2.1 %global react_promise_max_ver 3.0 +# "react/promise-stream": "^1.2" +%global react_promise_stream_min_ver 1.2 +%global react_promise_stream_max_ver 2.0 # "react/promise-timer": "^1.4.0" %global react_promise_timer_min_ver 1.4.0 %global react_promise_timer_max_ver 2.0 @@ -42,9 +45,21 @@ %global react_stream_min_ver 1.1 %global react_stream_max_ver 2.0 +# "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" +%global phpunit_require phpunit9 +%global phpunit_min_ver 9.3 +%global phpunit_exec phpunit9 + # Build using "--without tests" to disable tests %global with_tests 0%{!?_without_tests:1} +# Range dependencies supported? +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +%global with_range_dependencies 1 +%else +%global with_range_dependencies 0 +%endif + %{!?phpdir: %global phpdir %{_datadir}/php} Name: php-%{composer_vendor}-%{composer_project} @@ -54,26 +69,26 @@ Summary: Async, streaming plaintext TCP/IP and secure TLS socket server License: MIT URL: https://reactphp.org/socket/ -Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz -# Improve test suite to exclude TLS 1.3 tests on PHP 7.3 -# https://github.com/reactphp/socket/commit/198690e6b736d3501cf272fa9e4ed59f3ee08a34 -# https://github.com/reactphp/socket/commit/198690e6b736d3501cf272fa9e4ed59f3ee08a34.patch -Patch0: %{name}.198690e.patch +# GitHub export does not include tests +# Run php-react-socket-get-source.sh to create full source +Source0: %{name}-%{github_version}-%{github_commit}.tar.gz +Source1: %{name}-get-source.sh BuildArch: noarch # Tests %if %{with_tests} ## composer.json BuildRequires: php(language) >= %{php_min_ver} -BuildRequires: phpunit6 -%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires: %{phpunit_require} >= %{phpunit_min_ver} +%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/dns) >= %{react_dns_min_ver} with php-composer(react/dns) < %{react_dns_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) >= %{react_promise_min_ver} with php-composer(react/promise) < %{react_promise_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-timer) >= %{react_promise_timer_min_ver} with php-composer(react/promise-timer) < %{react_promise_timer_max_ver}) +BuildRequires: (php-composer(react/promise) >= %{react_promise_min_ver} with php-composer(react/promise) < %{react_promise_max_ver}) BuildRequires: (php-composer(react/stream) >= %{react_stream_min_ver} with php-composer(react/stream) < %{react_stream_max_ver}) %else BuildRequires: php-composer(clue/block-react) < %{clue_block_react_max_ver} @@ -88,12 +103,13 @@ BuildRequires: php-composer(react/promise) < %{react_promise_max_ver} BuildRequires: php-composer(react/promise) >= %{react_promise_min_ver} BuildRequires: php-composer(react/promise-timer) >= %{react_promise_timer_min_ver} BuildRequires: php-composer(react/promise-timer) < %{react_promise_timer_max_ver} +BuildRequires: php-composer(react/promise-stream) >= %{react_promise_stream_min_ver} +BuildRequires: php-composer(react/promise-stream) < %{react_promise_stream_max_ver} BuildRequires: php-composer(react/stream) < %{react_stream_max_ver} BuildRequires: php-composer(react/stream) >= %{react_stream_min_ver} %endif -## phpcompatinfo (computed from version 1.3.0) +## phpcompatinfo (computed from version 1.6.0) BuildRequires: php-filter -BuildRequires: php-openssl BuildRequires: php-pcre BuildRequires: php-reflection BuildRequires: php-sockets @@ -104,7 +120,7 @@ BuildRequires: php-composer(fedora/autoloader) # composer.json Requires: php(language) >= %{php_min_ver} -%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +%if %{with_range_dependencies} Requires: (php-composer(evenement/evenement) >= %{evenement_min_ver} with php-composer(evenement/evenement) < %{evenement_max_ver}) Requires: (php-composer(react/dns) >= %{react_dns_min_ver} with php-composer(react/dns) < %{react_dns_max_ver}) Requires: (php-composer(react/event-loop) >= %{react_event_loop_min_ver} with php-composer(react/event-loop) < %{react_event_loop_max_ver}) @@ -125,7 +141,7 @@ Requires: php-composer(react/promise-timer) < %{react_promise_timer_max_ve Requires: php-composer(react/stream) < %{react_stream_max_ver} Requires: php-composer(react/stream) >= %{react_stream_min_ver} %endif -# phpcompatinfo (computed from version 1.3.0) +# phpcompatinfo (computed from version 1.6.0) Requires: php-filter Requires: php-pcre Requires: php-sockets @@ -151,9 +167,6 @@ Autoloader: %{phpdir}/React/Socket/autoload.php %prep %setup -qn %{github_name}-%{github_commit} -# Improve test suite to exclude TLS 1.3 tests on PHP 7.3 -%patch0 -p1 - %build : Create autoloader @@ -194,6 +207,7 @@ require '%{buildroot}%{phpdir}/React/Socket/autoload.php'; \Fedora\Autoloader\Dependencies::required(array( '%{phpdir}/Clue/React/Block/autoload.php', + '%{phpdir}/React/Promise/Stream/autoload.php', )); BOOTSTRAP @@ -210,10 +224,10 @@ sed \ : Upstream tests RETURN_CODE=0 -PHPUNIT=$(which phpunit6) -for PHP_EXEC in "" php71 php72 php73 php74; do +PHPUNIT=$(which %{phpunit_exec}) +for PHP_EXEC in "" php73 php74; do if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then - $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php \ + $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php --exclude-group internet \ || RETURN_CODE=1 fi done @@ -232,6 +246,12 @@ exit $RETURN_CODE %changelog +* Sun Sep 06 2020 Shawn Iwinski - 1.6.0-1 +- Update to 1.6.0 (RHBZ #1812925) +- Remove patch merged upstream +- Use PHPUnit 9 +- Exclude group "internet" in tests + * Sat Dec 14 2019 Shawn Iwinski - 1.3.0-1 - Update to 1.3.0 (RHBZ #1600308) - Use PHPUnit 6 -- cgit