summaryrefslogtreecommitdiffstats
path: root/php-react-dns.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-react-dns.spec')
-rw-r--r--php-react-dns.spec113
1 files changed, 64 insertions, 49 deletions
diff --git a/php-react-dns.spec b/php-react-dns.spec
index 0d650b6..c7d185e 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 Shawn Iwinski <shawn@iwin.ski>
+# Copyright (c) 2017-2018 Shawn Iwinski <shawn@iwin.ski>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -12,30 +12,33 @@
%global github_owner reactphp
%global github_name dns
-%global github_version 0.4.8
-%global github_commit 86d3da64ebfbecddf6b940c6e69daa67c0f21a05
+%global github_version 0.4.14
+%global github_commit 75ae3286c03eb022a6fbf909e6148d5022588ba4
%global composer_vendor react
%global composer_project dns
# "php": ">=5.3.0"
%global php_min_ver 5.3.0
-# "react/cache": "~0.4.0|~0.3.0"
+# "clue/block-react": "^1.2"
+%global clue_block_react_min_ver 1.2
+%global clue_block_react_max_ver 2.0
+# "react/cache": "^0.5 || ^0.4 || ^0.3"
%global react_cache_min_ver 0.3.0
-%global react_cache_max_ver 0.5.0
-# "react/promise": "~2.1|~1.2"
+%global react_cache_max_ver 0.6.0
+# "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.1 || ^1.2.1"
# NOTE: Min version not 1.2 to restrict to one major version
%global react_promise_min_ver 2.1
%global react_promise_max_ver 3.0
-# "react/promise-timer": "~1.1"
-%global react_promise_timer_min_ver 1.1
+# "react/promise-timer": "^1.2"
+%global react_promise_timer_min_ver 1.2
%global react_promise_timer_max_ver 2.0
-# "react/socket": "^0.7 || ^0.6 || ^0.5 || ^0.4.4"
-%global react_socket_min_ver 0.4.4
-%global react_socket_max_ver 1.0
-# "react/stream": "^0.6 || ^0.5 || ^0.4.5"
+# "react/stream": "^1.0 || ^0.7 || ^0.6 || ^0.5 || ^0.4.5"
%global react_stream_min_ver 0.4.5
-%global react_stream_max_ver 1.0
+%global react_stream_max_ver 2.0
# Build using "--without tests" to disable tests
%global with_tests 0%{!?_without_tests:1}
@@ -49,8 +52,8 @@ Summary: Async DNS resolver
Group: Development/Libraries
License: MIT
-URL: https://github.com/%{github_owner}/%{github_name}
-Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
+URL: https://reactphp.org/dns/
+Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
BuildArch: noarch
# Tests
@@ -58,17 +61,28 @@ BuildArch: noarch
## composer.json
BuildRequires: php(language) >= %{php_min_ver}
BuildRequires: php-composer(phpunit/phpunit)
+%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})
+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-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})
+BuildRequires: (php-composer(react/stream) >= %{react_stream_min_ver} with php-composer(react/stream) < %{react_stream_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-composer(react/socket) < %{react_socket_max_ver}
-BuildRequires: php-composer(react/socket) >= %{react_socket_min_ver}
BuildRequires: php-composer(react/stream) < %{react_stream_max_ver}
BuildRequires: php-composer(react/stream) >= %{react_stream_min_ver}
-## phpcompatinfo (computed from version 0.4.8)
+%endif
+## phpcompatinfo (computed from version 0.4.14)
BuildRequires: php-date
BuildRequires: php-pcre
BuildRequires: php-reflection
@@ -79,17 +93,25 @@ BuildRequires: php-composer(fedora/autoloader)
# composer.json
Requires: php(language) >= %{php_min_ver}
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+Requires: (php-composer(react/cache) >= %{react_cache_min_ver} with php-composer(react/cache) < %{react_cache_max_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-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})
+Requires: (php-composer(react/stream) >= %{react_stream_min_ver} with php-composer(react/stream) < %{react_stream_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-composer(react/socket) < %{react_socket_max_ver}
-Requires: php-composer(react/socket) >= %{react_socket_min_ver}
Requires: php-composer(react/stream) < %{react_stream_max_ver}
Requires: php-composer(react/stream) >= %{react_stream_min_ver}
-# phpcompatinfo (computed from version 0.4.8)
+%endif
+# phpcompatinfo (computed from version 0.4.14)
Requires: php-date
Requires: php-pcre
Requires: php-spl
@@ -127,9 +149,9 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Dependencies::required(array(
'%{phpdir}/React/Cache/autoload.php',
+ '%{phpdir}/React/EventLoop/autoload.php',
'%{phpdir}/React/Promise/autoload.php',
'%{phpdir}/React/Promise/Timer/autoload.php',
- '%{phpdir}/React/Socket/autoload.php',
'%{phpdir}/React/Stream/autoload.php',
));
AUTOLOAD
@@ -146,6 +168,7 @@ cp -rp src %{buildroot}%{phpdir}/React/Dns
cat <<'BOOTSTRAP' | tee bootstrap.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');
BOOTSTRAP
@@ -153,35 +176,22 @@ BOOTSTRAP
sed 's/function testResolveGoogleResolves/function SKIP_testResolveGoogleResolves/' \
-i tests/FunctionalResolverTest.php
+: Skip tests known to fail in buildroot env
+sed 's/function testLoadsDefaultPath/function SKIP_testLoadsDefaultPath/' \
+ -i tests/Config/ConfigTest.php
+sed -e 's/function testResolveInvalidRejects/function SKIP_testResolveInvalidRejects/' \
+ -e 's/function testResolveCancelledRejectsImmediately/function SKIP_testResolveCancelledRejectsImmediately/' \
+ -i tests/FunctionalResolverTest.php
+sed 's/function testQueryRejectsOnCancellation/function SKIP_testQueryRejectsOnCancellation/' \
+ -i tests/Query/UdpTransportExecutorTest.php
+
: Upstream tests
RETURN_CODE=0
-for PHP_EXEC in php %{?rhel:php54 php55} php56 php70 php71 php72; do
- if [ "php" = "$PHP_EXEC" ] || which $PHP_EXEC; then
- if [ $($PHP_EXEC -r 'echo (PHP_VERSION_ID >= 70100 ? 1 : 0);') ]; then
- : Skip tests known to fail
- : See https://github.com/reactphp/dns/issues/55
- : See https://github.com/reactphp/dns/pull/56
-
- # Allow multiple runs of this conditional logic
- [ -e tests/Query/ExecutorTest.php.dist ] && \
- mv tests/Query/ExecutorTest.php.dist tests/Query/ExecutorTest.php
- cp tests/Query/ExecutorTest.php tests/Query/ExecutorTest.php.dist
-
- # These test functions do not start with "test" and instead are marked with "/** @test */"
- for FUNC in \
- resolveShouldRetryWithTcpIfResponseIsTruncated \
- resolveShouldRetryWithTcpIfUdpThrows \
- resolveShouldCancelTimerWhenFullResponseIsReceived
- do
- # Get function line
- FUNC_LINE=$(grep -n "function ${FUNC}" tests/Query/ExecutorTest.php | cut -d : -f 1)
- # Delete previous line (i.e. "/** @test */")
- LINE=$(expr ${FUNC_LINE} - 1)
- sed "${LINE}d" -i tests/Query/ExecutorTest.php
- done
- fi
-
- $PHP_EXEC %{_bindir}/phpunit --verbose --bootstrap bootstrap.php || RETURN_CODE=1
+PHPUNIT=$(which phpunit)
+for PHP_EXEC in "" %{?rhel:php54 php55} php70 php71 php72 php73; do
+ if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then
+ $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php \
+ || RETURN_CODE=1
fi
done
exit $RETURN_CODE
@@ -199,6 +209,11 @@ exit $RETURN_CODE
%changelog
+* Mon Jul 02 2018 Shawn Iwinski <shawn@iwin.ski> - 0.4.14-1
+- Update to 0.4.14 (RHBZ #1447154)
+- Add range version dependencies for Fedora >= 27 || RHEL >= 8
+- Add composer.json to repo
+
* Sat Apr 29 2017 Shawn Iwinski <shawn@iwin.ski> - 0.4.8-1
- Update to 0.4.8 (RHBZ #1443522)