diff options
author | Remi Collet <remi@remirepo.net> | 2020-11-04 13:54:03 +0100 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2020-11-04 13:54:03 +0100 |
commit | ed8aab75a2995d577f6102fd30d5dabd9dd818c4 (patch) | |
tree | 02eb698616285c6ae64865b2733e1d348de166d6 | |
parent | 3677439cf298243c870b053c156231341f53dc2a (diff) |
update to 1.4.0
switch to phpunit9
-rw-r--r-- | composer.json | 10 | ||||
-rw-r--r-- | php-clue-block-react.spec | 71 |
2 files changed, 50 insertions, 31 deletions
diff --git a/composer.json b/composer.json index 27caca6..4545462 100644 --- a/composer.json +++ b/composer.json @@ -7,19 +7,23 @@ "authors": [ { "name": "Christian Lück", - "email": "christian@lueck.tv" + "email": "christian@clue.engineering" } ], "autoload": { "files": [ "src/functions_include.php" ] }, + "autoload-dev": { + "psr-4": { "Clue\\Tests\\React\\Block\\": "tests/" } + }, "require": { - "php": ">=5.3", + "php": ">=5.3", "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", "react/promise": "^2.7 || ^1.2.1", "react/promise-timer": "^1.5" }, "require-dev": { - "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", + "react/http": "^1.0" } } diff --git a/php-clue-block-react.spec b/php-clue-block-react.spec index 4ba53a9..6901948 100644 --- a/php-clue-block-react.spec +++ b/php-clue-block-react.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-clue-block-react # -# Copyright (c) 2017-2019 Shawn Iwinski <shawn@iwin.ski> +# Copyright (c) 2017-2020 Shawn Iwinski <shawn@iwin.ski> # # License: MIT # http://opensource.org/licenses/MIT @@ -12,8 +12,8 @@ %global github_owner clue %global github_name reactphp-block -%global github_version 1.3.1 -%global github_commit 2f516b28259c203d67c4c963772dd7e9db652737 +%global github_version 1.4.0 +%global github_commit c8e7583ae55127b89d6915480ce295bac81c4f88 %global composer_vendor clue %global composer_project block-react @@ -29,40 +29,50 @@ # "react/promise-timer": "^1.5" %global react_promise_timer_min_ver 1.5 %global react_promise_timer_max_ver 2.0 +# "react/http": "^1.0" in require-dev but only used in examples + # Build using "--without tests" to disable tests -%global with_tests 0%{!?_without_tests:1} +%bcond_without tests %{!?phpdir: %global phpdir %{_datadir}/php} Name: php-%{composer_vendor}-%{composer_project} Version: %{github_version} -Release: 3%{?github_release}%{?dist} +Release: 1%{?github_release}%{?dist} Summary: Integrate async React PHP components into your blocking environment License: MIT URL: https://github.com/%{github_owner}/%{github_name} -Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz + +# GitHub export does not include tests +# Run php-clue-block-react-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} +%if %{with tests} ## composer.json BuildRequires: php(language) >= %{php_min_ver} -BuildRequires: phpunit6 +%if 0%{?fedora} >= 32 || 0%{?rhel} >= 9 +# "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" +%global phpunit %{_bindir}/phpunit9 +BuildRequires: phpunit9 >= 9.3 +%else +%global phpunit %{_bindir}/phpunit +BuildRequires: php-phpunit-PHPUnit >= 4.8.35 +%endif %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 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-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}) %else -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-timer) < %{react_promise_timer_max_ver} -BuildRequires: php-composer(react/promise-timer) >= %{react_promise_timer_min_ver} -BuildRequires: php-composer(react/promise) < %{react_promise_max_ver} -BuildRequires: php-composer(react/promise) >= %{react_promise_min_ver} +BuildRequires: php-react-event-loop >= %{react_event_loop_min_ver} +BuildRequires: php-react-promise-timer >= %{react_promise_timer_min_ver} +BuildRequires: php-react-promise >= %{react_promise_min_ver} %endif -## phpcompatinfo (computed from version 1.3.0) +## phpcompatinfo (computed from version 1.4.0) BuildRequires: php-spl ## Autoloader BuildRequires: php-composer(fedora/autoloader) @@ -75,14 +85,11 @@ Requires: (php-composer(react/event-loop) >= %{react_event_loop_min_ver} wi Requires: (php-composer(react/promise-timer) >= %{react_promise_timer_min_ver} with php-composer(react/promise-timer) < %{react_promise_timer_max_ver}) Requires: (php-composer(react/promise) >= %{react_promise_min_ver} with php-composer(react/promise) < %{react_promise_max_ver}) %else -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-timer) < %{react_promise_timer_max_ver} -Requires: php-composer(react/promise-timer) >= %{react_promise_timer_min_ver} -Requires: php-composer(react/promise) < %{react_promise_max_ver} -Requires: php-composer(react/promise) >= %{react_promise_min_ver} +Requires: php-react-event-loop >= %{react_event_loop_min_ver} +Requires: php-react-promise-timer >= %{react_promise_timer_min_ver} +Requires: php-react-promise >= %{react_promise_min_ver} %endif -# phpcompatinfo (computed from version 1.3.0) +# phpcompatinfo (computed from version 1.4.0) Requires: php-spl # Autoloader Requires: php-composer(fedora/autoloader) @@ -128,17 +135,21 @@ cp -rp src %{buildroot}%{phpdir}/Clue/React/Block %check -%if %{with_tests} +%if %{with tests} : Mock Composer autoloader mkdir vendor -ln -s %{buildroot}%{phpdir}/Clue/React/Block/autoload.php vendor/autoload.php +cat <<'AUTOLOAD' | tee vendor/autoload.php +<?php +require_once '%{buildroot}%{phpdir}/Clue/React/Block/autoload.php'; +\Fedora\Autoloader\Autoload::addPsr4('Clue\\Tests\\React\\Block\\', dirname(__DIR__).'/tests'); +AUTOLOAD : Upstream tests RETURN_CODE=0 -PHPUNIT=$(which phpunit6) -for PHP_EXEC in "" php71 php72 php73 php74; do - if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then - $PHP_EXEC $PHPUNIT --verbose \ +for CMDARG in "php %{phpunit}" "php72 %{_bindir}/phpunit" php73 php74 php80; do + if which $CMDARG; then + set $CMDARG + $1 ${2:-%{_bindir}/phpunit9} --verbose \ || RETURN_CODE=1 fi done @@ -159,6 +170,10 @@ exit $RETURN_CODE %changelog +* Tue Nov 3 2020 Remi Collet <remi@remirepo.net> - 1.4.0-1 +- update to 1.4.0 +- switch to phpunit9 + * Sat Dec 14 2019 Shawn Iwinski <shawn@iwin.ski> - 1.3.1-3 - Use PHPUnit 6 |