diff options
author | Remi Collet <remi@remirepo.net> | 2019-09-11 15:17:10 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2019-09-11 15:17:10 +0200 |
commit | 9c12e137e98700ec7b27bb9ededc13a65463fae0 (patch) | |
tree | 2c2af7f21aaadab79e217bfdd65c110bfb094841 | |
parent | 67a29e7f74da8129e5b1e69f4885076cc8dea53a (diff) |
- update to 5.0.1
- drop patch merged upstream
- switch to phpunit7
-rw-r--r-- | composer.json | 6 | ||||
-rw-r--r-- | php-sabre-http5-php74.patch | 23 | ||||
-rw-r--r-- | php-sabre-http5.spec | 44 |
3 files changed, 31 insertions, 42 deletions
diff --git a/composer.json b/composer.json index 9f39f4c..851a087 100644 --- a/composer.json +++ b/composer.json @@ -5,15 +5,15 @@ "homepage" : "https://github.com/fruux/sabre-http", "license" : "BSD-3-Clause", "require" : { - "php" : ">=7.0", + "php" : "^7.0", "ext-mbstring" : "*", "ext-ctype" : "*", + "ext-curl" : "*", "sabre/event" : ">=4.0 <6.0", "sabre/uri" : "^2.0" }, "require-dev" : { - "phpunit/phpunit" : ">=6.0.0", - "sabre/cs" : "~1.0.0" + "phpunit/phpunit" : "^6.0 || ^7.0" }, "suggest" : { "ext-curl" : " to make http requests with the Client class" diff --git a/php-sabre-http5-php74.patch b/php-sabre-http5-php74.patch deleted file mode 100644 index 5e41957..0000000 --- a/php-sabre-http5-php74.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up ./lib/Auth/Digest.php.up ./lib/Auth/Digest.php ---- ./lib/Auth/Digest.php.up 2019-08-20 14:37:51.705235293 +0200 -+++ ./lib/Auth/Digest.php 2019-08-20 14:38:29.371438395 +0200 -@@ -118,7 +118,7 @@ class Digest extends AbstractAuth { - */ - function getUsername() { - -- return $this->digestParts['username']; -+ return $this->digestParts['username'] ?? null; - - } - -@@ -127,6 +127,10 @@ class Digest extends AbstractAuth { - */ - protected function validate() : bool { - -+ if (!is_array($this->digestParts)) { -+ return false; -+ } -+ - $A2 = $this->request->getMethod() . ':' . $this->digestParts['uri']; - - if ($this->digestParts['qop'] == 'auth-int') { diff --git a/php-sabre-http5.spec b/php-sabre-http5.spec index 2c4bf8e..be4ec07 100644 --- a/php-sabre-http5.spec +++ b/php-sabre-http5.spec @@ -7,7 +7,7 @@ # Please, preserve the changelog entries # # Github -%global gh_commit f91c7d4437dcbc6f89c8b64e855e1544f4b60250 +%global gh_commit 4125c77f21a802d4335a2be27cba210fc8717307 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner sabre-io %global gh_project http @@ -22,15 +22,13 @@ Name: php-%{pk_vendor}-%{pk_project}%{major} Summary: Library for dealing with http requests and responses -Version: 5.0.0 -Release: 4%{?dist} +Version: 5.0.1 +Release: 1%{?dist} URL: https://github.com/%{gh_owner}/%{gh_project} License: BSD Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz -Patch0: %{name}-php74.patch - BuildArch: noarch %if %{with_tests} BuildRequires: php(language) >= 7.0 @@ -40,10 +38,16 @@ BuildRequires: php-ctype %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 BuildRequires: (php-composer(sabre/event) >= 4.0 with php-composer(sabre/event) < 6) BuildRequires: (php-composer(sabre/uri) >= 2.0 with php-composer(sabre/uri) < 3) -# remirepo:4 +# From composer.json, "require-dev" : { +# "phpunit/phpunit" : "^6.0 || ^7.0" +BuildRequires: phpunit7 +%global phpunit %{_bindir}/phpunit7 +# remirepo:6 %else BuildRequires: php-sabre-event5 BuildRequires: php-sabre-uri2 +BuildRequires: phpunit6 +%global phpunit %{_bindir}/phpunit6 %endif BuildRequires: php-curl BuildRequires: php-date @@ -51,23 +55,21 @@ BuildRequires: php-hash BuildRequires: php-pcre BuildRequires: php-spl BuildRequires: php-xml -# From composer.json, "require-dev" : { -# "phpunit/phpunit" : ">=6.0.0", -# "sabre/cs" : "~1.0.0" -BuildRequires: phpunit6 %endif # Autoloader BuildRequires: php-fedora-autoloader-devel # From composer.json, "require" : { -# "php" : ">=7.0", +# "php" : "^7.0", # "ext-mbstring" : "*", # "ext-ctype" : "*", +# "ext-curl" : "*", # "sabre/event" : ">=4.0 <6.0", # "sabre/uri" : "~2.0" Requires: php(language) >= 7.0 Requires: php-mbstring Requires: php-ctype +Requires: php-curl # remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 Requires: (php-composer(sabre/event) >= 4.0 with php-composer(sabre/event) < 6) @@ -77,9 +79,6 @@ Requires: (php-composer(sabre/uri) >= 2.0 with php-composer(sabre/uri) Requires: php-sabre-event5 Requires: php-sabre-uri2 %endif -# From composer.json, "suggest" : { -# "ext-curl" : " to make http requests with the Client class" -Requires: php-curl # From phpcompatinfo report for version 5.0.0 Requires: php-date Requires: php-hash @@ -123,7 +122,6 @@ Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php %prep %setup -q -n %{gh_project}-%{gh_commit} -%patch0 -p1 phpab -t fedora -o lib/autoload.php lib cat << 'EOF' | tee -a lib/autoload.php @@ -157,13 +155,22 @@ cp -pr lib %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major} cd tests ln -sf %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php bootstrap.php +: Start a Development web server +PORT=$(expr 8080 + %{?fedora}%{?rhel}) +sed -e "s/localhost/127.0.0.1:$PORT/" -i phpunit.xml +%{_bindir}/php -S 127.0.0.1:$PORT -t $PWD/www &>web.log & +PHPPID=$! + : Run upstream test suite against installed library ret=0 for cmd in php php71 php72 php73 php74; do if which $cmd; then - $cmd %{_bindir}/phpunit6 --verbose || ret=1 + $cmd %{phpunit} --verbose || ret=1 fi done + +kill $PHPPID || : + exit $ret %else : Skip upstream test suite @@ -180,6 +187,11 @@ exit $ret %changelog +* Wed Sep 11 2019 Remi Collet <remi@remirepo.net> - 5.0.1-1 +- update to 5.0.1 +- drop patch merged upstream +- switch to phpunit7 + * Tue Aug 20 2019 Remi Collet <remi@remirepo.net> - 5.0.0-4 - add patch for 7.4 from https://github.com/sabre-io/http/pull/121 |