summaryrefslogtreecommitdiffstats
path: root/php-react-cache.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-11-04 14:28:32 +0100
committerRemi Collet <remi@remirepo.net>2020-11-04 14:28:32 +0100
commitc35754b2b68107ee5d11feba1f2493c2f28f7f3e (patch)
treeb806c0a0469442f9eeb5b38e709bfa612d876142 /php-react-cache.spec
parent2364fc9cd539f2625775f8782281cea4acb9d6ce (diff)
update to 1.1.0
switch to phpunit9
Diffstat (limited to 'php-react-cache.spec')
-rw-r--r--php-react-cache.spec51
1 files changed, 33 insertions, 18 deletions
diff --git a/php-react-cache.spec b/php-react-cache.spec
index 731be9f..10b6b8b 100644
--- a/php-react-cache.spec
+++ b/php-react-cache.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-react-cache
#
-# 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,15 +12,16 @@
%global github_owner reactphp
%global github_name cache
-%global github_version 1.0.0
-%global github_commit aa10d63a1b40a36a486bdf527f28bac607ee6466
+%global github_version 1.1.0
+%global github_commit 44a568925556b0bd8cacc7b49fb0f1cf0d706a0c
%global composer_vendor react
%global composer_project cache
# "php": ">=5.3.0",
%global php_min_ver 5.3.0
-# "react/promise": "~2.0|~1.1"
+# "react/promise": "^3.0 || ~2.0|~1.1"
+# ignore v3 not yet packaged
%global react_promise_min_ver 1.1
%global react_promise_max_ver 3.0
@@ -36,21 +37,31 @@ Summary: Async caching
License: MIT
URL: https://reactphp.org/cache/
-Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
+
+# GitHub export does not include tests
+# Run php-react-cache-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} >= 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/promise) >= %{react_promise_min_ver} with php-composer(react/promise) < %{react_promise_max_ver})
%else
-BuildRequires: php-composer(react/promise) < %{react_promise_max_ver}
-BuildRequires: php-composer(react/promise) >= %{react_promise_min_ver}
+BuildRequires: php-react-promise >= %{react_promise_min_ver}
%endif
-## phpcompatinfo (computed from version 1.0.0)
+## phpcompatinfo (computed from version 1.1.0)
# <none>
## Autoloader
BuildRequires: php-composer(fedora/autoloader)
@@ -61,10 +72,9 @@ Requires: php(language) >= %{php_min_ver}
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
Requires: (php-composer(react/promise) >= %{react_promise_min_ver} with php-composer(react/promise) < %{react_promise_max_ver})
%else
-Requires: php-composer(react/promise) < %{react_promise_max_ver}
-Requires: php-composer(react/promise) >= %{react_promise_min_ver}
+Requires: php-react-promise >= %{react_promise_min_ver}
%endif
-# phpcompatinfo (computed from version 1.0.0)
+# phpcompatinfo (computed from version 1.1.0)
# <none>
# Autoloader
Requires: php-composer(fedora/autoloader)
@@ -112,18 +122,19 @@ cp -rp src %{buildroot}%{phpdir}/React/Cache
%check
%if %{with_tests}
: Create tests bootstrap
-cat <<'BOOTSTRAP' | tee bootstrap.php
+mkdir vendor
+cat <<'BOOTSTRAP' | tee vendor/autoload.php
<?php
require '%{buildroot}%{phpdir}/React/Cache/autoload.php';
-\Fedora\Autoloader\Autoload::addPsr4('React\\Tests\\Cache\\', __DIR__.'/tests');
+\Fedora\Autoloader\Autoload::addPsr4('React\\Tests\\Cache\\', dirname(__DIR__).'/tests');
BOOTSTRAP
: 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 --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
@@ -142,6 +153,10 @@ exit $RETURN_CODE
%changelog
+* Wed Nov 4 2020 Remi Collet <remi@remirepo.net> - 1.1.0-1
+- update to 1.1.0
+- switch to phpunit9
+
* Sat Dec 14 2019 Shawn Iwinski <shawn@iwin.ski> - 1.0.0-1
- Update to 1.0.0 (RHBZ #1727191)
- Use PHPUnit 6