[zarafa] - Upgrade to 7.0.4 - Added patch for rebuilding with PHP 5.4 (thanks to Remi Collet) - Work around c

Robert Scheck robert at fedoraproject.org
Fri Jan 13 00:29:14 UTC 2012


commit d4b9b96d28925d00965292fa1b66ea8bf11dac20
Author: Robert Scheck <robert at fedoraproject.org>
Date:   Fri Jan 13 01:28:55 2012 +0100

    - Upgrade to 7.0.4
    - Added patch for rebuilding with PHP 5.4 (thanks to Remi Collet)
    - Work around crashs by reducing open file descriptors (#760888)

 zarafa-7.0.4-fd_setsize.patch |   36 +++++++++++
 zarafa-7.0.4-php54.patch      |  130 +++++++++++++++++++++++++++++++++++++++++
 zarafa.spec                   |   23 +++++--
 3 files changed, 183 insertions(+), 6 deletions(-)
---
diff --git a/zarafa-7.0.4-fd_setsize.patch b/zarafa-7.0.4-fd_setsize.patch
new file mode 100644
index 0000000..14764cb
--- /dev/null
+++ b/zarafa-7.0.4-fd_setsize.patch
@@ -0,0 +1,36 @@
+Patch by Robert Scheck <robert at fedoraproject.org> for Zarafa >= 7.0.4, which works around
+the issue that Zarafa is using up to 8192 open file descriptors, while the system glibc is
+allowing at maximum 1024. Of course glibc supports more open file descriptors, however the
+usage seems to be non-POSIX conform and non-portable. Finally a check was implemented into
+glibc by upstream developers to catch such strange usage cases. That check causes Zarafa
+to fail with a segmentation fault when built with -D_FORTIFY_SOURCE=2 and glibc-2.14.90-8
+or newer (actually Fedora 16 with updates and newer).
+
+This patch is a workaround until gSOAP parts are updated/changed/rewritten to use poll(2)
+instead of select(2). Lowering FD_SETSIZE was suggested by Milo Oostergo from Zarafa B.V.
+
+--- zarafa-7.0.4/provider/soap/soapdefs.h		2011-12-22 01:02:31.000000000 +0100
++++ zarafa-7.0.4/provider/soap/soapdefs.h.fd_setsize	2012-01-12 22:36:40.000000000 +0100
+@@ -8,6 +8,6 @@
+ 
+ #include <bits/types.h>
+ #undef __FD_SETSIZE
+-#define __FD_SETSIZE 8192
++#define __FD_SETSIZE 1024
+ 
+ #endif // ndef SOAPDEFS_H_
+--- zarafa-7.0.4/common/platform.h			2011-12-22 01:02:34.000000000 +0100
++++ zarafa-7.0.4/common/platform.h.fd_setsize		2012-01-12 22:37:03.000000000 +0100
+@@ -52,10 +52,10 @@
+ 
+ 
+   // We have to include this now in case select.h is included too soon.
+-  // Increase our maximum amount of file descriptors to 8192
++  // Increase our maximum amount of file descriptors to 1024
+   #include <bits/types.h>
+   #undef __FD_SETSIZE
+-  #define __FD_SETSIZE 8192
++  #define __FD_SETSIZE 1024
+ 
+   // Log the pthreads locks
+   #define DEBUG_PTHREADS 0
diff --git a/zarafa-7.0.4-php54.patch b/zarafa-7.0.4-php54.patch
new file mode 100644
index 0000000..9684ac3
--- /dev/null
+++ b/zarafa-7.0.4-php54.patch
@@ -0,0 +1,130 @@
+Patch by Robert Scheck <robert at fedoraproject.org> for Zarafa >= 7.0.4, which fixes building of the PHP
+extension of Zarafa with PHP >= 5.4.0. It is heavily based on the work of Remi Collet. Fedora 17+ will
+ship PHP >= 5.4.0, so the changes are here mandatory. According to /usr/include/php/main/php3_compat.h
+the "typedef zval pval;" definition exists for ages and I wasn't able to figure out any build issue in
+Red Hat Enterprise Linux 5 (as oldest supported version of Zarafa 7.0.x) during my tests. References:
+
+ - https://github.com/remicollet/remirepo/blob/1e741d6002a34add940c15711cf061c35d4c9e91/zarafa/zarafa-7.0.3-php54.patch
+ - http://forums.zarafa.com/viewtopic.php?f=22&t=7826
+
+--- zarafa-7.0.4/php-ext/ECImportContentsChangesProxy.cpp		2011-12-22 01:02:33.000000000 +0100
++++ zarafa-7.0.4/php-ext/ECImportContentsChangesProxy.cpp.php54		2012-01-08 23:58:33.000000000 +0100
+@@ -150,9 +150,9 @@
+ HRESULT ECImportContentsChangesProxy::Config(LPSTREAM lpStream, ULONG ulFlags) {
+     HRESULT hr = hrSuccess;
+     
+-    pval *pvalFuncName;
+-    pval *pvalReturn;
+-    pval *pvalArgs[2];
++    zval *pvalFuncName;
++    zval *pvalReturn;
++    zval *pvalArgs[2];
+     
+     MAKE_STD_ZVAL(pvalFuncName);
+     MAKE_STD_ZVAL(pvalReturn);
+@@ -192,9 +192,9 @@
+ HRESULT ECImportContentsChangesProxy::UpdateState(LPSTREAM lpStream) {
+     HRESULT hr = hrSuccess;
+     
+-    pval *pvalFuncName;
+-    pval *pvalReturn;
+-    pval *pvalArgs[1];
++    zval *pvalFuncName;
++    zval *pvalReturn;
++    zval *pvalArgs[1];
+     
+     MAKE_STD_ZVAL(pvalFuncName);
+     MAKE_STD_ZVAL(pvalReturn);
+@@ -228,9 +228,9 @@
+ }
+ 
+ HRESULT ECImportContentsChangesProxy::ImportMessageChange(ULONG cValues, LPSPropValue lpPropArray, ULONG ulFlags, LPMESSAGE * lppMessage)  {
+-    pval *pvalFuncName;
+-    pval *pvalReturn;
+-    pval *pvalArgs[3];
++    zval *pvalFuncName;
++    zval *pvalReturn;
++    zval *pvalArgs[3];
+     IMessage *lpMessage = NULL;
+     HRESULT hr = hrSuccess;
+     
+@@ -287,9 +287,9 @@
+ HRESULT ECImportContentsChangesProxy::ImportMessageDeletion(ULONG ulFlags, LPENTRYLIST lpSourceEntryList) {
+     HRESULT hr = hrSuccess;
+     
+-    pval *pvalFuncName;
+-    pval *pvalReturn;
+-    pval *pvalArgs[2];
++    zval *pvalFuncName;
++    zval *pvalReturn;
++    zval *pvalArgs[2];
+     
+     MAKE_STD_ZVAL(pvalFuncName);
+     MAKE_STD_ZVAL(pvalReturn);
+@@ -323,9 +323,9 @@
+ HRESULT ECImportContentsChangesProxy::ImportPerUserReadStateChange(ULONG cElements, LPREADSTATE lpReadState) {
+     HRESULT hr = hrSuccess;
+     
+-    pval *pvalFuncName;
+-    pval *pvalReturn;
+-    pval *pvalArgs[1];
++    zval *pvalFuncName;
++    zval *pvalReturn;
++    zval *pvalArgs[1];
+     
+     MAKE_STD_ZVAL(pvalFuncName);
+     MAKE_STD_ZVAL(pvalReturn);
+--- zarafa-7.0.4/php-ext/ECImportHierarchyChangesProxy.cpp		2011-12-22 01:02:33.000000000 +0100
++++ zarafa-7.0.4/php-ext/ECImportHierarchyChangesProxy.cpp.php54	2012-01-08 23:58:33.000000000 +0100
+@@ -147,9 +147,9 @@
+ HRESULT ECImportHierarchyChangesProxy::Config(LPSTREAM lpStream, ULONG ulFlags) {
+     HRESULT hr = hrSuccess;
+     
+-    pval *pvalFuncName;
+-    pval *pvalReturn;
+-    pval *pvalArgs[2];
++    zval *pvalFuncName;
++    zval *pvalReturn;
++    zval *pvalArgs[2];
+     
+     MAKE_STD_ZVAL(pvalFuncName);
+     MAKE_STD_ZVAL(pvalReturn);
+@@ -189,9 +189,9 @@
+ HRESULT ECImportHierarchyChangesProxy::UpdateState(LPSTREAM lpStream) {
+     HRESULT hr = hrSuccess;
+     
+-    pval *pvalFuncName;
+-    pval *pvalReturn;
+-    pval *pvalArgs[1];
++    zval *pvalFuncName;
++    zval *pvalReturn;
++    zval *pvalArgs[1];
+     
+     MAKE_STD_ZVAL(pvalFuncName);
+     MAKE_STD_ZVAL(pvalReturn);
+@@ -225,9 +225,9 @@
+ }
+ 
+ HRESULT ECImportHierarchyChangesProxy::ImportFolderChange(ULONG cValues, LPSPropValue lpPropArray)  {
+-    pval *pvalFuncName;
+-    pval *pvalReturn;
+-    pval *pvalArgs[1];
++    zval *pvalFuncName;
++    zval *pvalReturn;
++    zval *pvalArgs[1];
+     HRESULT hr = hrSuccess;
+     
+     MAKE_STD_ZVAL(pvalFuncName);
+@@ -265,9 +265,9 @@
+ HRESULT ECImportHierarchyChangesProxy::ImportFolderDeletion(ULONG ulFlags, LPENTRYLIST lpSourceEntryList) {
+     HRESULT hr = hrSuccess;
+     
+-    pval *pvalFuncName;
+-    pval *pvalReturn;
+-    pval *pvalArgs[2];
++    zval *pvalFuncName;
++    zval *pvalReturn;
++    zval *pvalArgs[2];
+     
+     MAKE_STD_ZVAL(pvalFuncName);
+     MAKE_STD_ZVAL(pvalReturn);
diff --git a/zarafa.spec b/zarafa.spec
index d3de4c0..e9cd0e3 100644
--- a/zarafa.spec
+++ b/zarafa.spec
@@ -1,6 +1,6 @@
 %global beta_or_rc      0
-%global actual_release  2
-%global svnrevision     30515
+%global actual_release  1
+%global svnrevision     31235
 %global with_clucene    1
 %global with_ldap       1
 %global with_xmlto      1
@@ -12,13 +12,14 @@
 %if 0%{?rhel}%{?fedora} > 4
 %{?filter_setup:
 %filter_provides_in %{_libdir}/%{name}/.*\.so$
+%filter_provides_in %{_libdir}/php/modules/.*\.so$
 %filter_setup
 }
 %endif
 
 Summary:            Open Source Edition of the Zarafa Collaboration Platform
 Name:               zarafa
-Version:            7.0.3
+Version:            7.0.4
 %if %{beta_or_rc}
 Release:            0.%{actual_release}.svn%{svnrevision}%{?dist}
 %else
@@ -43,6 +44,8 @@ Source3:            %{name}-webaccess.conf
 
 Patch0:             zarafa-6.40.5-rpath.patch
 Patch1:             zarafa-7.0.3-boost149.patch
+Patch2:             zarafa-7.0.4-php54.patch
+Patch3:             zarafa-7.0.4-fd_setsize.patch
 
 BuildRequires:      bison
 BuildRequires:      gcc-c++
@@ -369,6 +372,8 @@ to interact with Zarafa.
 touch -c -r aclocal.m4.rpath aclocal.m4
 %patch1 -p1 -b .boost149
 touch -c -r configure.ac.boost149 configure.ac
+%patch2 -p1 -b .php54
+%patch3 -p1 -b .fd_setsize
 
 %build
 %if 0%{?rhel}%{?fedora} < 6
@@ -377,7 +382,7 @@ export LDFLAGS="$LDFLAGS -L%{_libdir}/boost141"
 %endif
 
 %if 0%{?fedora} > 15
-export LDFLAGS="$LDFLAGS -L%{_libdir}/clucene09"
+export LDFLAGS="$RPM_LD_FLAGS -L%{_libdir}/clucene09"
 %endif
 
 %configure \
@@ -421,7 +426,7 @@ make \
     install-ajax-webaccess
 
 # Nuke all overlefts from licensed, managed or other proprietary items
-rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{license,licensed.cfg,report-ca}
+rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/{%{name}/{license,licensed.cfg,report-ca},cron.daily/%{name}-client-update}
 rm -f $RPM_BUILD_ROOT%{_mandir}/man?/{zarafa-{backup,restore,report,msr,ldapms.cfg,licensed{,.cfg}},za-aclsync}.*
 
 # Move all the initscripts to their appropriate place and
@@ -675,6 +680,7 @@ fi
 %files client -f %{name}.lang
 %defattr(-,root,root,-)
 %{_libdir}/libzarafaclient.so
+%{_libdir}/libzarafasync.so.*
 
 %files common
 %defattr(-,root,root,-)
@@ -709,7 +715,7 @@ fi
 %{_libdir}/libcommon_ssl.a
 %{_libdir}/libcommon_util.a
 %{_libdir}/libfreebusy.a
-%{_libdir}/libzarafasync.a
+%{_libdir}/libzarafasync.so
 %{_includedir}/icalmapi/
 %{_includedir}/inetmapi/
 %{_includedir}/mapi4linux/
@@ -874,6 +880,11 @@ fi
 %endif
 
 %changelog
+* Fri Jan 13 2012 Robert Scheck <robert at fedoraproject.org> 7.0.4-1
+- Upgrade to 7.0.4
+- Added patch for rebuilding with PHP 5.4 (thanks to Remi Collet)
+- Work around crashs by reducing open file descriptors (#760888)
+
 * Sat Dec 17 2011 Robert Scheck <robert at fedoraproject.org> 7.0.3-2
 - Enabled non-optional build of epoll socket handling (#760888)
 


More information about the scm-commits mailing list