# remirepo spec file for php-rmccue-requests # # Fedora spec file for php-rmccue-requests # # License: MIT # http://opensource.org/licenses/MIT # # Please preserve changelog entries # Name: php-rmccue-requests Version: 1.8.0 Release: 1%{?dist} BuildArch: noarch License: ISC and BSD Summary: Requests for PHP is a humble HTTP request library URL: https://github.com/WordPress/Requests Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz # Upstream strips docs, examples and tests from the tarball, # so we have to generate it manually. # dlothers.sh is used to do this, and is included in this repository. Source1: docs-v%{version}.tar.bz2 Source2: examples-v%{version}.tar.bz2 Source3: tests-v%{version}.tar.bz2 # This is only needed to run the test suite. Source4: requests-tests-26334a75.tar.gz BuildRequires: php-composer(fedora/autoloader) BuildRequires: php-fedora-autoloader-devel BuildRequires: php-zip BuildRequires: phpunit Requires: php(language) >= 5.5.0 Requires: php-composer(fedora/autoloader) Requires: php-curl Requires: php-date Requires: php-json Requires: php-openssl Requires: php-pcre Requires: php-spl Requires: php-zlib Provides: php-composer(rmccue/requests) = %{version} %description Requests for PHP simplifies how you interact with other sites and takes away all your worries. Requests is a HTTP library written in PHP, for human beings. It is roughly based on the API from the excellent Requests Python library. Requests is ISC Licensed (similar to the new BSD license) and has no dependencies, except for PHP 5.2+. Despite PHP's use as a language for the web, its tools for sending HTTP requests are severely lacking. cURL has an interesting API, to say the least, and you can't always rely on it being available. Sockets provide only low level access, and require you to build most of the HTTP response parsing yourself. We all have better things to do. That's why Requests was born. %prep %autosetup -n Requests-%{version} -p1 tar xvf %{S:1} tar xvf %{S:2} tar xvf %{S:3} tar xvf %{S:4} # Remove the bundled CA list and use Fedora's rm library/Requests/Transport/cacert.pem ln -s %{_sysconfdir}/pki/ca-trust/extracted/pem/tls-ca-bundle.pem \ library/Requests/Transport/cacert.pem %build %{_bindir}/phpab --format fedora --output library/autoload.php library %install install -d -p -m 0755 %{buildroot}/%{_datadir}/php install -d -p -m 0755 %{buildroot}/%{_datadir}/php/rmccue install -d -p -m 0755 %{buildroot}/%{_datadir}/php/rmccue/Requests cp -ar library/* %{buildroot}/%{_datadir}/php/rmccue/Requests %check sed -i "s:include.*:require('%{buildroot}/%{_datadir}/php/rmccue/Requests/autoload.php');:" \ tests/bootstrap.php port=$(expr 8070 + %{?fedora}%{?rhel}) : use port $port to allow parallel build if [ "$(netstat -ln | grep $port)" != "" ] then kill php fi %{_bindir}/php -S 127.0.0.1:$port \ test-server-26334a7583c96ae1f966a5d88af9aafaf279f948/bin/serve.php >serve.log 2>&1 & PHPPID=$! # The request test server doesn't run over TLS so we skip HTTPS tests. The other tests fail if they # can't resolve domain names, so they are skipped as well. REQUESTS_TEST_HOST="127.0.0.1:$port" phpunit --no-coverage --bootstrap tests/bootstrap.php \ --filter \ ^\(\(?!\(testHTTPS\|testExpiredHTTPS\|testRevokedHTTPS\|testBadDomain\|testResponseByteLimit\|testResponseByteLimitWithFile\|testAlternateNameSupport\|testSNISupport\)\).\)*$ || \ (kill $PHPPID && exit 1) kill $PHPPID %files %{!?_licensedir:%global license %%doc} %license LICENSE %doc CHANGELOG.md %doc composer.json %doc docs %doc examples %doc README.md %{_datadir}/php/rmccue %changelog * Wed May 12 2021 Sundeep Anand - 1.8.0-1 - Update to 1.8.0 (rhbz#1954316) - Add dlothers.sh to download docs, examples and tests - Drop php-rmccue-requests-pr297.patch * Mon Oct 23 2017 Remi Collet - 1.7.0-4 - fix FTBFS from Koschei, add path for recent PHPUnit from https://github.com/rmccue/Requests/pull/297 * Thu Mar 9 2017 Remi Collet - 1.7.0-2 - backport for #remirepo * Sun Mar 05 2017 Randy Barlow - 1.7.0-2 - Change license tag to ISC and BSD. - Use a better method for killing the test server. * Sun Feb 19 2017 Randy Barlow - 1.7.0-1 - Initial release.