# remirepo spec for php-guzzlehttp-ringphp, from Fedora: # # Fedora spec file for php-guzzlehttp-ringphp # # Copyright (c) 2014-2021 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT # # Please preserve changelog entries # %global github_owner guzzle %global github_name RingPHP %global github_version 1.1.1 %global github_commit 5e2a174052995663dd68e6b5ad838afd47dd615b %global composer_vendor guzzlehttp %global composer_project ringphp # "php": ">=5.4.0" %global php_min_ver 5.4.0 # "guzzlehttp/streams": "~3.0" %global streams_min_ver 3.0.0 %global streams_max_ver 4.0 # "react/promise": "~2.0" %global promise_min_ver 2.2.0 %global promise_max_ver 3.0 # Build using "--without tests" to disable tests %global with_tests %{?_without_tests:0}%{!?_without_tests:1} %{!?phpdir: %global phpdir %{_datadir}/php} %{!?testsdir: %global testsdir %{_datadir}/tests} Name: php-%{composer_vendor}-%{composer_project} Version: %{github_version} Release: 7%{?github_release}%{?dist} Summary: Simple handler system used to power clients and servers in PHP License: MIT URL: http://ringphp.readthedocs.org Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz # Fix #41 use proper proxy attribute without ending / # https://github.com/guzzle/RingPHP/pull/42 # https://github.com/guzzle/RingPHP/pull/42.patch Patch0: %{name}-upstream-pull-42.patch BuildArch: noarch # Tests %if %{with_tests} BuildRequires: nodejs BuildRequires: %{_bindir}/phpunit ## composer.json BuildRequires: php(language) >= %{php_min_ver} %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 BuildRequires: (php-composer(guzzlehttp/streams) >= %{streams_min_ver} with php-composer(guzzlehttp/streams) < %{streams_max_ver}) BuildRequires: (php-composer(react/promise) >= %{promise_min_ver} with php-composer(react/promise) < %{promise_max_ver}) %else BuildRequires: php-composer(guzzlehttp/streams) < %{streams_max_ver} BuildRequires: php-composer(guzzlehttp/streams) >= %{streams_min_ver} BuildRequires: php-composer(react/promise) < %{promise_max_ver} BuildRequires: php-composer(react/promise) >= %{promise_min_ver} %endif BuildRequires: php-curl ## phpcompatinfo (computed from version 1.1.0) BuildRequires: php-json BuildRequires: php-pcre BuildRequires: php-reflection BuildRequires: php-spl BuildRequires: php-zlib ## Autoloader BuildRequires: php-composer(fedora/autoloader) %endif # composer.json Requires: php(language) >= %{php_min_ver} %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 Requires: (php-composer(guzzlehttp/streams) >= %{streams_min_ver} with php-composer(guzzlehttp/streams) < %{streams_max_ver}) Requires: (php-composer(react/promise) >= %{promise_min_ver} with php-composer(react/promise) < %{promise_max_ver}) %else Requires: php-composer(guzzlehttp/streams) < %{streams_max_ver} Requires: php-composer(guzzlehttp/streams) >= %{streams_min_ver} Requires: php-composer(react/promise) < %{promise_max_ver} Requires: php-composer(react/promise) >= %{promise_min_ver} %endif # composer.json: optional Requires: php-curl # phpcompatinfo (computed from version 1.1.0) Requires: php-spl # Autoloader Requires: php-composer(fedora/autoloader) # Composer Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} %description Provides low level APIs used to power HTTP clients and servers through a simple, PHP callable that accepts a request hash and returns a future response hash. RingPHP supports both synchronous and asynchronous workflows by utilizing both futures and promises [1]. RingPHP is inspired by Clojure's Ring [2], but has been modified to accommodate clients and servers for both blocking and non-blocking requests. [1] https://github.com/reactphp/promise [2] https://github.com/ring-clojure/ring # ------------------------------------------------------------------------------ %package tests Summary: Tests for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: nodejs Requires: php-composer(phpunit/phpunit) # phpcompatinfo (computed from version 1.1.0) Requires: php-json Requires: php-pcre Requires: php-reflection Requires: php-zlib %description tests %{summary}. # ------------------------------------------------------------------------------ %prep %setup -qn %{github_name}-%{github_commit} # Fix #41 use proper proxy attribute without ending / %patch0 -p1 : Modify tests bootstrap sed -e "s#.*require.*autoload.*#require __DIR__ . '/autoload.php';#" \ -i tests/bootstrap.php %build : Create library autoloader cat <<'AUTOLOAD' | tee src/autoload.php . PHPUNIT %install : Library mkdir -p %{buildroot}%{phpdir}/GuzzleHttp/Ring cp -rp src/* %{buildroot}%{phpdir}/GuzzleHttp/Ring/ : Tests mkdir -p %{buildroot}%{testsdir} cp -rp tests %{buildroot}%{testsdir}/%{name} cp -p phpunit.xml.dist %{buildroot}%{testsdir}/%{name}/ %check %if %{with_tests} : Upstream tests # testEmitsDebugInfoToStream have strange failure on F29+ # testCreatesCurlHandle and testEmitsProgressToFunction fail on F35+ RETURN_CODE=0 for PHP_EXEC in php %{?rhel:php55 php56 php70 php71 php72} php73 php74 php80; do if [ "php" == "$PHP_EXEC" ] || which $PHP_EXEC; then $PHP_EXEC %{_bindir}/phpunit --verbose \ --filter '^((?!(testEmitsDebugInfoToStream|testCreatesCurlHandle|testEmitsProgressToFunction)).)*$' \ --configuration %{buildroot}%{testsdir}/%{name} \ || RETURN_CODE=1 fi done exit $RETURN_CODE %else : Tests skipped %endif %files %{!?_licensedir:%global license %%doc} %license LICENSE %doc *.md %doc *.rst %doc composer.json %{phpdir}/GuzzleHttp/Ring %files tests %{testsdir}/%{name} %changelog * Thu Apr 1 2021 Remi Collet - 1.1.1-7 - skip 2 tests failing with PHP 8 * Tue Oct 16 2018 Remi Collet - 1.1.1-1 - update to 1.1.1 for PHP 7.3 compatibility - use range dependencies - skip 1 test with strange failure on F29+ (everything seems ok) * Fri Apr 07 2017 Shawn Iwinski - 1.1.0-9 - Fix rawhide (F27) FTBS - Switch autoloader to php-composer(fedora/autoloader) - Test with SCLs if available * Tue Sep 22 2015 Shawn Iwinski - 1.1.0-6 - Updated autoloader to load dependencies after self registration - Minor cleanups * Sun Jun 28 2015 Shawn Iwinski - 1.1.0-5 - Autoloader updates * Fri Jun 12 2015 Shawn Iwinski - 1.1.0-3 - Fix tests' autoload * Fri Jun 12 2015 Shawn Iwinski - 1.1.0-2 - Use new $fedoraClassLoader concept in autoloader - Remove secondary "tests" directory from tests sub-package * Mon Jun 01 2015 Shawn Iwinski - 1.1.0-1 - Updated to 1.1.0 - Updated source URL - Added autoloader - Sub-packaged tests * Fri Feb 13 2015 Remi Collet - 1.0.5-1 - backport for remi repository * Sun Dec 28 2014 Shawn Iwinski - 1.0.5-1 - Updated to 1.0.5 * Thu Nov 13 2014 Shawn Iwinski - 1.0.3-1 - Updated to 1.0.3 - Removed color turn off and default timezone for phpunit * Mon Oct 27 2014 Shawn Iwinski - 1.0.1-1 - Initial package