diff options
author | Remi Collet <fedora@famillecollet.com> | 2016-07-13 07:23:56 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2016-07-13 07:23:56 +0200 |
commit | 07f6ed7bfb0906e8c4a4d2774b488df3da1a12bc (patch) | |
tree | cf69e5b753bf088398368740b20c462fdeb166ea | |
parent | 93c886bc36e76fc1993117b0fe03feac42a8cd9e (diff) |
php-horde-Horde-Mongo: 1.1.0
-rw-r--r-- | php-horde-Horde-Mongo-pr194.patch | 34 | ||||
-rw-r--r-- | php-horde-Horde-Mongo-rpm.patch | 16 | ||||
-rw-r--r-- | php-horde-Horde-Mongo.spec | 31 |
3 files changed, 37 insertions, 44 deletions
diff --git a/php-horde-Horde-Mongo-pr194.patch b/php-horde-Horde-Mongo-pr194.patch deleted file mode 100644 index e7427e4..0000000 --- a/php-horde-Horde-Mongo-pr194.patch +++ /dev/null @@ -1,34 +0,0 @@ -Adapted for RPM, from: - - -From 3661871a2e1f02ead41ff4bb26fab270a826d026 Mon Sep 17 00:00:00 2001 -From: Remi Collet <fedora@famillecollet.com> -Date: Wed, 15 Jun 2016 18:33:30 +0200 -Subject: [PATCH] for PHP 7, use alcaeus/mongo-php-adapter compatibility layer - and mongodb extension - ---- - framework/Cache/test/Horde/Cache/MongoTest.php | 4 ++-- - framework/Mongo/bundle/composer.json | 5 +++++ - framework/Mongo/lib/Horde/Mongo/Client.php | 9 +++++++++ - framework/Test/lib/Horde/Test/Factory/Mongo.php | 2 +- - 4 files changed, 17 insertions(+), 3 deletions(-) - create mode 100644 framework/Mongo/bundle/composer.json - -diff --git a/framework/Mongo/lib/Horde/Mongo/Client.php b/framework/Mongo/lib/Horde/Mongo/Client.php -index d50c010..2b1f036 100644 ---- a/framework/Mongo/lib/Horde/Mongo/Client.php -+++ b/framework/Mongo/lib/Horde/Mongo/Client.php -@@ -11,6 +11,11 @@ - * @package Mongo - */ - -+if (!extension_loaded('mongo')) { -+ // use the compatibility layer and mongodb extension -+ require_once '/usr/share/php/Alcaeus/MongoDbAdapter/autoload.php'; -+} -+ - /** - * Extend the base PECL MongoClient class by allowing it to be serialized. - * - diff --git a/php-horde-Horde-Mongo-rpm.patch b/php-horde-Horde-Mongo-rpm.patch new file mode 100644 index 0000000..91ea9ed --- /dev/null +++ b/php-horde-Horde-Mongo-rpm.patch @@ -0,0 +1,16 @@ +diff -up Horde_Mongo-1.1.0/lib/Horde/Mongo/Client.php.pr194 Horde_Mongo-1.1.0/lib/Horde/Mongo/Client.php +--- Horde_Mongo-1.1.0/lib/Horde/Mongo/Client.php.pr194 2016-07-13 07:08:15.255526238 +0200 ++++ Horde_Mongo-1.1.0/lib/Horde/Mongo/Client.php 2016-07-13 07:09:37.264976432 +0200 +@@ -13,10 +13,8 @@ + + if (!extension_loaded('mongo')) { + // use the compatibility layer and mongodb extension +- if (file_exists(__DIR__ . '/vendor/autoload.php')) { +- require_once __DIR__ . '/vendor/autoload.php'; // PEAR installation +- } else { +- require_once __DIR__ . '/../../../bundle/vendor/autoload.php'; // GIT ++ if (file_exists('/usr/share/php/Alcaeus/MongoDbAdapter/autoload.php')) { ++ require_once '/usr/share/php/Alcaeus/MongoDbAdapter/autoload.php'; + } + } + diff --git a/php-horde-Horde-Mongo.spec b/php-horde-Horde-Mongo.spec index 196d60a..cfdb103 100644 --- a/php-horde-Horde-Mongo.spec +++ b/php-horde-Horde-Mongo.spec @@ -11,8 +11,8 @@ %global pear_channel pear.horde.org Name: php-horde-Horde-Mongo -Version: 1.0.3 -Release: 4%{?dist} +Version: 1.1.0 +Release: 1%{?dist} Summary: Horde Mongo Configuration Group: Development/Libraries @@ -20,8 +20,8 @@ License: LGPLv2 URL: http://%{pear_channel} Source0: http://%{pear_channel}/get/%{pear_name}-%{version}.tgz -# https://github.com/horde/horde/pull/194 -Patch0: %{name}-pr194.patch +# Fix autoloader path +Patch0: %{name}-rpm.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -33,13 +33,12 @@ Requires(post): %{__pear} Requires(postun): %{__pear} Requires: php(language) >= 5.3.0 Requires: php-spl -%if 0%{?rhel} >= 5 -Requires: php-pecl(mongo) >= 1.3.0 -%else -Requires: php-composer(alcaeus/mongo-php-adapter) -%endif Requires: php-pear(PEAR) >= 1.7.0 Requires: php-channel(%{pear_channel}) +%if 0%{?fedora} >= 21 +Suggests: php-pecl(mongo) >= 1.3.0 +Suggests: php-composer(alcaeus/mongo-php-adapter) +%endif Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version} Provides: php-composer(horde/horde-mongo) = %{version} @@ -49,13 +48,21 @@ Provides: php-composer(horde/horde-mongo) = %{version} Provides an API to ensure that the PECL Mongo extension can be used consistently across various Horde packages. +Tu use this module, you also need to install + - php-pecl-mongo (PHP 5 only) +or + - php-pecl-mongodb (PHP 5 or 7) + - php-alcaeus-mongo-php-adapter + + %prep %setup -q -c cd %{pear_name}-%{version} mv ../package.xml %{name}.xml -%patch0 -p3 -b .pr194 +%patch0 -p1 -b .rpm sed -e '/Client.php/s/md5sum="[^"]*"//' \ + -e '/name="bundle/d' \ -i %{name}.xml @@ -101,6 +108,10 @@ fi %changelog +* Wed Jul 13 2016 Remi Collet <remi@fedoraproject.org> - 1.1.0-1 +- Update to 1.1.0 +- php-pecl-mongo and alcaeus/mongo-php-adapter are optional + * Sat Jul 2 2016 Remi Collet <remi@fedoraproject.org> - 1.0.3-4 - on switch to alcaeus/mongo-php-adapter with PHP >= 5.5 |