From f666afa1d28a08e719123fffa904556e746839df Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 27 Jun 2016 08:18:07 +0200 Subject: php-horde-Horde-Mongo: switch from mongo to mongodb --- php-horde-Horde-Mongo-pr194.patch | 34 ++++++++++++++++++++++++++++++++++ php-horde-Horde-Mongo.spec | 16 +++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 php-horde-Horde-Mongo-pr194.patch diff --git a/php-horde-Horde-Mongo-pr194.patch b/php-horde-Horde-Mongo-pr194.patch new file mode 100644 index 0000000..e7427e4 --- /dev/null +++ b/php-horde-Horde-Mongo-pr194.patch @@ -0,0 +1,34 @@ +Adapted for RPM, from: + + +From 3661871a2e1f02ead41ff4bb26fab270a826d026 Mon Sep 17 00:00:00 2001 +From: Remi Collet +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.spec b/php-horde-Horde-Mongo.spec index 1b84a85..9b11706 100644 --- a/php-horde-Horde-Mongo.spec +++ b/php-horde-Horde-Mongo.spec @@ -12,7 +12,7 @@ Name: php-horde-Horde-Mongo Version: 1.0.3 -Release: 1%{?dist} +Release: 3%{?dist} Summary: Horde Mongo Configuration Group: Development/Libraries @@ -20,6 +20,9 @@ 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 + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: php(language) >= 5.3.0 @@ -30,7 +33,11 @@ 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}) @@ -47,6 +54,9 @@ consistently across various Horde packages. cd %{pear_name}-%{version} mv ../package.xml %{name}.xml +%patch0 -p3 -b .pr194 +sed -e '/Client.php/s/md5sum="[^"]*"//' \ + -i %{name}.xml %build @@ -91,6 +101,10 @@ fi %changelog +* Mon Jun 27 2016 Remi Collet - 1.0.3-3 +- drop dependency on mongo extension for PHP 7 +- add dependency on alcaeus/mongo-php-adapter + * Fri Jan 09 2015 Remi Collet - 1.0.3-1 - Update to 1.0.3 - add provides php-composer(horde/horde-mongo) -- cgit