diff options
-rw-r--r-- | .gitignore | 9 | ||||
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | composer.json | 23 | ||||
-rwxr-xr-x | dlothers.sh | 29 | ||||
-rw-r--r-- | php-rmccue-requests.spec | 57 |
5 files changed, 109 insertions, 13 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..01f0400 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +clog +package-*.xml +*.tgz +*.tar.bz2 +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..91b0fd5 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../../common/Makefile + diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..79744ce --- /dev/null +++ b/composer.json @@ -0,0 +1,23 @@ +{ + "name": "rmccue/requests", + "description": "A HTTP library written in PHP, for human beings.", + "homepage": "http://github.com/rmccue/Requests", + "license": "ISC", + "keywords": ["http", "idna", "iri", "ipv6", "curl", "sockets", "fsockopen"], + "authors": [ + { + "name": "Ryan McCue", + "homepage": "http://ryanmccue.info" + } + ], + "require": { + "php": ">=5.2" + }, + "require-dev": { + "requests/test-server": "dev-master" + }, + "type": "library", + "autoload": { + "psr-0": {"Requests": "library/"} + } +} diff --git a/dlothers.sh b/dlothers.sh new file mode 100755 index 0000000..6a7fd8f --- /dev/null +++ b/dlothers.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# This was borrowed from nodejs-grunt-contrib-concat + +tag=v1.8.0 + +set -e + +tmp=$(mktemp -d) + +trap cleanup EXIT +cleanup() { + set +e + [ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp" +} + +unset CDPATH +pwd=$(pwd) + +pushd "$tmp" +git clone https://github.com/WordPress/Requests.git +ls +cd Requests +git archive --prefix="docs/" --format=tar ${tag}:docs/ \ + | bzip2 > "$pwd"/docs-${tag}.tar.bz2 +git archive --prefix="examples/" --format=tar ${tag}:examples/ \ + | bzip2 > "$pwd"/examples-${tag}.tar.bz2 +git archive --prefix="tests/" --format=tar ${tag}:tests/ \ + | bzip2 > "$pwd"/tests-${tag}.tar.bz2 +popd diff --git a/php-rmccue-requests.spec b/php-rmccue-requests.spec index 8dc8e4a..9b34256 100644 --- a/php-rmccue-requests.spec +++ b/php-rmccue-requests.spec @@ -1,20 +1,34 @@ +# 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.7.0 -Release: 2%{?dist} +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/rmccue/Requests +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. -Source1: https://github.com/RequestsPHP/test-server/archive/26334a7583c96ae1f966a5d88af9aafaf279f948/requests-tests-26334a75.tar.gz +Source4: requests-tests-26334a75.tar.gz BuildRequires: php-composer(fedora/autoloader) BuildRequires: php-fedora-autoloader-devel BuildRequires: php-zip BuildRequires: phpunit -BuildRequires: procps-ng Requires: php(language) >= 5.5.0 Requires: php-composer(fedora/autoloader) @@ -48,9 +62,12 @@ We all have better things to do. That's why Requests was born. %prep -%autosetup -n Requests-%{version} +%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 @@ -74,28 +91,30 @@ cp -ar library/* %{buildroot}/%{_datadir}/php/rmccue/Requests sed -i "s:include.*:require('%{buildroot}/%{_datadir}/php/rmccue/Requests/autoload.php');:" \ tests/bootstrap.php -if [ "$(netstat -ln | grep 8080)" != "" ] +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:8080 \ - test-server-26334a7583c96ae1f966a5d88af9aafaf279f948/bin/serve.php & +%{_bindir}/php -S 127.0.0.1:$port \ + test-server-26334a7583c96ae1f966a5d88af9aafaf279f948/bin/serve.php >serve.log 2>&1 & PHPPID=$! -pushd tests # 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:8080" phpunit --bootstrap bootstrap.php \ +REQUESTS_TEST_HOST="127.0.0.1:$port" phpunit --no-coverage --bootstrap tests/bootstrap.php \ --filter \ - ^\(\(?!\(testHTTPS\|testAlternateNameSupport\|testSNISupport\|testAlternatePort\)\).\)*$ || \ + ^\(\(?!\(testHTTPS\|testExpiredHTTPS\|testRevokedHTTPS\|testBadDomain\|testResponseByteLimit\|testResponseByteLimitWithFile\|testAlternateNameSupport\|testSNISupport\)\).\)*$ || \ (kill $PHPPID && exit 1) -popd kill $PHPPID %files +%{!?_licensedir:%global license %%doc} %license LICENSE %doc CHANGELOG.md %doc composer.json @@ -106,6 +125,18 @@ kill $PHPPID %changelog +* Wed May 12 2021 Sundeep Anand <suanand@redhat.com> - 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 <remi@remirepo.net> - 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 <remi@remirepo.net> - 1.7.0-2 +- backport for #remirepo + * Sun Mar 05 2017 Randy Barlow <bowlofeggs@fedoraproject.org> - 1.7.0-2 - Change license tag to ISC and BSD. - Use a better method for killing the test server. |