summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json4
-rw-r--r--php-react-promise-timer.spec61
2 files changed, 39 insertions, 26 deletions
diff --git a/composer.json b/composer.json
index 1fdaddd..f3420b8 100644
--- a/composer.json
+++ b/composer.json
@@ -20,9 +20,9 @@
"require": {
"php": ">=5.3",
"react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5",
- "react/promise": "^2.7.0 || ^1.2.1"
+ "react/promise": "^3.0 || ^2.7.0 || ^1.2.1"
},
"require-dev": {
- "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35"
+ "phpunit/phpunit": "^9.0 || ^5.7 || ^4.8.35"
}
}
diff --git a/php-react-promise-timer.spec b/php-react-promise-timer.spec
index cd17dd5..ec28d1b 100644
--- a/php-react-promise-timer.spec
+++ b/php-react-promise-timer.spec
@@ -12,8 +12,8 @@
%global github_owner reactphp
%global github_name promise-timer
-%global github_version 1.5.1
-%global github_commit 35fb910604fd86b00023fc5cda477c8074ad0abc
+%global github_version 1.6.0
+%global github_commit daee9baf6ef30c43ea4c86399f828bb5f558f6e6
%global composer_vendor react
%global composer_project promise-timer
@@ -23,12 +23,13 @@
# "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5"
%global react_event_loop_min_ver 0.3.5
%global react_event_loop_max_ver 2.0
-# "react/promise": "^2.7.0 || ^1.2.1"
+# "react/promise": "^3.0 || ^2.7.0 || ^1.2.1"
+# ignore v3 not yet packaged
%global react_promise_min_ver 1.2.1
%global react_promise_max_ver 3.0
# Build using "--without tests" to disable tests
-%global with_tests 0%{!?_without_tests:1}
+%bcond_without tests
%{!?phpdir: %global phpdir %{_datadir}/php}
@@ -39,24 +40,33 @@ Summary: Trivial timeout implementation for Promises
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-react-promise-timer-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) >= %{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) < %{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 >= %{react_promise_min_ver}
%endif
-## phpcompatinfo (computed from version 1.5.0)
+## phpcompatinfo (computed from version 1.6.0)
BuildRequires: php-spl
## Autoloader
BuildRequires: php-composer(fedora/autoloader)
@@ -68,12 +78,10 @@ Requires: php(language) >= %{php_min_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})
%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) < %{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 >= %{react_promise_min_ver}
%endif
-# phpcompatinfo (computed from version 1.5.0)
+# phpcompatinfo (computed from version 1.6.0)
Requires: php-spl
# Autoloader
Requires: php-composer(fedora/autoloader)
@@ -117,20 +125,21 @@ cp -rp src %{buildroot}%{phpdir}/React/Promise/Timer
%check
-%if %{with_tests}
+%if %{with tests}
: Create tests bootstrap
-cat <<'BOOTSTRAP' | tee bootstrap.php
+mkdir vendor
+cat <<'BOOTSTRAP' | tee vendor/autoload.php
<?php
require '%{buildroot}%{phpdir}/React/Promise/Timer/autoload.php';
-\Fedora\Autoloader\Autoload::addPsr4('React\\Tests\\Promise\\Timer\\', __DIR__.'/tests');
+\Fedora\Autoloader\Autoload::addPsr4('React\\Tests\\Promise\\Timer\\', dirname(__DIR__).'/tests');
BOOTSTRAP
: Upstream tests
RETURN_CODE=0
-PHPUNIT=$(which phpunit6)
-for PHP_EXEC in "" %{?rhel:php54 php55 php70} php71 php72 php73 php74; do
- if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then
- $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php \
+for CMDARG in "php %{phpunit}" "php72 %{_bindir}/phpunit" php74 php80; do
+ if which $CMDARG; then
+ set $CMDARG
+ $1 ${2:-%{_bindir}/phpunit9} --verbose \
|| RETURN_CODE=1
fi
done
@@ -149,6 +158,10 @@ exit $RETURN_CODE
%changelog
+* Wed Nov 4 2020 Remi Collet <remi@remirepo.net> - 1.6.0-1
+- update to 1.6.0
+- switch to phpunit9
+
* Sat Dec 14 2019 Shawn Iwinski <shawn@iwin.ski> - 1.5.1-1
- Update to 1.5.1 (RHBZ #1693418)
- Use PHPUnit 6