diff options
author | Remi Collet <fedora@famillecollet.com> | 2016-03-16 13:14:15 +0100 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2016-03-16 13:14:15 +0100 |
commit | 93b59fe5fb7b4829a7d9887dde80b14265d89721 (patch) | |
tree | 23a3b1dd3bfc9db2c1a2e3b5b4800400a68be85e | |
parent | 0a01943f5f730ecee40be200f9714f951c62bc9c (diff) |
php-sabre-dav: 2.1.6 (synced with Fedora)
-rw-r--r-- | php-sabre-dav-GetEventsByTimerangeTest-zerolength.patch | 13 | ||||
-rw-r--r-- | php-sabre-dav-autoload.patch | 29 | ||||
-rw-r--r-- | php-sabre-dav-autoload.php | 29 | ||||
-rw-r--r-- | php-sabre-dav.spec | 138 | ||||
-rw-r--r-- | sabre-dav-autoload.patch | 21 |
5 files changed, 162 insertions, 68 deletions
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 @@ + <?php + +-set_include_path(__DIR__ . '/../lib/' . PATH_SEPARATOR . __DIR__ . PATH_SEPARATOR . get_include_path()); +- +-$autoLoader = include __DIR__ . '/../vendor/autoload.php'; ++require '@BUILDROOT@/usr/share/php/Sabre/DAV/autoload.php'; + + // SabreDAV tests auto loading +-$autoLoader->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 @@ +<?php +/** + * Autoloader for sabre/dav and its dependencies + */ + +$vendorDir = '/usr/share/php'; + +// Use Symfony autoloader +if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) { + if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) { + require_once $vendorDir . '/Symfony/Component/ClassLoader/ClassLoader.php'; + } + + $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader(); + $fedoraClassLoader->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 <<EOF | tee psr0.php -<?php -define('SABRE_HASSQLITE', 1); -define('SABRE_HASMYSQL', 0); -define("SABRE_TEMPDIR", __DIR__ . '/temp/'); - -spl_autoload_register(function (\$class) { - \$file = str_replace('\\\\', '/', \$class).'.php'; - @include \$file; -}); -EOF +%patch1 -p1 +cp %{SOURCE1} lib/DAV/autoload.php # drop executable as only provided as doc chmod -x bin/* @@ -101,24 +130,27 @@ chmod -x bin/* %install # Install as a PSR-0 library mkdir -p %{buildroot}%{_datadir}/php -cp -pr lib/Sabre %{buildroot}%{_datadir}/php/Sabre +cp -pr lib %{buildroot}%{_datadir}/php/Sabre %check -: Check that our autoloader is working -php -d include_path=%{buildroot}%{_datadir}/php \ - -r 'include "Sabre/autoload.php"; echo Sabre\DAV\Version::VERSION."\n";' \ - | grep %{version} - %if %{with_tests} -: Run upstream test suite against installed library -mkdir temp +%if 0%{?rhel} == 5 +sed -e 's/testMove/SKIP_testMove/' \ + -i tests/Sabre/DAV/PropertyStorage/Backend/AbstractPDOTest.php +%endif + +: Fix bootstrap cd tests -phpunit \ - --bootstrap=../psr0.php \ - --include-path=%{buildroot}%{_datadir}/php \ - -d date.timezone=GMT +sed -e 's:@BUILDROOT@:%{buildroot}:' -i bootstrap.php + +: Run upstream test suite against installed library +%{_bindir}/phpunit --verbose + +if which php70; then + php70 %{_bindir}/phpunit --verbose || : ignore test results +fi %else : Skip upstream test suite %endif @@ -126,12 +158,24 @@ phpunit \ %files %defattr(-,root,root,-) -%doc ChangeLog composer.json LICENSE README.md +%{!?_licensedir:%global license %%doc} +%license LICENSE +%doc *md +%doc composer.json %doc examples bin -%{_datadir}/php/Sabre +%{_datadir}/php/Sabre/DAV +%{_datadir}/php/Sabre/DAVACL +%{_datadir}/php/Sabre/CalDAV +%{_datadir}/php/Sabre/CardDAV %changelog +* Wed Feb 24 2016 James Hogarth <james.hogarth@gmail.com> - 2.1.6-1 +- update to 2.1.6 + +* Wed Feb 24 2016 Remi Collet <remi@fedoraproject.org> - 2.1.5-1 +- update to 2.1.5 + * Fri Mar 06 2015 Adam Williamson <awilliam@redhat.com> - 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 <remi@fedoraproject.org> - 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; -+ } -+}); |