summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-06-27 08:18:07 +0200
committerRemi Collet <fedora@famillecollet.com>2016-06-27 08:18:07 +0200
commitf666afa1d28a08e719123fffa904556e746839df (patch)
tree614e13c52bd36b579318f3469275f75fc6797d1d
parent8619288059682270f7f65e7b85b98ce9e8e718bd (diff)
php-horde-Horde-Mongo: switch from mongo to mongodb
-rw-r--r--php-horde-Horde-Mongo-pr194.patch34
-rw-r--r--php-horde-Horde-Mongo.spec16
2 files changed, 49 insertions, 1 deletions
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 <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.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 <remi@fedoraproject.org> - 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 <remi@fedoraproject.org> - 1.0.3-1
- Update to 1.0.3
- add provides php-composer(horde/horde-mongo)