From 2a103e7ae96600b15197b5cb32cd9b8eeb3da576 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 4 Nov 2020 14:22:14 +0100 Subject: update to 1.4.0 switch to phpunit9 --- php-react-dns.spec | 78 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 35 deletions(-) (limited to 'php-react-dns.spec') diff --git a/php-react-dns.spec b/php-react-dns.spec index d758237..4044334 100644 --- a/php-react-dns.spec +++ b/php-react-dns.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-react-dns # -# 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 dns -%global github_version 1.2.0 -%global github_commit a214d90c2884dac18d0cac6176202f247b66d762 +%global github_version 1.4.0 +%global github_commit 665260757171e2ab17485b44e7ffffa7acb6ca1f %global composer_vendor react %global composer_project dns @@ -29,7 +29,8 @@ # "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.7 || ^1.2.1" +# "react/promise": "^3.0 || ^2.7 || ^1.2.1" +# ignore v3 not yet packaged %global react_promise_min_ver 1.2.1 %global react_promise_max_ver 3.0 # "react/promise-timer": "^1.2" @@ -37,7 +38,7 @@ %global react_promise_timer_max_ver 2.0 # Build using "--without tests" to disable tests -%global with_tests 0%{!?_without_tests:1} +%bcond_without tests %{!?phpdir: %global phpdir %{_datadir}/php} @@ -48,14 +49,25 @@ Summary: Async DNS resolver License: MIT URL: https://reactphp.org/dns/ -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-dns-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: phpunit7 +%if 0%{?fedora} >= 32 || 0%{?rhel} >= 9 +# "phpunit/phpunit": "^9.3 || ^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(clue/block-react) >= %{clue_block_react_min_ver} with php-composer(clue/block-react) < %{clue_block_react_max_ver}) BuildRequires: (php-composer(react/cache) >= %{react_cache_min_ver} with php-composer(react/cache) < %{react_cache_max_ver}) @@ -63,18 +75,13 @@ BuildRequires: (php-composer(react/event-loop) >= %{react_event_loop_min_ver} wi 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(clue/block-react) < %{clue_block_react_max_ver} -BuildRequires: php-composer(clue/block-react) >= %{clue_block_react_min_ver} -BuildRequires: php-composer(react/cache) < %{react_cache_max_ver} -BuildRequires: php-composer(react/cache) >= %{react_cache_min_ver} -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-clue-block-react >= %{clue_block_react_min_ver} +BuildRequires: php-react-cache >= %{react_cache_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.2.0) +## phpcompatinfo (computed from version 1.4.0) BuildRequires: php-filter BuildRequires: php-json BuildRequires: php-pcre @@ -93,16 +100,12 @@ 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/cache) < %{react_cache_max_ver} -Requires: php-composer(react/cache) >= %{react_cache_min_ver} -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-cache >= %{react_cache_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.2.0) +# phpcompatinfo (computed from version 1.4.0) Requires: php-filter Requires: php-pcre Requires: php-reflection @@ -155,13 +158,14 @@ cp -rp src %{buildroot}%{phpdir}/React/Dns %check -%if %{with_tests} +%if %{with tests} : Create tests bootstrap -cat <<'BOOTSTRAP' | tee bootstrap.php +mkdir vendor +cat <<'BOOTSTRAP' | tee vendor/autoload.php - 1.4.0-1 +- update to 1.4.0 +- switch to phpunit9 + * Sat Dec 14 2019 Shawn Iwinski - 1.2.0-1 - Update to 1.2.0 (RHBZ #1597271) - Use PHPUnit 7 -- cgit