diff options
Diffstat (limited to 'php-react-dns.spec')
-rw-r--r-- | php-react-dns.spec | 78 |
1 files changed, 43 insertions, 35 deletions
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 <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 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 <?php require '%{buildroot}%{phpdir}/React/Dns/autoload.php'; require '%{phpdir}/Clue/React/Block/autoload.php'; -\Fedora\Autoloader\Autoload::addPsr4('React\\Tests\\Dns\\', __DIR__.'/tests'); +\Fedora\Autoloader\Autoload::addPsr4('React\\Tests\\Dns\\', dirname(__DIR__).'/tests'); BOOTSTRAP : Skip test requiring network access and/or fail in restrictive buildroot env -- i.e. Bodhi @@ -185,10 +189,10 @@ rm -f tests/Protocol/ParserTest.php : Upstream tests RETURN_CODE=0 -PHPUNIT=$(which phpunit7) -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 @@ -207,6 +211,10 @@ exit $RETURN_CODE %changelog +* Wed Nov 4 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.2.0-1 - Update to 1.2.0 (RHBZ #1597271) - Use PHPUnit 7 |