summaryrefslogtreecommitdiffstats
path: root/php-guzzlehttp-promises.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-guzzlehttp-promises.spec')
-rw-r--r--php-guzzlehttp-promises.spec46
1 files changed, 25 insertions, 21 deletions
diff --git a/php-guzzlehttp-promises.spec b/php-guzzlehttp-promises.spec
index bbb6f3f..3090e38 100644
--- a/php-guzzlehttp-promises.spec
+++ b/php-guzzlehttp-promises.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-guzzlehttp-promises
#
-# Copyright (c) 2015-2016 Shawn Iwinski <shawn.iwinski@gmail.com>
+# Copyright (c) 2015-2021 Shawn Iwinski <shawn.iwinski@gmail.com>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -10,19 +10,18 @@
# Please preserve changelog entries
#
+%bcond_without tests
+
%global github_owner guzzle
%global github_name promises
-%global github_version 1.3.1
-%global github_commit a59da6cf61d80060647ff4d3eb2c03a2bc694646
+%global github_version 1.4.1
+%global github_commit 8e7d04f1f6450fef59366c399cfad4b9383aa30d
%global composer_vendor guzzlehttp
%global composer_project promises
-# "php": ">=5.5.0"
-%global php_min_ver 5.5.0
-
-# Build using "--without tests" to disable tests
-%global with_tests 0%{!?_without_tests:1}
+# "php": ">=5.5"
+%global php_min_ver 5.5
%{!?phpdir: %global phpdir %{_datadir}/php}
@@ -43,21 +42,21 @@ Source1: %{name}-get-source.sh
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
# Tests
-%if %{with_tests}
+%if %{with tests}
## composer.json
BuildRequires: php(language) >= %{php_min_ver}
-BuildRequires: php-composer(phpunit/phpunit)
-## phpcompatinfo (computed from version 1.3.1)
+BuildRequires: phpunit9
+## phpcompatinfo (computed from version 1.4.1)
BuildRequires: php-json
BuildRequires: php-reflection
BuildRequires: php-spl
+%endif
## Autoloader
BuildRequires: php-composer(fedora/autoloader)
-%endif
# composer.json
Requires: php(language) >= %{php_min_ver}
-# phpcompatinfo (computed from version 1.3.1)
+# phpcompatinfo (computed from version 1.4.1)
Requires: php-json
Requires: php-spl
# Autoloader
@@ -106,18 +105,19 @@ cp -rp src/* %{buildroot}%{phpdir}/GuzzleHttp/Promise/
%check
-%if %{with_tests}
-sed "s#require.*autoload.*#require '%{buildroot}%{phpdir}/GuzzleHttp/Promise/autoload.php';#" \
- -i tests/bootstrap.php
-
-: Upstream tests
-%{_bindir}/phpunit --verbose
+%if %{with tests}
+mkdir vendor
+cat << 'EOF' | tee vendor/autoload.php
+<?php
+require "%{buildroot}%{phpdir}/GuzzleHttp/Promise/autoload.php";
+\Fedora\Autoloader\Autoload::addPsr4('GuzzleHttp\\Promise\\Tests\\', dirname(__DIR__).'/tests');
+EOF
: Upstream tests with SCLs if available
SCL_RETURN_CODE=0
-for SCL in php56 php70 php71; do
+for SCL in php php73 php74 php80; do
if which $SCL; then
- $SCL %{_bindir}/phpunit || SCL_RETURN_CODE=1
+ $SCL %{_bindir}/phpunit9 || SCL_RETURN_CODE=1
fi
done
exit $SCL_RETURN_CODE
@@ -141,6 +141,10 @@ rm -rf %{buildroot}
%changelog
+* Wed Mar 31 2021 Remi Collet <remi@remirepo.net> - 1.4.1-1
+- update to 1.4.1
+- switch to phpunit9
+
* Wed Dec 07 2016 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.1-1
- Updated to 1.3.1 (RHBZ #1406764)
- Run upstream tests with SCLs if they are available