From 93b59fe5fb7b4829a7d9887dde80b14265d89721 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 16 Mar 2016 13:14:15 +0100 Subject: php-sabre-dav: 2.1.6 (synced with Fedora) --- ...e-dav-GetEventsByTimerangeTest-zerolength.patch | 13 ++ php-sabre-dav-autoload.patch | 29 +++++ php-sabre-dav-autoload.php | 29 +++++ php-sabre-dav.spec | 138 ++++++++++++++------- sabre-dav-autoload.patch | 21 ---- 5 files changed, 162 insertions(+), 68 deletions(-) create mode 100644 php-sabre-dav-GetEventsByTimerangeTest-zerolength.patch create mode 100644 php-sabre-dav-autoload.patch create mode 100644 php-sabre-dav-autoload.php delete mode 100644 sabre-dav-autoload.patch diff --git a/php-sabre-dav-GetEventsByTimerangeTest-zerolength.patch b/php-sabre-dav-GetEventsByTimerangeTest-zerolength.patch new file mode 100644 index 0000000..555f2a4 --- /dev/null +++ b/php-sabre-dav-GetEventsByTimerangeTest-zerolength.patch @@ -0,0 +1,13 @@ +diff --git a/tests/Sabre/CalDAV/GetEventsByTimerangeTest.php b/tests/Sabre/CalDAV/GetEventsByTimerangeTest.php +index 45531f2..2e9637d 100644 +--- a/tests/Sabre/CalDAV/GetEventsByTimerangeTest.php ++++ b/tests/Sabre/CalDAV/GetEventsByTimerangeTest.php +@@ -32,7 +32,7 @@ VERSION:2.0 + BEGIN:VEVENT + CREATED:20120313T142342Z + UID:171EBEFC-C951-499D-B234-7BA7D677B45D +-DTEND;TZID=Europe/Berlin:20120227T000000 ++DTEND;TZID=Europe/Berlin:20120227T010000 + TRANSP:OPAQUE + SUMMARY:Monday 0h + DTSTART;TZID=Europe/Berlin:20120227T000000 diff --git a/php-sabre-dav-autoload.patch b/php-sabre-dav-autoload.patch new file mode 100644 index 0000000..76e947b --- /dev/null +++ b/php-sabre-dav-autoload.patch @@ -0,0 +1,29 @@ +diff -up tests/bootstrap.php.rpm tests/bootstrap.php +--- tests/bootstrap.php.rpm 2015-07-20 16:23:38.849592222 +0200 ++++ tests/bootstrap.php 2015-07-20 16:23:46.101628015 +0200 +@@ -1,21 +1,17 @@ + add('Sabre\\', __DIR__); +-// VObject tests auto loadiong +-$autoLoader->addPsr4('Sabre\\VObject\\',__DIR__ . '/../vendor/sabre/vobject/tests/VObject'); ++$fedoraClassLoader->addPrefix('Sabre\\', __DIR__); + + + date_default_timezone_set('UTC'); + + $config = [ + 'SABRE_TEMPDIR' => dirname(__FILE__) . '/temp/', +- 'SABRE_HASSQLITE' => in_array('sqlite',PDO::getAvailableDrivers()), +- 'SABRE_HASMYSQL' => in_array('mysql',PDO::getAvailableDrivers()), ++ 'SABRE_HASSQLITE' => 1, ++ 'SABRE_HASMYSQL' => 0, + 'SABRE_MYSQLDSN' => 'mysql:host=127.0.0.1;dbname=sabredav', + 'SABRE_MYSQLUSER' => 'root', + 'SABRE_MYSQLPASS' => '', diff --git a/php-sabre-dav-autoload.php b/php-sabre-dav-autoload.php new file mode 100644 index 0000000..938d523 --- /dev/null +++ b/php-sabre-dav-autoload.php @@ -0,0 +1,29 @@ +register(); +} + +$thisdir = dirname(dirname(__DIR__)); +$fedoraClassLoader->addPrefixes(array( + 'Sabre\\DAV\\' => $thisdir, + 'Sabre\\DAVACL\\' => $thisdir, + 'Sabre\\CalDAV\\' => $thisdir, + 'Sabre\\CardDAV\\' => $thisdir, +)); + +// dependencies +require_once $vendorDir . '/Sabre/Event/autoload.php'; +require_once $vendorDir . '/Sabre/HTTP/autoload.php'; +require_once $vendorDir . '/Sabre/VObject/autoload.php'; diff --git a/php-sabre-dav.spec b/php-sabre-dav.spec index 8f26412..334fd79 100644 --- a/php-sabre-dav.spec +++ b/php-sabre-dav.spec @@ -1,4 +1,4 @@ -# Spec file for php-sabre-dav +# remirepo/fedora spec file for php-sabre-dav # # Copyright (c) 2013-2016 Remi Collet # License: CC-BY-SA @@ -6,7 +6,7 @@ # # Please, preserve the changelog entries # -%global gh_commit 78b0a55ae126666b49ec9ac88582d453b971967d +%global gh_commit cab5ab4e9caa00ba12268aa5b35925dc65bd7d63 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner fruux %global gh_project sabre-dav @@ -14,42 +14,82 @@ Name: php-%{gh_project} Summary: WebDAV Framework for PHP -Version: 1.8.12 +Version: 2.1.6 Release: 1%{?dist} URL: https://github.com/%{gh_owner}/%{gh_project} -Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}.tar.gz License: BSD Group: Development/Libraries +Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz +Source1: %{name}-autoload.php -# replace composer autoloader with trivial PSR-0 one -Patch0: %{gh_project}-autoload.patch +# replace composer autoloader +Patch0: %{name}-autoload.patch + +# Partial cherry pick of 4eff5d4 to fix the zero length event breaking the test +Patch1: %{name}-GetEventsByTimerangeTest-zerolength.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch %if %{with_tests} -BuildRequires: php(language) >= 5.3.1 -BuildRequires: %{_bindir}/phpunit -BuildRequires: php-sabre-vobject > 2.1 +BuildRequires: php(language) >= 5.4.1 +BuildRequires: php-composer(phpunit/phpunit) +BuildRequires: php-composer(sabre/vobject) >= 3.3.4 +BuildRequires: php-composer(sabre/event) >= 2.0.0 +BuildRequires: php-composer(sabre/http) >= 3.0.0 +BuildRequires: php-dom +BuildRequires: php-pcre +BuildRequires: php-spl +BuildRequires: php-simplexml +BuildRequires: php-mbstring +BuildRequires: php-ctype +BuildRequires: php-date +BuildRequires: php-iconv +BuildRequires: php-libxml +BuildRequires: php-curl BuildRequires: php-pdo +# Autoloader +BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-pdo_sqlite %endif -# From composer.json -Requires: php(language) >= 5.3.1 +# From composer.json, "require": { +# "php": ">=5.4.1", +# "sabre/vobject": ">=3.3.4 <4", +# "sabre/event" : "~2.0.0", +# "sabre/http" : "~3.0.0", +# "ext-dom": "*", +# "ext-pcre": "*", +# "ext-spl": "*", +# "ext-simplexml": "*", +# "ext-mbstring" : "*", +# "ext-ctype" : "*", +# "ext-date" : "*", +# "ext-iconv" : "*", +# "ext-libxml" : "*" +Requires: php(language) >= 5.4.1 +Requires: php-composer(sabre/vobject) >= 3.3.4 +Requires: php-composer(sabre/vobject) < 4 +Requires: php-composer(sabre/event) >= 2.0.0 +Requires: php-composer(sabre/event) < 2.1 +Requires: php-composer(sabre/http) >= 3.0.0 +Requires: php-composer(sabre/http) < 3.1 +Requires: php-dom +Requires: php-pcre +Requires: php-spl +Requires: php-simplexml +Requires: php-mbstring Requires: php-ctype Requires: php-date -Requires: php-dom Requires: php-iconv Requires: php-libxml -Requires: php-mbstring -Requires: php-pcre -Requires: php-simplexml -Requires: php-spl -Requires: php-sabre-vobject > 2.1 -# From phpcompatinfo report for version 1.8.7 +# From composer.json, "suggest" : { +# "ext-curl" : "*", +# "ext-pdo" : "*" Requires: php-curl Requires: php-pdo -Requires: php-xml +# Autoloader +Requires: php-composer(symfony/class-loader) %description @@ -76,19 +116,8 @@ Feature list: %setup -q -n %{gh_project}-%{gh_commit} %patch0 -p0 - -: Create trivial PSR0 autoloader for tests -cat < - 2.1.6-1 +- update to 2.1.6 + +* Wed Feb 24 2016 Remi Collet - 2.1.5-1 +- update to 2.1.5 + * Fri Mar 06 2015 Adam Williamson - 1.8.12-1 - update to 1.8.12 (bugfix release, no bc breaks) @@ -148,4 +192,4 @@ phpunit \ - update to 1.8.8 * Tue Dec 31 2013 Remi Collet - 1.8.7-1 -- Initial packaging \ No newline at end of file +- Initial packaging diff --git a/sabre-dav-autoload.patch b/sabre-dav-autoload.patch deleted file mode 100644 index b5ddca6..0000000 --- a/sabre-dav-autoload.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up lib/Sabre/autoload.php.orig lib/Sabre/autoload.php ---- lib/Sabre/autoload.php.orig 2014-05-22 09:19:59.914874236 +0200 -+++ lib/Sabre/autoload.php 2014-05-22 09:21:26.300242963 +0200 -@@ -15,11 +15,9 @@ - * @license http://sabre.io/license/ Modified BSD License - */ - --/** -- * We are assuming that the composer autoloader is just 2 directories up. -- * -- * This is not the case when sabredav is installed as a dependency. But, in -- * those cases it's not expected that people will look for this file anyway. -- */ -- --require __DIR__ . '/../../vendor/autoload.php'; -+spl_autoload_register(function ($class) { -+ if (strpos($class,'Sabre\\')===0) { -+ $file = __DIR__ . str_replace('\\', '/', substr($class,5)).'.php'; -+ @include $file; -+ } -+}); -- cgit