summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json10
-rw-r--r--php-sabre-http5.spec102
2 files changed, 74 insertions, 38 deletions
diff --git a/composer.json b/composer.json
index 507d5d2..9f39f4c 100644
--- a/composer.json
+++ b/composer.json
@@ -5,15 +5,15 @@
"homepage" : "https://github.com/fruux/sabre-http",
"license" : "BSD-3-Clause",
"require" : {
- "php" : ">=5.4",
+ "php" : ">=7.0",
"ext-mbstring" : "*",
"ext-ctype" : "*",
- "sabre/event" : ">=1.0.0,<4.0.0",
- "sabre/uri" : "~1.0"
+ "sabre/event" : ">=4.0 <6.0",
+ "sabre/uri" : "^2.0"
},
"require-dev" : {
- "phpunit/phpunit" : "~4.3",
- "sabre/cs" : "~0.0.1"
+ "phpunit/phpunit" : ">=6.0.0",
+ "sabre/cs" : "~1.0.0"
},
"suggest" : {
"ext-curl" : " to make http requests with the Client class"
diff --git a/php-sabre-http5.spec b/php-sabre-http5.spec
index ee84176..8546386 100644
--- a/php-sabre-http5.spec
+++ b/php-sabre-http5.spec
@@ -1,40 +1,47 @@
-# remirepo/fedora spec file for php-sabre-http
+# remirepo/fedora spec file for php-sabre-http5
#
-# Copyright (c) 2013-2017 Remi Collet
+# Copyright (c) 2013-2019 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
-%global gh_commit acccec4ba863959b2d10c1fa0fb902736c5c8956
+# Github
+%global gh_commit f91c7d4437dcbc6f89c8b64e855e1544f4b60250
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner sabre-io
%global gh_project http
-#global prever alpha6
+# Packagist
+%global pk_vendor sabre
+%global pk_project %{gh_project}
+# Namespace
+%global ns_vendor Sabre
+%global ns_project HTTP
+%global major 5
%global with_tests %{?_without_tests:0}%{!?_without_tests:1}
-Name: php-sabre-%{gh_project}
+Name: php-%{pk_vendor}-%{pk_project}%{major}
Summary: Library for dealing with http requests and responses
-Version: 4.2.4
+Version: 5.0.0
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
-Source1: %{name}-autoload.php
BuildArch: noarch
%if %{with_tests}
-BuildRequires: php(language) > 5.4
+BuildRequires: php(language) >= 7.0
BuildRequires: php-mbstring
BuildRequires: php-ctype
-BuildRequires: php-composer(phpunit/phpunit)
+# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-BuildRequires: (php-composer(sabre/event) >= 2.0.2 with php-composer(sabre/event) < 4)
-BuildRequires: (php-composer(sabre/uri) >= 1.0 with php-composer(sabre/uri) < 2)
+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
%else
-BuildRequires: php-sabre-event >= 2.0.2
-BuildRequires: php-sabre-uri
+BuildRequires: php-sabre-event5
+BuildRequires: php-sabre-uri2
%endif
BuildRequires: php-curl
BuildRequires: php-date
@@ -42,31 +49,36 @@ BuildRequires: php-hash
BuildRequires: php-pcre
BuildRequires: php-spl
BuildRequires: php-xml
-# Autoloader
-BuildRequires: php-composer(fedora/autoloader)
+# 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" : ">=5.4",
+# "php" : ">=7.0",
# "ext-mbstring" : "*",
# "ext-ctype" : "*",
-# "sabre/event" : ">=1.0.0,<4.0.0",
-# => use 2.0.2 for autoloader
-# "sabre/uri" : "~1.0"
-Requires: php(language) > 5.4
+# "sabre/event" : ">=4.0 <6.0",
+# "sabre/uri" : "~2.0"
+Requires: php(language) >= 7.0
Requires: php-mbstring
Requires: php-ctype
+# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-Requires: (php-composer(sabre/event) >= 2.0.2 with php-composer(sabre/event) < 4)
-Requires: (php-composer(sabre/uri) >= 1.0 with php-composer(sabre/uri) < 2)
+Requires: (php-composer(sabre/event) >= 4.0 with php-composer(sabre/event) < 6)
+Requires: (php-composer(sabre/uri) >= 2.0 with php-composer(sabre/uri) < 3)
+# remirepo:4
%else
-Requires: php-sabre-event >= 2.0.2
-Requires: php-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 3.0.5
+# From phpcompatinfo report for version 5.0.0
Requires: php-date
Requires: php-hash
Requires: php-pcre
@@ -78,7 +90,7 @@ Requires: php-composer(fedora/autoloader)
# Was split from php-sabre-dav in version 1.9
Conflicts: php-sabre-dav < 1.9
-Provides: php-composer(sabre/http) = %{version}
+Provides: php-composer(%{pk_vendor}/%{pk_project}) = %{version}
%description
@@ -104,13 +116,24 @@ For output:
What this library provides, is a Request object, and a Response object.
The objects are extendable and easily mockable.
-Autoloader: %{_datadir}/php/Sabre/HTTP/autoload.php
+Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php
%prep
%setup -q -n %{gh_project}-%{gh_commit}
-cp %{SOURCE1} lib/autoload.php
+phpab -t fedora -o lib/autoload.php lib
+cat << 'EOF' | tee -a lib/autoload.php
+
+// Dependencies
+\Fedora\Autoloader\Dependencies::required([
+ '/usr/share/php/Sabre/Event5/autoload.php',
+ '/usr/share/php/Sabre/Uri2/autoload.php',
+]);
+
+// Functions
+require_once __DIR__ . '/functions.php';
+EOF
%build
@@ -119,19 +142,21 @@ cp %{SOURCE1} lib/autoload.php
%install
# Install as a PSR-0 library
-mkdir -p %{buildroot}%{_datadir}/php/Sabre
-cp -pr lib %{buildroot}%{_datadir}/php/Sabre/HTTP
+mkdir -p %{buildroot}%{_datadir}/php/%{ns_vendor}
+cp -pr lib %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}
%check
%if %{with_tests}
+
cd tests
+ln -sf %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php bootstrap.php
: Run upstream test suite against installed library
ret=0
-for cmd in php php70 php71 php72; do
+for cmd in php php71 php72 php73 php74; do
if which $cmd; then
- $cmd %{_bindir}/phpunit --bootstrap=%{buildroot}%{_datadir}/php/Sabre/HTTP/autoload.php --verbose || ret=1
+ $cmd %{_bindir}/phpunit6 --verbose || ret=1
fi
done
exit $ret
@@ -141,14 +166,25 @@ exit $ret
%files
+# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *md
%doc composer.json
-%{_datadir}/php/Sabre/HTTP
+%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}
%changelog
+* Fri Jul 5 2019 Remi Collet <remi@remirepo.net> - 5.0.0-1
+- update to 5.0.0
+- rename to php-sabre-http5
+- move to /usr/share/php/Sabre/HTTP5
+- raise dependency on PHP 7
+- raise dependency on sabre/event 5.0
+- raise dependency on sabre/uri 2.0
+- switch to classmap autoloader
+- use phpunit 6
+
* Tue Jun 5 2018 Remi Collet <remi@remirepo.net> - 4.2.4-1
- update to 4.2.4
- use range dependencies on F27+