diff --git a/SOURCES/evolution-data-server-3.8.5-cameldb-track-pending-syncs.patch b/SOURCES/evolution-data-server-3.8.5-cameldb-track-pending-syncs.patch
new file mode 100644
index 0000000..e325d4e
--- /dev/null
+++ b/SOURCES/evolution-data-server-3.8.5-cameldb-track-pending-syncs.patch
@@ -0,0 +1,74 @@
+diff -up evolution-data-server-3.8.5/camel/camel-db.c.cameldb-track-pending-syncs evolution-data-server-3.8.5/camel/camel-db.c
+--- evolution-data-server-3.8.5/camel/camel-db.c.cameldb-track-pending-syncs 2013-08-11 00:00:52.000000000 +0200
++++ evolution-data-server-3.8.5/camel/camel-db.c 2014-12-05 08:55:12.403985638 +0100
+@@ -55,6 +55,12 @@ typedef struct {
+ GRecMutex sync_mutex;
+ guint timeout_id;
+ gint flags;
++
++ /* Do know how many syncs are pending, to not close
++ the file before the last sync is over */
++ guint pending_syncs;
++ GMutex pending_syncs_lock;
++ GCond pending_syncs_cond;
+ } CamelSqlite3File;
+
+ static gint
+@@ -93,6 +99,13 @@ sync_request_thread_cb (gpointer task_da
+
+ call_old_file_Sync (sync_data->cFile, sync_data->flags);
+
++ g_mutex_lock (&sync_data->cFile->pending_syncs_lock);
++ g_warn_if_fail (sync_data->cFile->pending_syncs > 0);
++ sync_data->cFile->pending_syncs--;
++ if (!sync_data->cFile->pending_syncs)
++ g_cond_signal (&sync_data->cFile->pending_syncs_cond);
++ g_mutex_unlock (&sync_data->cFile->pending_syncs_lock);
++
+ done = sync_data->done;
+ g_free (sync_data);
+
+@@ -138,6 +151,10 @@ sync_push_request (CamelSqlite3File *cFi
+
+ cFile->flags = 0;
+
++ g_mutex_lock (&cFile->pending_syncs_lock);
++ cFile->pending_syncs++;
++ g_mutex_unlock (&cFile->pending_syncs_lock);
++
+ g_rec_mutex_unlock (&cFile->sync_mutex);
+
+ g_thread_pool_push (sync_pool, data, &error);
+@@ -251,6 +268,12 @@ camel_sqlite3_file_xClose (sqlite3_file
+ /* Make the last sync. */
+ sync_push_request (cFile, TRUE);
+
++ g_mutex_lock (&cFile->pending_syncs_lock);
++ while (cFile->pending_syncs > 0) {
++ g_cond_wait (&cFile->pending_syncs_cond, &cFile->pending_syncs_lock);
++ }
++ g_mutex_unlock (&cFile->pending_syncs_lock);
++
+ if (cFile->old_vfs_file->pMethods)
+ res = cFile->old_vfs_file->pMethods->xClose (cFile->old_vfs_file);
+ else
+@@ -260,6 +283,8 @@ camel_sqlite3_file_xClose (sqlite3_file
+ cFile->old_vfs_file = NULL;
+
+ g_rec_mutex_clear (&cFile->sync_mutex);
++ g_mutex_clear (&cFile->pending_syncs_lock);
++ g_cond_clear (&cFile->pending_syncs_cond);
+
+ return res;
+ }
+@@ -319,6 +344,10 @@ camel_sqlite3_vfs_xOpen (sqlite3_vfs *pV
+ }
+
+ g_rec_mutex_init (&cFile->sync_mutex);
++ g_mutex_init (&cFile->pending_syncs_lock);
++ g_cond_init (&cFile->pending_syncs_cond);
++
++ cFile->pending_syncs = 0;
+
+ g_rec_mutex_lock (&only_once_lock);
+
diff --git a/SOURCES/evolution-data-server-3.8.5-claim-missing-username.patch b/SOURCES/evolution-data-server-3.8.5-claim-missing-username.patch
new file mode 100644
index 0000000..2bb2789
--- /dev/null
+++ b/SOURCES/evolution-data-server-3.8.5-claim-missing-username.patch
@@ -0,0 +1,252 @@
+diff -up evolution-data-server-3.8.5/addressbook/backends/webdav/e-book-backend-webdav.c.claim-missing-username evolution-data-server-3.8.5/addressbook/backends/webdav/e-book-backend-webdav.c
+--- evolution-data-server-3.8.5/addressbook/backends/webdav/e-book-backend-webdav.c.claim-missing-username 2013-07-28 15:54:19.000000000 +0200
++++ evolution-data-server-3.8.5/addressbook/backends/webdav/e-book-backend-webdav.c 2014-10-08 15:33:51.567159217 +0200
+@@ -1089,7 +1089,9 @@ download_contacts (EBookBackendWebdav *w
+ message = send_propfind (webdav, cancellable);
+ status = message->status_code;
+
+- if (status == 401 || status == 407) {
++ if (status == SOUP_STATUS_UNAUTHORIZED ||
++ status == SOUP_STATUS_PROXY_UNAUTHORIZED ||
++ status == SOUP_STATUS_FORBIDDEN) {
+ g_object_unref (message);
+ g_free (new_ctag);
+ if (book_view)
+@@ -1422,9 +1424,10 @@ soup_authenticate (SoupSession *session,
+ if (retrying)
+ return;
+
+- if (priv->username != NULL) {
++ if (!priv->username || !*priv->username)
++ soup_message_set_status (message, SOUP_STATUS_FORBIDDEN);
++ else
+ soup_auth_authenticate (auth, priv->username, priv->password);
+- }
+ }
+
+ static void
+@@ -1445,6 +1448,57 @@ proxy_settings_changed (EProxy *proxy,
+ g_object_set (priv->session, SOUP_SESSION_PROXY_URI, proxy_uri, NULL);
+ }
+
++static gboolean
++book_backend_webdav_test_can_connect (EBookBackendWebdav *webdav,
++ GCancellable *cancellable,
++ GError **error)
++{
++ SoupMessage *message;
++ gboolean res = FALSE;
++
++ g_return_val_if_fail (E_IS_BOOK_BACKEND_WEBDAV (webdav), FALSE);
++
++ /* Send a PROPFIND to test whether user/password is correct. */
++ message = send_propfind (webdav, cancellable);
++
++ switch (message->status_code) {
++ case SOUP_STATUS_OK:
++ case SOUP_STATUS_MULTI_STATUS:
++ res = TRUE;
++ break;
++
++ case SOUP_STATUS_UNAUTHORIZED:
++ case SOUP_STATUS_PROXY_UNAUTHORIZED:
++ g_free (webdav->priv->username);
++ webdav->priv->username = NULL;
++ g_free (webdav->priv->password);
++ webdav->priv->password = NULL;
++ g_set_error_literal (error, E_CLIENT_ERROR, E_CLIENT_ERROR_AUTHENTICATION_FAILED,
++ e_client_error_to_string (E_CLIENT_ERROR_AUTHENTICATION_FAILED));
++ break;
++
++ case SOUP_STATUS_FORBIDDEN:
++ g_free (webdav->priv->username);
++ webdav->priv->username = NULL;
++ g_free (webdav->priv->password);
++ webdav->priv->password = NULL;
++ g_set_error_literal (error, E_CLIENT_ERROR, E_CLIENT_ERROR_AUTHENTICATION_REQUIRED,
++ e_client_error_to_string (E_CLIENT_ERROR_AUTHENTICATION_REQUIRED));
++ break;
++
++ default:
++ g_set_error (
++ error, SOUP_HTTP_ERROR,
++ message->status_code,
++ "%s", message->reason_phrase);
++ break;
++ }
++
++ g_object_unref (message);
++
++ return res;
++}
++
+ static void
+ e_book_backend_webdav_open (EBookBackend *backend,
+ EDataBook *book,
+@@ -1546,6 +1600,8 @@ e_book_backend_webdav_open (EBookBackend
+ E_BACKEND (backend),
+ E_SOURCE_AUTHENTICATOR (backend),
+ cancellable, &error);
++ else
++ book_backend_webdav_test_can_connect (webdav, cancellable, &error);
+
+ soup_uri_free (suri);
+
+@@ -1647,8 +1703,8 @@ book_backend_webdav_try_password_sync (E
+ ESourceAuthentication *auth_extension;
+ ESourceAuthenticationResult result;
+ ESource *source;
+- SoupMessage *message;
+ const gchar *extension_name;
++ GError *local_error = NULL;
+
+ source = e_backend_get_source (E_BACKEND (authenticator));
+ extension_name = E_SOURCE_EXTENSION_AUTHENTICATION;
+@@ -1658,35 +1714,16 @@ book_backend_webdav_try_password_sync (E
+ e_source_authentication_dup_user (auth_extension);
+ webdav->priv->password = g_strdup (password->str);
+
+- /* Send a PROPFIND to test whether user/password is correct. */
+- message = send_propfind (webdav, cancellable);
+-
+- switch (message->status_code) {
+- case SOUP_STATUS_OK:
+- case SOUP_STATUS_MULTI_STATUS:
+- result = E_SOURCE_AUTHENTICATION_ACCEPTED;
+- break;
+-
+- case SOUP_STATUS_UNAUTHORIZED:
+- case SOUP_STATUS_PROXY_UNAUTHORIZED: /* XXX really? */
+- g_free (webdav->priv->username);
+- webdav->priv->username = NULL;
+- g_free (webdav->priv->password);
+- webdav->priv->password = NULL;
+- result = E_SOURCE_AUTHENTICATION_REJECTED;
+- break;
+-
+- default:
+- g_set_error (
+- error, SOUP_HTTP_ERROR,
+- message->status_code,
+- "%s", message->reason_phrase);
+- result = E_SOURCE_AUTHENTICATION_ERROR;
+- break;
++ if (book_backend_webdav_test_can_connect (webdav, cancellable, &local_error)) {
++ result = E_SOURCE_AUTHENTICATION_ACCEPTED;
++ } else if (g_error_matches (local_error, E_CLIENT_ERROR, E_CLIENT_ERROR_AUTHENTICATION_FAILED)) {
++ result = E_SOURCE_AUTHENTICATION_REJECTED;
++ g_clear_error (&local_error);
++ } else {
++ result = E_SOURCE_AUTHENTICATION_ERROR;
++ g_propagate_error (error, local_error);
+ }
+
+- g_object_unref (message);
+-
+ return result;
+ }
+
+diff -up evolution-data-server-3.8.5/calendar/backends/caldav/e-cal-backend-caldav.c.claim-missing-username evolution-data-server-3.8.5/calendar/backends/caldav/e-cal-backend-caldav.c
+--- evolution-data-server-3.8.5/calendar/backends/caldav/e-cal-backend-caldav.c.claim-missing-username 2014-10-08 15:33:51.561159274 +0200
++++ evolution-data-server-3.8.5/calendar/backends/caldav/e-cal-backend-caldav.c 2014-10-08 15:33:51.568159208 +0200
+@@ -565,18 +565,18 @@ status_code_to_result (SoupMessage *mess
+ priv->read_only = TRUE;
+ }
+ break;
+- case 404:
++ case SOUP_STATUS_NOT_FOUND:
+ if (is_opening)
+ g_propagate_error (perror, EDC_ERROR (NoSuchCal));
+ else
+ g_propagate_error (perror, EDC_ERROR (ObjectNotFound));
+ break;
+
+- case 403:
+- g_propagate_error (perror, EDC_ERROR (AuthenticationFailed));
++ case SOUP_STATUS_FORBIDDEN:
++ g_propagate_error (perror, EDC_ERROR (AuthenticationRequired));
+ break;
+
+- case 401:
++ case SOUP_STATUS_UNAUTHORIZED:
+ if (priv && priv->auth_required)
+ g_propagate_error (perror, EDC_ERROR (AuthenticationFailed));
+ else
+@@ -1012,7 +1012,10 @@ soup_authenticate (SoupSession *session,
+ gchar *user;
+
+ user = e_source_authentication_dup_user (auth_extension);
+- soup_auth_authenticate (auth, user, cbdav->priv->password);
++ if (!user || !*user)
++ soup_message_set_status (msg, SOUP_STATUS_FORBIDDEN);
++ else
++ soup_auth_authenticate (auth, user, cbdav->priv->password);
+ g_free (user);
+ }
+ }
+@@ -2931,7 +2934,7 @@ caldav_do_open (ECalBackendSync *backend
+
+ open_calendar (cbdav, cancellable, &local_error);
+
+- if (g_error_matches (local_error, E_DATA_CAL_ERROR, AuthenticationRequired) || g_error_matches (local_error, E_DATA_CAL_ERROR, AuthenticationFailed)) {
++ if (g_error_matches (local_error, E_DATA_CAL_ERROR, AuthenticationFailed)) {
+ g_clear_error (&local_error);
+ caldav_authenticate (
+ cbdav, FALSE, cancellable, perror);
+diff -up evolution-data-server-3.8.5/calendar/backends/http/e-cal-backend-http.c.claim-missing-username evolution-data-server-3.8.5/calendar/backends/http/e-cal-backend-http.c
+--- evolution-data-server-3.8.5/calendar/backends/http/e-cal-backend-http.c.claim-missing-username 2013-08-11 00:00:52.000000000 +0200
++++ evolution-data-server-3.8.5/calendar/backends/http/e-cal-backend-http.c 2014-10-08 15:33:51.568159208 +0200
+@@ -91,6 +91,10 @@ soup_authenticate (SoupSession *session,
+ ESourceAuthentication *auth_extension;
+ ESource *source;
+ const gchar *extension_name;
++ gchar *user;
++
++ if (retrying)
++ return;
+
+ cbhttp = E_CAL_BACKEND_HTTP (data);
+
+@@ -98,13 +102,14 @@ soup_authenticate (SoupSession *session,
+ extension_name = E_SOURCE_EXTENSION_AUTHENTICATION;
+ auth_extension = e_source_get_extension (source, extension_name);
+
+- if (!retrying && cbhttp->priv->password != NULL) {
+- gchar *user;
++ user = e_source_authentication_dup_user (auth_extension);
+
+- user = e_source_authentication_dup_user (auth_extension);
++ if (!user || !*user)
++ soup_message_set_status (msg, SOUP_STATUS_FORBIDDEN);
++ else if (cbhttp->priv->password != NULL)
+ soup_auth_authenticate (auth, user, cbhttp->priv->password);
+- g_free (user);
+- }
++
++ g_free (user);
+ }
+
+ /* Dispose handler for the file backend */
+@@ -790,6 +795,9 @@ begin_retrieval_cb (GIOSchedulerJob *job
+ E_BACKEND (backend),
+ E_SOURCE_AUTHENTICATOR (backend),
+ cancellable, &error);
++ } else if (g_error_matches (error, SOUP_HTTP_ERROR, SOUP_STATUS_FORBIDDEN)) {
++ g_clear_error (&error);
++ error = EDC_ERROR (AuthenticationRequired);
+ }
+
+ backend->priv->is_loading = FALSE;
+@@ -948,8 +956,12 @@ e_cal_backend_http_open (ECalBackendSync
+ registry, source,
+ E_SOURCE_AUTHENTICATOR (backend),
+ cancellable, &local_error);
++ } else if (g_error_matches (local_error, SOUP_HTTP_ERROR, SOUP_STATUS_FORBIDDEN)) {
++ g_clear_error (&local_error);
++ local_error = EDC_ERROR (AuthenticationRequired);
+ }
+
++
+ if (local_error != NULL)
+ g_propagate_error (perror, g_error_copy (local_error));
+ }
diff --git a/SOURCES/evolution-data-server-3.8.5-google-caldav-login.patch b/SOURCES/evolution-data-server-3.8.5-google-caldav-login.patch
new file mode 100644
index 0000000..60eb87e
--- /dev/null
+++ b/SOURCES/evolution-data-server-3.8.5-google-caldav-login.patch
@@ -0,0 +1,148 @@
+diff -up evolution-data-server-3.8.5/calendar/backends/caldav/e-cal-backend-caldav.c.google-caldav-login evolution-data-server-3.8.5/calendar/backends/caldav/e-cal-backend-caldav.c
+--- evolution-data-server-3.8.5/calendar/backends/caldav/e-cal-backend-caldav.c.google-caldav-login 2014-09-23 15:45:21.052427856 +0200
++++ evolution-data-server-3.8.5/calendar/backends/caldav/e-cal-backend-caldav.c 2014-09-23 15:59:41.388393766 +0200
+@@ -5157,11 +5157,16 @@ caldav_source_authenticator_init (ESourc
+ /* ************************************************************************* */
+ /* ***************************** GObject Foo ******************************* */
+
++static void e_caldav_backend_initable_init (GInitableIface *interface);
++
+ G_DEFINE_TYPE_WITH_CODE (
+ ECalBackendCalDAV,
+ e_cal_backend_caldav,
+ E_TYPE_CAL_BACKEND_SYNC,
+ G_IMPLEMENT_INTERFACE (
++ G_TYPE_INITABLE,
++ e_caldav_backend_initable_init)
++ G_IMPLEMENT_INTERFACE (
+ E_TYPE_SOURCE_AUTHENTICATOR,
+ caldav_source_authenticator_init))
+
+@@ -5244,11 +5249,82 @@ cal_backend_caldav_constructed (GObject
+ constructed (object);
+ }
+
+-static void
+-e_cal_backend_caldav_init (ECalBackendCalDAV *cbdav)
++static gboolean
++caldav_backend_initable_init (GInitable *initable,
++ GCancellable *cancellable,
++ GError **error)
+ {
++ ECalBackendCalDAVPrivate *priv;
+ SoupSessionFeature *feature;
++ ESource *source;
++ const gchar *extension_name;
++ gchar *auth_method = NULL;
++ gboolean success = TRUE;
++
++ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (initable);
++
++ feature = soup_session_get_feature (
++ priv->session, SOUP_TYPE_AUTH_MANAGER);
++
++ /* Add the "Bearer" auth type to support OAuth 2.0. */
++ soup_session_feature_add_feature (feature, E_TYPE_SOUP_AUTH_BEARER);
++
++ /* Preload the SoupAuthManager with a valid "Bearer" token
++ * when using OAuth 2.0. This avoids an extra unauthorized
++ * HTTP round-trip, which apparently Google doesn't like. */
++
++ source = e_backend_get_source (E_BACKEND (initable));
++
++ extension_name = E_SOURCE_EXTENSION_AUTHENTICATION;
++ if (e_source_has_extension (source, extension_name)) {
++ ESourceAuthentication *extension;
++
++ extension = e_source_get_extension (source, extension_name);
++ auth_method = e_source_authentication_dup_method (extension);
++ }
++
++ if (g_strcmp0 (auth_method, "OAuth2") == 0) {
++ ESourceWebdav *extension;
++ SoupAuth *soup_auth;
++ SoupURI *soup_uri;
++ gchar *access_token = NULL;
++ gint expires_in_seconds = -1;
++
++ extension_name = E_SOURCE_EXTENSION_WEBDAV_BACKEND;
++ extension = e_source_get_extension (source, extension_name);
++ soup_uri = e_source_webdav_dup_soup_uri (extension);
++
++ soup_auth = g_object_new (
++ E_TYPE_SOUP_AUTH_BEARER,
++ SOUP_AUTH_HOST, soup_uri->host, NULL);
++
++ success = e_source_get_oauth2_access_token_sync (
++ source, cancellable, &access_token,
++ &expires_in_seconds, error);
++
++ if (success) {
++ e_soup_auth_bearer_set_access_token (
++ E_SOUP_AUTH_BEARER (soup_auth),
++ access_token, expires_in_seconds);
++
++ soup_auth_manager_use_auth (
++ SOUP_AUTH_MANAGER (feature),
++ soup_uri, soup_auth);
++ }
+
++ g_free (access_token);
++ g_object_unref (soup_auth);
++ soup_uri_free (soup_uri);
++ }
++
++ g_free (auth_method);
++
++ return success;
++}
++
++static void
++e_cal_backend_caldav_init (ECalBackendCalDAV *cbdav)
++{
+ cbdav->priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ cbdav->priv->session = soup_session_sync_new ();
+ g_object_set (
+@@ -5258,15 +5334,6 @@ e_cal_backend_caldav_init (ECalBackendCa
+ SOUP_SESSION_SSL_USE_SYSTEM_CA_FILE, TRUE,
+ NULL);
+
+- /* XXX SoupAuthManager is public API as of libsoup 2.42, but
+- * this isn't worth bumping our libsoup requirement over.
+- * So get the SoupAuthManager GType by its type name. */
+- feature = soup_session_get_feature (
+- cbdav->priv->session,
+- g_type_from_name ("SoupAuthManager"));
+-
+- /* Add the "Bearer" auth type to support OAuth 2.0. */
+- soup_session_feature_add_feature (feature, E_TYPE_SOUP_AUTH_BEARER);
+
+ cbdav->priv->proxy = e_proxy_new ();
+ e_proxy_setup_proxy (cbdav->priv->proxy);
+@@ -5307,6 +5374,12 @@ e_cal_backend_caldav_init (ECalBackendCa
+ }
+
+ static void
++e_caldav_backend_initable_init (GInitableIface *interface)
++{
++ interface->init = caldav_backend_initable_init;
++}
++
++static void
+ e_cal_backend_caldav_class_init (ECalBackendCalDAVClass *class)
+ {
+ GObjectClass *object_class;
+diff -up evolution-data-server-3.8.5/libedataserver/e-source-webdav.c.google-caldav-login evolution-data-server-3.8.5/libedataserver/e-source-webdav.c
+--- evolution-data-server-3.8.5/libedataserver/e-source-webdav.c.google-caldav-login 2014-09-23 15:45:21.014427858 +0200
++++ evolution-data-server-3.8.5/libedataserver/e-source-webdav.c 2014-09-23 15:45:21.083427855 +0200
+@@ -245,7 +245,9 @@ source_webdav_update_soup_uri_from_prope
+
+ soup_uri_set_user (soup_uri, user);
+ soup_uri_set_host (soup_uri, host);
+- soup_uri_set_port (soup_uri, port);
++
++ if (port > 0)
++ soup_uri_set_port (soup_uri, port);
+
+ /* SoupURI doesn't like NULL paths. */
+ soup_uri_set_path (soup_uri, (path != NULL) ? path : "");
diff --git a/SOURCES/evolution-data-server-3.8.5-imapx-covscan-warning.patch b/SOURCES/evolution-data-server-3.8.5-imapx-covscan-warning.patch
new file mode 100644
index 0000000..6b38829
--- /dev/null
+++ b/SOURCES/evolution-data-server-3.8.5-imapx-covscan-warning.patch
@@ -0,0 +1,12 @@
+diff -up evolution-data-server-3.8.5/camel/camel-imapx-store-summary.c.covscan-warning evolution-data-server-3.8.5/camel/camel-imapx-store-summary.c
+--- evolution-data-server-3.8.5/camel/camel-imapx-store-summary.c.covscan-warning 2014-10-08 08:39:24.807298800 +0200
++++ evolution-data-server-3.8.5/camel/camel-imapx-store-summary.c 2014-10-08 08:39:42.008298072 +0200
+@@ -404,7 +404,7 @@ camel_imapx_store_summary_namespace_find
+ if (ns->full_name)
+ len = strlen (ns->full_name);
+ d ("find_full: comparing namespace '%s' to name '%s'\n", ns->full_name, full);
+- if (len == 0
++ if (len == 0 || !ns->full_name
+ || (strncmp (ns->full_name, full, len) == 0
+ && (full[len] == ns->sep || full[len] == 0)))
+ break;
diff --git a/SOURCES/evolution-data-server-3.8.5-ldap-view-stop-crash.patch b/SOURCES/evolution-data-server-3.8.5-ldap-view-stop-crash.patch
new file mode 100644
index 0000000..40e1134
--- /dev/null
+++ b/SOURCES/evolution-data-server-3.8.5-ldap-view-stop-crash.patch
@@ -0,0 +1,79 @@
+diff -up evolution-data-server-3.8.5/addressbook/backends/ldap/e-book-backend-ldap.c.ldap-stop-view-crash evolution-data-server-3.8.5/addressbook/backends/ldap/e-book-backend-ldap.c
+--- evolution-data-server-3.8.5/addressbook/backends/ldap/e-book-backend-ldap.c.ldap-stop-view-crash 2014-08-28 18:06:16.866096582 +0200
++++ evolution-data-server-3.8.5/addressbook/backends/ldap/e-book-backend-ldap.c 2014-08-28 18:06:24.734022099 +0200
+@@ -238,6 +238,8 @@ struct _EBookBackendLDAPPrivate {
+ EBookBackendSummary *summary;
+
+ gboolean generate_cache_in_progress; /* set to TRUE, when updating local cache for offline */
++
++ GMutex view_mutex;
+ };
+
+ typedef void (*LDAPOpHandler)(LDAPOp *op, LDAPMessage *res);
+@@ -4919,12 +4921,17 @@ ldap_search_handler (LDAPOp *op,
+ static void
+ ldap_search_dtor (LDAPOp *op)
+ {
++ EBookBackendLDAP *bl;
+ LDAPSearchOp *search_op = (LDAPSearchOp *) op;
+
+ d (printf ("ldap_search_dtor (%p)\n", search_op->view));
+
++ bl = E_BOOK_BACKEND_LDAP (e_data_book_view_get_backend (op->view));
++
+ /* unhook us from our EDataBookView */
++ g_mutex_lock (&bl->priv->view_mutex);
+ g_object_set_data (G_OBJECT (search_op->view), LDAP_SEARCH_OP_IDENT, NULL);
++ g_mutex_unlock (&bl->priv->view_mutex);
+
+ g_object_unref (search_op->view);
+
+@@ -5043,7 +5050,9 @@ e_book_backend_ldap_search (EBookBackend
+ printf ("and took %ld.%03ld seconds\n", diff / 1000,diff % 1000);
+ }
+
++ g_mutex_lock (&bl->priv->view_mutex);
+ g_object_set_data (G_OBJECT (view), LDAP_SEARCH_OP_IDENT, op);
++ g_mutex_unlock (&bl->priv->view_mutex);
+ }
+ return;
+ } else {
+@@ -5069,17 +5078,20 @@ static void
+ e_book_backend_ldap_stop_view (EBookBackend *backend,
+ EDataBookView *view)
+ {
++ EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (backend);
+ LDAPSearchOp *op;
+
+ d (printf ("stop_view (%p)\n", view));
+
++ g_mutex_lock (&bl->priv->view_mutex);
+ op = g_object_get_data (G_OBJECT (view), LDAP_SEARCH_OP_IDENT);
++ g_object_set_data (G_OBJECT (view), LDAP_SEARCH_OP_IDENT, NULL);
++ g_mutex_unlock (&bl->priv->view_mutex);
++
+ if (op) {
+ op->aborted = TRUE;
+ ldap_op_finished ((LDAPOp *) op);
+
+- g_object_set_data (G_OBJECT (view), LDAP_SEARCH_OP_IDENT, NULL);
+-
+ g_free (op);
+ }
+ }
+@@ -5572,6 +5584,7 @@ e_book_backend_ldap_finalize (GObject *o
+ g_rec_mutex_unlock (&priv->op_hash_mutex);
+ g_rec_mutex_unlock (&eds_ldap_handler_lock);
+ g_rec_mutex_clear (&priv->op_hash_mutex);
++ g_mutex_clear (&priv->view_mutex);
+
+ /* Remove the timeout before unbinding to avoid a race. */
+ if (priv->poll_timeout > 0) {
+@@ -5886,6 +5899,7 @@ e_book_backend_ldap_init (EBookBackendLD
+ backend->priv->ldap_limit = 100;
+ backend->priv->id_to_op = g_hash_table_new (g_int_hash, g_int_equal);
+
++ g_mutex_init (&backend->priv->view_mutex);
+ g_rec_mutex_init (&backend->priv->op_hash_mutex);
+
+ if (g_getenv ("LDAP_DEBUG"))
diff --git a/SOURCES/evolution-data-server-3.8.5-migrate-xdg-gconf.patch b/SOURCES/evolution-data-server-3.8.5-migrate-xdg-gconf.patch
new file mode 100644
index 0000000..a39b77f
--- /dev/null
+++ b/SOURCES/evolution-data-server-3.8.5-migrate-xdg-gconf.patch
@@ -0,0 +1,490 @@
+diff -up evolution-data-server-3.8.5/services/evolution-source-registry/evolution-scan-gconf-tree-xml.c.migrate-xdg-gconf evolution-data-server-3.8.5/services/evolution-source-registry/evolution-scan-gconf-tree-xml.c
+--- /dev/null 2015-01-08 18:41:41.414676937 +0100
++++ evolution-data-server-3.8.5/services/evolution-source-registry/evolution-scan-gconf-tree-xml.c 2015-01-08 18:41:46.936676699 +0100
+@@ -0,0 +1,70 @@
++/*
++ * evolution-scan-gconf-tree-xml.c
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) version 3.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with the program; if not, see
++ *
++ */
++
++#include
++#include
++#include
++#include
++
++#include
++
++#define PROGRAM_SUMMARY \
++ "Extracts Evolution accounts from a merged GConf tree file."
++
++/* Forward Declarations */
++gboolean evolution_source_registry_migrate_gconf_tree_xml
++ (const gchar *filename,
++ GError **error);
++
++gint
++main (gint argc,
++ gchar **argv)
++{
++ GOptionContext *context;
++ GError *error = NULL;
++
++ setlocale (LC_ALL, "");
++ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
++ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
++
++ context = g_option_context_new ("/path/to/%gconf-tree.xml");
++ g_option_context_set_summary (context, PROGRAM_SUMMARY);
++ g_option_context_parse (context, &argc, &argv, &error);
++
++ if (error != NULL) {
++ g_printerr ("%s\n", error->message);
++ exit (1);
++ }
++
++ if (argc != 2) {
++ g_print (
++ "Usage: %s /path/to/%%gconf-tree.xml\n\n",
++ g_get_prgname ());
++ exit (0);
++ }
++
++ evolution_source_registry_migrate_gconf_tree_xml (argv[1], &error);
++
++ if (error != NULL) {
++ g_printerr ("%s\n", error->message);
++ exit (1);
++ }
++
++ return 0;
++}
++
+diff -up evolution-data-server-3.8.5/services/evolution-source-registry/evolution-source-registry-migrate-sources.c.migrate-xdg-gconf evolution-data-server-3.8.5/services/evolution-source-registry/evolution-source-registry-migrate-sources.c
+--- evolution-data-server-3.8.5/services/evolution-source-registry/evolution-source-registry-migrate-sources.c.migrate-xdg-gconf 2013-07-23 13:57:39.000000000 +0200
++++ evolution-data-server-3.8.5/services/evolution-source-registry/evolution-source-registry-migrate-sources.c 2015-01-08 18:03:52.049774656 +0100
+@@ -165,7 +165,10 @@ static const SecretSchema e_passwords_sc
+ };
+
+ /* Forward Declarations */
+-void evolution_source_registry_migrate_sources (void);
++void evolution_source_registry_migrate_sources (void);
++gboolean evolution_source_registry_migrate_gconf_tree_xml
++ (const gchar *filename,
++ GError **error);
+
+ static ParseData *
+ parse_data_new (ParseType parse_type)
+@@ -186,6 +189,8 @@ parse_data_free (ParseData *parse_data)
+ * pointers are cleared before we get here. But if an error
+ * occurred we may leave data behind. This cleans it up. */
+
++ g_return_if_fail (parse_data != NULL);
++
+ if (parse_data->file != NULL)
+ g_object_unref (parse_data->file);
+
+@@ -3187,6 +3192,10 @@ migrate_parse_gconf_xml_start_element (G
+ {
+ ParseData *parse_data = user_data;
+
++ /* Only seen in merged XML files. */
++ if (g_strcmp0 (element_name, "dir") == 0)
++ return;
++
+ if (g_strcmp0 (element_name, "gconf") == 0) {
+ if (parse_data->state != PARSE_STATE_INITIAL)
+ goto invalid_content;
+@@ -3385,8 +3394,156 @@ migrate_parse_gconf_xml (ParseType parse
+ return success;
+ }
+
++static gboolean
++migrate_parse_gconf_tree_xml_in_evolution (GQueue *dir_stack)
++{
++ if (g_strcmp0 (g_queue_peek_nth (dir_stack, 0), "apps") != 0)
++ return FALSE;
++
++ if (g_strcmp0 (g_queue_peek_nth (dir_stack, 1), "evolution") != 0)
++ return FALSE;
++
++ return TRUE;
++}
++
++static void
++migrate_parse_gconf_tree_xml_start_element (GMarkupParseContext *context,
++ const gchar *element_name,
++ const gchar **attribute_names,
++ const gchar **attribute_values,
++ gpointer user_data,
++ GError **error)
++{
++ GQueue *dir_stack = user_data;
++
++ if (g_strcmp0 (element_name, "dir") == 0) {
++ ParseData *parse_data = NULL;
++ gchar *dir_name = NULL;
++
++ g_markup_collect_attributes (
++ element_name,
++ attribute_names,
++ attribute_values,
++ error,
++ G_MARKUP_COLLECT_STRDUP,
++ "name", &dir_name,
++ G_MARKUP_COLLECT_INVALID);
++
++ if (dir_name != NULL) {
++ /* Takes ownership of the string. */
++ g_queue_push_tail (dir_stack, dir_name);
++ dir_name = NULL;
++ }
++
++ /* Push a sub-parser to handle the tag. */
++
++ if (migrate_parse_gconf_tree_xml_in_evolution (dir_stack))
++ dir_name = g_queue_peek_tail (dir_stack);
++
++ if (g_strcmp0 (dir_name, "mail") == 0)
++ parse_data = parse_data_new (PARSE_TYPE_MAIL);
++
++ if (g_strcmp0 (dir_name, "addressbook") == 0)
++ parse_data = parse_data_new (PARSE_TYPE_ADDRESSBOOK);
++
++ if (g_strcmp0 (dir_name, "calendar") == 0)
++ parse_data = parse_data_new (PARSE_TYPE_CALENDAR);
++
++ if (g_strcmp0 (dir_name, "tasks") == 0)
++ parse_data = parse_data_new (PARSE_TYPE_TASKS);
++
++ if (g_strcmp0 (dir_name, "memos") == 0)
++ parse_data = parse_data_new (PARSE_TYPE_MEMOS);
++
++ if (parse_data != NULL) {
++ /* Pretend like we saw a tag. */
++ parse_data->state = PARSE_STATE_IN_GCONF;
++
++ g_markup_parse_context_push (
++ context, &gconf_xml_parser, parse_data);
++ }
++ }
++}
++
++static void
++migrate_parse_gconf_tree_xml_end_element (GMarkupParseContext *context,
++ const gchar *element_name,
++ gpointer user_data,
++ GError **error)
++{
++ GQueue *dir_stack = user_data;
++
++ if (g_strcmp0 (element_name, "dir") == 0) {
++ gboolean pop_parse_context = FALSE;
++
++ /* Figure out if we need to pop the parse context. */
++
++ if (migrate_parse_gconf_tree_xml_in_evolution (dir_stack)) {
++ const gchar *dir_name;
++
++ dir_name = g_queue_peek_tail (dir_stack);
++
++ if (g_strcmp0 (dir_name, "mail") == 0)
++ pop_parse_context = TRUE;
++
++ if (g_strcmp0 (dir_name, "addressbook") == 0)
++ pop_parse_context = TRUE;
++
++ if (g_strcmp0 (dir_name, "calendar") == 0)
++ pop_parse_context = TRUE;
++
++ if (g_strcmp0 (dir_name, "tasks") == 0)
++ pop_parse_context = TRUE;
++
++ if (g_strcmp0 (dir_name, "memos") == 0)
++ pop_parse_context = TRUE;
++ }
++
++ if (pop_parse_context) {
++ ParseData *parse_data;
++
++ parse_data = g_markup_parse_context_pop (context);
++ parse_data_free (parse_data);
++ }
++
++ g_free (g_queue_pop_tail (dir_stack));
++ }
++}
++
++static GMarkupParser gconf_tree_xml_parser = {
++ migrate_parse_gconf_tree_xml_start_element,
++ migrate_parse_gconf_tree_xml_end_element,
++ NULL, /* text */
++ NULL, /* passthrough */
++ NULL /* error */
++};
++
++static gboolean
++migrate_parse_gconf_tree_xml (const gchar *contents,
++ gsize length,
++ GError **error)
++{
++ GMarkupParseContext *context;
++ GQueue dir_stack = G_QUEUE_INIT;
++ gboolean success = FALSE;
++
++ context = g_markup_parse_context_new (
++ &gconf_tree_xml_parser, 0,
++ &dir_stack, (GDestroyNotify) NULL);
++
++ if (g_markup_parse_context_parse (context, contents, length, error))
++ if (g_markup_parse_context_end_parse (context, error))
++ success = TRUE;
++
++ g_markup_parse_context_free (context);
++
++ g_warn_if_fail (g_queue_is_empty (&dir_stack));
++
++ return success;
++}
++
+ static void
+-migrate_remove_gconf_xml (const gchar *gconf_key,
++migrate_remove_gconf_key (const gchar *gconf_key,
+ const gchar *gconf_xml)
+ {
+ /* Remove the GConf string list so the user is not haunted by
+@@ -3425,11 +3582,14 @@ migrate_remove_gconf_xml (const gchar *g
+ g_free (command_line);
+ }
+
+- if (g_file_test (gconf_xml, G_FILE_TEST_IS_REGULAR)) {
+- if (g_remove (gconf_xml) == -1) {
+- g_printerr (
+- "Failed to remove '%s': %s\n",
+- gconf_xml, g_strerror (errno));
++ /* This will be NULL when parsing a merged XML tree. */
++ if (gconf_xml != NULL) {
++ if (g_file_test (gconf_xml, G_FILE_TEST_IS_REGULAR)) {
++ if (g_remove (gconf_xml) == -1) {
++ g_printerr (
++ "Failed to remove '%s': %s\n",
++ gconf_xml, g_strerror (errno));
++ }
+ }
+ }
+ }
+@@ -3443,8 +3603,45 @@ migrate_handle_error (const GError *erro
+ g_printerr (" FAILED: %s\n", error->message);
+ }
+
+-void
+-evolution_source_registry_migrate_sources (void)
++static void
++migrate_merged_gconf_tree (const gchar *gconf_tree_xml)
++{
++ gchar *contents;
++ gsize length;
++ GError *error = NULL;
++
++ g_file_get_contents (gconf_tree_xml, &contents, &length, &error);
++
++ if (error == NULL) {
++ migrate_parse_gconf_tree_xml (contents, length, &error);
++ g_free (contents);
++ }
++
++ if (error == NULL) {
++ const gchar *gconf_key;
++
++ gconf_key = "/apps/evolution/mail/accounts";
++ migrate_remove_gconf_key (gconf_key, NULL);
++
++ gconf_key = "/apps/evolution/addressbook/sources";
++ migrate_remove_gconf_key (gconf_key, NULL);
++
++ gconf_key = "/apps/evolution/calendar/sources";
++ migrate_remove_gconf_key (gconf_key, NULL);
++
++ gconf_key = "/apps/evolution/tasks/sources";
++ migrate_remove_gconf_key (gconf_key, NULL);
++
++ gconf_key = "/apps/evolution/memos/sources";
++ migrate_remove_gconf_key (gconf_key, NULL);
++ } else {
++ migrate_handle_error (error);
++ g_clear_error (&error);
++ }
++}
++
++static void
++migrate_normal_gconf_tree (const gchar *gconf_base_dir)
+ {
+ gchar *base_dir;
+ gchar *contents;
+@@ -3454,7 +3651,7 @@ evolution_source_registry_migrate_source
+ GError *error = NULL;
+
+ base_dir = g_build_filename (
+- g_get_home_dir (), ".gconf", "apps", "evolution", NULL);
++ gconf_base_dir, "apps", "evolution", NULL);
+
+ /* ------------------------------------------------------------------*/
+
+@@ -3473,7 +3670,7 @@ evolution_source_registry_migrate_source
+
+ if (error == NULL) {
+ gconf_key = "/apps/evolution/mail/accounts";
+- migrate_remove_gconf_xml (gconf_key, gconf_xml);
++ migrate_remove_gconf_key (gconf_key, gconf_xml);
+ } else {
+ migrate_handle_error (error);
+ g_clear_error (&error);
+@@ -3498,7 +3695,7 @@ evolution_source_registry_migrate_source
+
+ if (error == NULL) {
+ gconf_key = "/apps/evolution/addressbook/sources";
+- migrate_remove_gconf_xml (gconf_key, gconf_xml);
++ migrate_remove_gconf_key (gconf_key, gconf_xml);
+ } else {
+ migrate_handle_error (error);
+ g_clear_error (&error);
+@@ -3523,7 +3720,7 @@ evolution_source_registry_migrate_source
+
+ if (error == NULL) {
+ gconf_key = "/apps/evolution/calendar/sources";
+- migrate_remove_gconf_xml (gconf_key, gconf_xml);
++ migrate_remove_gconf_key (gconf_key, gconf_xml);
+ } else {
+ migrate_handle_error (error);
+ g_clear_error (&error);
+@@ -3548,7 +3745,7 @@ evolution_source_registry_migrate_source
+
+ if (error == NULL) {
+ gconf_key = "/apps/evolution/tasks/sources";
+- migrate_remove_gconf_xml (gconf_key, gconf_xml);
++ migrate_remove_gconf_key (gconf_key, gconf_xml);
+ } else {
+ migrate_handle_error (error);
+ g_clear_error (&error);
+@@ -3573,7 +3770,7 @@ evolution_source_registry_migrate_source
+
+ if (error == NULL) {
+ gconf_key = "/apps/evolution/memos/sources";
+- migrate_remove_gconf_xml (gconf_key, gconf_xml);
++ migrate_remove_gconf_key (gconf_key, gconf_xml);
+ } else {
+ migrate_handle_error (error);
+ g_clear_error (&error);
+@@ -3585,3 +3782,51 @@ evolution_source_registry_migrate_source
+
+ g_free (base_dir);
+ }
++
++void
++evolution_source_registry_migrate_sources (void)
++{
++ gchar *gconf_base_dir;
++ gchar *gconf_tree_xml;
++
++ /* If the GConf is configured to follow XDG settings, then its root
++ * data folder is ~/.config/gconf/, thus try this first and fallback
++ * to the default non-XDG path ~/.gconf/ if it doesn't exist. */
++ gconf_base_dir = g_build_filename (g_get_user_config_dir (), "gconf", NULL);
++ if (!g_file_test (gconf_base_dir, G_FILE_TEST_EXISTS)) {
++ g_free (gconf_base_dir);
++ gconf_base_dir = g_build_filename (g_get_home_dir (), ".gconf", NULL);
++ }
++
++ gconf_tree_xml = g_build_filename (gconf_base_dir, "%gconf-tree.xml", NULL);
++
++ /* Handle a merged GConf tree file if present (mainly for
++ * Debian), otherwise assume a normal GConf directory tree. */
++ if (g_file_test (gconf_tree_xml, G_FILE_TEST_IS_REGULAR))
++ migrate_merged_gconf_tree (gconf_tree_xml);
++ else
++ migrate_normal_gconf_tree (gconf_base_dir);
++
++ g_free (gconf_base_dir);
++ g_free (gconf_tree_xml);
++}
++
++gboolean
++evolution_source_registry_migrate_gconf_tree_xml (const gchar *filename,
++ GError **error)
++{
++ gchar *contents;
++ gsize length;
++ gboolean success = FALSE;
++
++ /* Extracts account info from an arbitrary merged XML file. */
++
++ if (g_file_get_contents (filename, &contents, &length, error)) {
++ success = migrate_parse_gconf_tree_xml (
++ contents, length, error);
++ g_free (contents);
++ }
++
++ return success;
++}
++
+diff -up evolution-data-server-3.8.5/services/evolution-source-registry/Makefile.am.migrate-xdg-gconf evolution-data-server-3.8.5/services/evolution-source-registry/Makefile.am
+--- evolution-data-server-3.8.5/services/evolution-source-registry/Makefile.am.migrate-xdg-gconf 2013-03-17 13:46:02.000000000 +0100
++++ evolution-data-server-3.8.5/services/evolution-source-registry/Makefile.am 2015-01-08 18:03:52.049774656 +0100
+@@ -40,7 +40,10 @@ EXTRA_DIST = \
+ $(service_in_files) \
+ $(NULL)
+
+-libexec_PROGRAMS = evolution-source-registry
++libexec_PROGRAMS = \
++ evolution-source-registry \
++ evolution-scan-gconf-tree-xml \
++ $(NULL)
+
+ evolution_source_registry_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+@@ -72,6 +75,33 @@ evolution_source_registry_LDADD = \
+ $(LIBSECRET_LIBS) \
+ $(CAMEL_LIBS) \
+ $(SOUP_LIBS) \
++ $(NULL)
++
++evolution_scan_gconf_tree_xml_CPPFLAGS = \
++ $(AM_CPPFLAGS) \
++ -I$(top_srcdir) \
++ -I$(top_builddir) \
++ -DG_LOG_DOMAIN=\"evolution-scan-gconf-tree-xml\" \
++ -DLOCALEDIR=\"$(localedir)\" \
++ $(E_DATA_SERVER_CFLAGS) \
++ $(LIBSECRET_CFLAGS) \
++ $(CAMEL_CFLAGS) \
++ $(SOUP_CFLAGS) \
++ $(NULL)
++
++evolution_scan_gconf_tree_xml_SOURCES = \
++ evolution-scan-gconf-tree-xml.c \
++ evolution-source-registry-migrate-sources.c \
++ $(NULL)
++
++evolution_scan_gconf_tree_xml_LDADD = \
++ $(top_builddir)/libebackend/libebackend-1.2.la \
++ $(top_builddir)/libedataserver/libedataserver-1.2.la \
++ $(top_builddir)/camel/libcamel-1.2.la \
++ $(E_DATA_SERVER_LIBS) \
++ $(LIBSECRET_LIBS) \
++ $(CAMEL_LIBS) \
++ $(SOUP_LIBS) \
+ $(NULL)
+
+ evolution-source-registry-resource.h: evolution-source-registry-resource.xml $(builtin_sources)
diff --git a/SOURCES/evolution-data-server-3.8.5-poodle-enable-tls-for-ssl.patch b/SOURCES/evolution-data-server-3.8.5-poodle-enable-tls-for-ssl.patch
new file mode 100644
index 0000000..f24658e
--- /dev/null
+++ b/SOURCES/evolution-data-server-3.8.5-poodle-enable-tls-for-ssl.patch
@@ -0,0 +1,102 @@
+diff -up evolution-data-server-3.8.5/camel/camel.c.poodle-enable-tls-for-ssl evolution-data-server-3.8.5/camel/camel.c
+--- evolution-data-server-3.8.5/camel/camel.c.poodle-enable-tls-for-ssl 2013-08-11 00:00:52.000000000 +0200
++++ evolution-data-server-3.8.5/camel/camel.c 2014-11-12 15:45:10.939371073 +0100
+@@ -100,6 +100,9 @@ camel_init (const gchar *configdir,
+ gchar *nss_configdir = NULL;
+ gchar *nss_sql_configdir = NULL;
+ SECStatus status = SECFailure;
++#if NSS_VMAJOR > 3 || (NSS_VMAJOR == 3 && NSS_VMINOR >= 14)
++ SSLVersionRange versionStream;
++#endif
+
+ #if NSS_VMAJOR < 3 || (NSS_VMAJOR == 3 && NSS_VMINOR < 14)
+ /* NSS pre-3.14 has most of the ciphers disabled, thus enable
+@@ -212,8 +215,14 @@ skip_nss_init:
+
+ SSL_OptionSetDefault (SSL_ENABLE_SSL2, v2_enabled ? PR_TRUE : PR_FALSE);
+ SSL_OptionSetDefault (SSL_V2_COMPATIBLE_HELLO, PR_FALSE);
++#if NSS_VMAJOR < 3 || (NSS_VMAJOR == 3 && NSS_VMINOR < 14)
+ SSL_OptionSetDefault (SSL_ENABLE_SSL3, PR_TRUE);
+- SSL_OptionSetDefault (SSL_ENABLE_TLS, PR_TRUE);
++ SSL_OptionSetDefault (SSL_ENABLE_TLS, PR_TRUE); /* Enable TLSv1.0 */
++#else
++ /* Enable all SSL/TLS versions supported by NSS (this API is for SSLv3 and newer). */
++ SSL_VersionRangeGetSupported (ssl_variant_stream, &versionStream);
++ SSL_VersionRangeSetDefault (ssl_variant_stream, &versionStream);
++#endif
+
+ PR_Unlock (nss_initlock);
+
+diff -up evolution-data-server-3.8.5/camel/camel-network-service.c.poodle-enable-tls-for-ssl evolution-data-server-3.8.5/camel/camel-network-service.c
+--- evolution-data-server-3.8.5/camel/camel-network-service.c.poodle-enable-tls-for-ssl 2014-11-12 15:55:06.542380733 +0100
++++ evolution-data-server-3.8.5/camel/camel-network-service.c 2014-11-12 15:55:19.373322744 +0100
+@@ -324,7 +324,8 @@ network_service_connect_sync (CamelNetwo
+ stream = camel_tcp_stream_ssl_new (
+ session, host,
+ CAMEL_TCP_STREAM_SSL_ENABLE_SSL2 |
+- CAMEL_TCP_STREAM_SSL_ENABLE_SSL3);
++ CAMEL_TCP_STREAM_SSL_ENABLE_SSL3 |
++ CAMEL_TCP_STREAM_SSL_ENABLE_TLS);
+ break;
+
+ default:
+diff -up evolution-data-server-3.8.5/camel/camel-tcp-stream-ssl.c.poodle-enable-tls-for-ssl evolution-data-server-3.8.5/camel/camel-tcp-stream-ssl.c
+--- evolution-data-server-3.8.5/camel/camel-tcp-stream-ssl.c.poodle-enable-tls-for-ssl 2013-08-11 00:00:52.000000000 +0200
++++ evolution-data-server-3.8.5/camel/camel-tcp-stream-ssl.c 2014-11-12 15:45:10.939371073 +0100
+@@ -43,6 +43,8 @@
+ #include
+ #include "nss.h" /* Don't use <> here or it will include the system nss.h instead */
+ #include
++#include
++#include
+ #include
+ #include
+ #include
+@@ -545,6 +547,9 @@ enable_ssl (CamelTcpStreamSSL *ssl,
+ {
+ PRFileDesc *ssl_fd;
+ static gchar v2_enabled = -1;
++#if NSS_VMAJOR > 3 || (NSS_VMAJOR == 3 && NSS_VMINOR >= 14)
++ SSLVersionRange versionStreamSup, versionStream;
++#endif
+
+ g_assert (fd != NULL);
+
+@@ -575,6 +580,7 @@ enable_ssl (CamelTcpStreamSSL *ssl,
+ SSL_OptionSet (ssl_fd, SSL_V2_COMPATIBLE_HELLO, PR_FALSE);
+ }
+
++#if NSS_VMAJOR < 3 || (NSS_VMAJOR == 3 && NSS_VMINOR < 14)
+ if (ssl->priv->flags & CAMEL_TCP_STREAM_SSL_ENABLE_SSL3)
+ SSL_OptionSet (ssl_fd, SSL_ENABLE_SSL3, PR_TRUE);
+ else
+@@ -585,6 +591,29 @@ enable_ssl (CamelTcpStreamSSL *ssl,
+ else
+ SSL_OptionSet (ssl_fd, SSL_ENABLE_TLS, PR_FALSE);
+
++#else
++ SSL_VersionRangeGetSupported (ssl_variant_stream, &versionStreamSup);
++
++ if (ssl->priv->flags & CAMEL_TCP_STREAM_SSL_ENABLE_SSL3)
++ versionStream.min = SSL_LIBRARY_VERSION_3_0;
++ else
++ versionStream.min = SSL_LIBRARY_VERSION_TLS_1_0;
++
++ if (ssl->priv->flags & CAMEL_TCP_STREAM_SSL_ENABLE_TLS)
++ versionStream.max = versionStreamSup.max;
++ else
++ versionStream.max = SSL_LIBRARY_VERSION_3_0;
++
++ if (versionStream.max < versionStream.min) {
++ PRUint16 tmp;
++
++ tmp = versionStream.max;
++ versionStream.max = versionStream.min;
++ versionStream.min = tmp;
++ }
++
++ SSL_VersionRangeSet (ssl_fd, &versionStream);
++#endif
+ SSL_SetURL (ssl_fd, ssl->priv->expected_host);
+
+ /* NSS provides a default implementation for the SSL_GetClientAuthDataHook callback
diff --git a/SOURCES/evolution-data-server-3.8.5-weather-calendar.patch b/SOURCES/evolution-data-server-3.8.5-weather-calendar.patch
new file mode 100644
index 0000000..0a7bfc8
--- /dev/null
+++ b/SOURCES/evolution-data-server-3.8.5-weather-calendar.patch
@@ -0,0 +1,211 @@
+diff -up evolution-data-server-3.8.5/calendar/backends/weather/e-cal-backend-weather.c.weather-calendar evolution-data-server-3.8.5/calendar/backends/weather/e-cal-backend-weather.c
+--- evolution-data-server-3.8.5/calendar/backends/weather/e-cal-backend-weather.c.weather-calendar 2013-07-23 13:58:14.000000000 +0200
++++ evolution-data-server-3.8.5/calendar/backends/weather/e-cal-backend-weather.c 2014-10-08 13:12:19.142604974 +0200
+@@ -69,9 +69,6 @@ struct _ECalBackendWeatherPrivate {
+ /* Flags */
+ gboolean opened;
+
+- /* City (for summary) */
+- gchar *city;
+-
+ /* Weather source */
+ EWeatherSource *source;
+
+@@ -313,7 +310,6 @@ create_weather (ECalBackendWeather *cbw,
+ GWeatherInfo *report,
+ gboolean is_forecast)
+ {
+- ECalBackendWeatherPrivate *priv;
+ ECalComponent *cal_comp;
+ ECalComponentText comp_summary;
+ icalcomponent *ical_comp;
+@@ -322,19 +318,18 @@ create_weather (ECalBackendWeather *cbw,
+ gchar *uid;
+ GSList *text_list = NULL;
+ ECalComponentText *description;
+- gchar *tmp;
++ gchar *tmp, *city_name;
+ time_t update_time;
+ icaltimezone *update_zone = NULL;
+ const GWeatherLocation *location;
+ const GWeatherTimezone *w_timezone;
++ gdouble tmin = 0.0, tmax = 0.0;
+
+ g_return_val_if_fail (E_IS_CAL_BACKEND_WEATHER (cbw), NULL);
+
+ if (!gweather_info_get_value_update (report, &update_time))
+ return NULL;
+
+- priv = cbw->priv;
+-
+ /* create the component and event object */
+ ical_comp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
+ cal_comp = e_cal_component_new ();
+@@ -373,28 +368,27 @@ create_weather (ECalBackendWeather *cbw,
+ /* We have to add 1 day to DTEND, as it is not inclusive. */
+ e_cal_component_set_dtend (cal_comp, &dt);
+
+- {
+- gdouble tmin = 0.0, tmax = 0.0;
++ city_name = gweather_info_get_location_name (report);
++ if (gweather_info_get_value_temp_min (report, GWEATHER_TEMP_UNIT_DEFAULT, &tmin) &&
++ gweather_info_get_value_temp_max (report, GWEATHER_TEMP_UNIT_DEFAULT, &tmax) &&
++ tmin != tmax) {
++ gchar *min, *max;
++
++ min = gweather_info_get_temp_min (report);
++ max = gweather_info_get_temp_max (report);
++ comp_summary.value = g_strdup_printf ("%s : %s / %s", city_name, min, max);
+
+- if (gweather_info_get_value_temp_min (report, GWEATHER_TEMP_UNIT_DEFAULT, &tmin) &&
+- gweather_info_get_value_temp_max (report, GWEATHER_TEMP_UNIT_DEFAULT, &tmax) &&
+- tmin != tmax) {
+- gchar *min, *max;
+-
+- min = gweather_info_get_temp_min (report);
+- max = gweather_info_get_temp_max (report);
+- comp_summary.value = g_strdup_printf ("%s : %s / %s", priv->city, min, max);
+-
+- g_free (min); g_free (max);
+- } else {
+- gchar *temp;
++ g_free (min); g_free (max);
++ } else {
++ gchar *temp;
+
+- temp = gweather_info_get_temp (report);
+- comp_summary.value = g_strdup_printf ("%s : %s", priv->city, temp);
++ temp = gweather_info_get_temp (report);
++ comp_summary.value = g_strdup_printf ("%s : %s", city_name, temp);
+
+- g_free (temp);
+- }
++ g_free (temp);
+ }
++ g_free (city_name);
++
+ comp_summary.altrep = NULL;
+ e_cal_component_set_summary (cal_comp, &comp_summary);
+ g_free ((gchar *) comp_summary.value);
+@@ -484,28 +478,14 @@ e_cal_backend_weather_open (ECalBackendS
+ {
+ ECalBackendWeather *cbw;
+ ECalBackendWeatherPrivate *priv;
+- ESource *source;
+- ESourceWeather *extension;
+- const gchar *extension_name;
+ const gchar *cache_dir;
+- gchar *location;
+ gboolean online;
+
+ cbw = E_CAL_BACKEND_WEATHER (backend);
+ priv = cbw->priv;
+
+- source = e_backend_get_source (E_BACKEND (backend));
+ cache_dir = e_cal_backend_get_cache_dir (E_CAL_BACKEND (backend));
+
+- extension_name = E_SOURCE_EXTENSION_WEATHER_BACKEND;
+- extension = e_source_get_extension (source, extension_name);
+-
+- g_free (priv->city);
+-
+- location = e_source_weather_dup_location (extension);
+- priv->city = g_strdup (strrchr (location, '/') + 1);
+- g_free (location);
+-
+ e_cal_backend_notify_readonly (E_CAL_BACKEND (backend), TRUE);
+
+ online = e_backend_get_online (E_BACKEND (backend));
+@@ -788,8 +768,6 @@ e_cal_backend_weather_finalize (GObject
+ priv->store = NULL;
+ }
+
+- g_free (priv->city);
+-
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (e_cal_backend_weather_parent_class)->finalize (object);
+ }
+diff -up evolution-data-server-3.8.5/calendar/backends/weather/e-weather-source.c.weather-calendar evolution-data-server-3.8.5/calendar/backends/weather/e-weather-source.c
+--- evolution-data-server-3.8.5/calendar/backends/weather/e-weather-source.c.weather-calendar 2013-07-23 13:58:13.000000000 +0200
++++ evolution-data-server-3.8.5/calendar/backends/weather/e-weather-source.c 2014-10-08 13:10:01.743610796 +0200
+@@ -71,6 +71,37 @@ e_weather_source_init (EWeatherSource *s
+ source->priv = E_WEATHER_SOURCE_GET_PRIVATE (source);
+ }
+
++static GWeatherLocation *
++weather_source_find_location_by_coords (GWeatherLocation *start,
++ gdouble latitude,
++ gdouble longitude)
++{
++ GWeatherLocation *location, **children;
++ gint ii;
++
++ if (!start)
++ return NULL;
++
++ location = start;
++ if (gweather_location_has_coords (location)) {
++ gdouble lat, lon;
++
++ gweather_location_get_coords (location, &lat, &lon);
++
++ if (lat == latitude && lon == longitude)
++ return location;
++ }
++
++ children = gweather_location_get_children (location);
++ for (ii = 0; children[ii]; ii++) {
++ location = weather_source_find_location_by_coords (children[ii], latitude, longitude);
++ if (location)
++ return location;
++ }
++
++ return NULL;
++}
++
+ EWeatherSource *
+ e_weather_source_new (const gchar *location)
+ {
+@@ -99,6 +130,18 @@ e_weather_source_new (const gchar *locat
+ tokens = g_strsplit (location, "/", 2);
+
+ glocation = gweather_location_find_by_station_code (world, tokens[0]);
++
++ if (!glocation) {
++ gdouble latitude, longitude;
++ gchar *endptr = NULL;
++
++ latitude = g_ascii_strtod (location, &endptr);
++ if (endptr && *endptr == '/') {
++ longitude = g_ascii_strtod (endptr + 1, NULL);
++ glocation = weather_source_find_location_by_coords (world, latitude, longitude);
++ }
++ }
++
+ if (glocation != NULL)
+ gweather_location_ref (glocation);
+
+@@ -109,7 +152,7 @@ e_weather_source_new (const gchar *locat
+ return NULL;
+
+ source = g_object_new (E_TYPE_WEATHER_SOURCE, NULL);
+- source->priv->location = gweather_location_ref (glocation);
++ source->priv->location = glocation;
+
+ return source;
+ }
+@@ -146,11 +189,12 @@ e_weather_source_parse (EWeatherSource *
+ source->priv->info = gweather_info_new (
+ source->priv->location,
+ GWEATHER_FORECAST_LIST);
++ gweather_info_set_enabled_providers (source->priv->info, GWEATHER_PROVIDER_ALL);
+ g_signal_connect (
+ source->priv->info, "updated",
+ G_CALLBACK (weather_source_updated_cb), source);
+- } else {
+- gweather_info_update (source->priv->info);
+ }
++
++ gweather_info_update (source->priv->info);
+ }
+
diff --git a/SPECS/evolution-data-server.spec b/SPECS/evolution-data-server.spec
index b4edef0..8090d8a 100644
--- a/SPECS/evolution-data-server.spec
+++ b/SPECS/evolution-data-server.spec
@@ -4,6 +4,9 @@
%define nntp_support 1
%define largefile_support 1
+# Coverity scan can override this to 0, to skip checking in gtk-doc generated code
+%{!?with_docs: %define with_docs 1}
+
%define glib2_version 2.34.0
%define gtk3_version 3.2.0
%define gcr_version 3.4
@@ -28,7 +31,7 @@
Name: evolution-data-server
Version: 3.8.5
-Release: 24%{?dist}
+Release: 34%{?dist}
Group: System Environment/Libraries
Summary: Backend data server for Evolution
License: LGPLv2+
@@ -101,21 +104,45 @@ Patch21: evolution-data-server-3.8.5-maildir-get-folder-use-after-free.patch
# RH bug #1034384
Patch22: evolution-data-server-3.8.5-imapx-disconnect-changes.patch
-# RH bug #1097249, RH bug #1097250, RH bug #1097251
+# RH bug #1083601, RH bug #1084088, RH bug #1084112
Patch23: evolution-data-server-3.8.5-imapx-conn-manager-ext.patch
-# RH bug #1097252
+# RH bug #1084973
Patch24: evolution-data-server-3.8.5-imapx-check-cancelled-jobs.patch
-# RH bug #1097253
+# RH bug #1090816
Patch25: evolution-data-server-3.8.5-memory-leaks.patch
-# RH bug #1097250 - updated patch
+# RH bug #1084088 - updated patch
Patch26: evolution-data-server-3.8.5-imapx-error-cancelled-message-download.patch
-# RH bug #1100240
+# RH bug #1098036
Patch27: evolution-data-server-3.8.5-imapx-check-all-namespaces.patch
+# RH bug #1141691
+Patch28: evolution-data-server-3.8.5-google-caldav-login.patch
+
+# RH bug #1131927
+Patch29: evolution-data-server-3.8.5-ldap-view-stop-crash.patch
+
+# RH bug #1150382
+Patch30: evolution-data-server-3.8.5-imapx-covscan-warning.patch
+
+# RH bug #1122644
+Patch31: evolution-data-server-3.8.5-weather-calendar.patch
+
+# RH bug #1079923
+Patch32: evolution-data-server-3.8.5-claim-missing-username.patch
+
+# RH bug #1153723
+Patch33: evolution-data-server-3.8.5-poodle-enable-tls-for-ssl.patch
+
+# RH bug #1170552
+Patch34: evolution-data-server-3.8.5-cameldb-track-pending-syncs.patch
+
+# RH bug #1180174
+Patch35: evolution-data-server-3.8.5-migrate-xdg-gconf.patch
+
### Build Dependencies ###
BuildRequires: libdb-devel
@@ -176,6 +203,8 @@ Requires: sqlite-devel
%description devel
Development files needed for building things which link against %{name}.
+%if %{with_docs}
+
%package doc
Summary: Documentation files for %{name}
Group: Development/Libraries
@@ -184,6 +213,9 @@ BuildArch: noarch
%description doc
This package contains developer documentation for %{name}.
+# %{with_docs}
+%endif
+
%prep
%setup -q
@@ -212,6 +244,14 @@ This package contains developer documentation for %{name}.
%patch25 -p1 -b .memory-leaks
%patch26 -p1 -b .imapx-error-cancelled-message-download
%patch27 -p1 -b .imapx-check-all-namespaces
+%patch28 -p1 -b .google-caldav-login
+%patch29 -p1 -b .ldap-view-stop-crash
+%patch30 -p1 -b .imapx-covscan-warning
+%patch31 -p1 -b .weather-calendar
+%patch32 -p1 -b .claim-missing-username
+%patch33 -p1 -b .poodle-enable-tls-for-ssl
+%patch34 -p1 -b .cameldb-track-pending-syncs
+%patch35 -p1 -b .migrate-xdg-gconf
%build
%if %{ldap_support}
@@ -260,6 +300,12 @@ fi
%define ssl_flags --enable-smime=yes
+%if %{with_docs}
+%define gtkdoc_flags --enable-gtk-doc
+%else
+%define gtkdoc_flags --disable-gtk-doc
+%endif
+
if ! pkg-config --exists nss; then
echo "Unable to find suitable version of nss to use!"
exit 1
@@ -285,19 +331,13 @@ autoconf
--with-libdb=/usr \
--enable-file-locking=fcntl \
--enable-dot-locking=no \
- --enable-gtk-doc \
--enable-introspection=yes \
--enable-vala-bindings \
%ldap_flags %krb5_flags %nntp_flags %ssl_flags \
- %largefile_flags
+ %largefile_flags %gtkdoc_flags
export tagname=CC
-# Do not build in parallel. The libedata-book and libedata-cal directories
-# each produce a shared library and an executable binary that links to the
-# shared library. If the executable binary finishes first the build fails.
-# There may be other similar cases in the source tree.
-#make %{?_smp_mflags} LIBTOOL=/usr/bin/libtool
-make LIBTOOL=/usr/bin/libtool
+make %{?_smp_mflags} LIBTOOL=/usr/bin/libtool
%install
rm -rf $RPM_BUILD_ROOT
@@ -351,6 +391,7 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || :
%{_libexecdir}/camel-lock-helper-1.2
%{_libexecdir}/evolution-addressbook-factory
%{_libexecdir}/evolution-calendar-factory
+%{_libexecdir}/evolution-scan-gconf-tree-xml
%{_libexecdir}/evolution-source-registry
%{_libexecdir}/evolution-user-prompter
@@ -444,6 +485,8 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || :
%{_datadir}/vala/vapi/libedataserver-1.2.deps
%{_datadir}/vala/vapi/libedataserver-1.2.vapi
+%if %{with_docs}
+
%files doc
%defattr(-,root,root,-)
%{_datadir}/gtk-doc/html/camel
@@ -455,22 +498,49 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || :
%{_datadir}/gtk-doc/html/libedata-cal
%{_datadir}/gtk-doc/html/libedataserver
+# %{with_docs}
+%endif
+
%changelog
-* Wed May 28 2014 Milan Crha - 3.8.5-24
-- Resolves: #1092926 (rebuild due incorrect dist)
+* Thu Jan 08 2015 Milan Crha - 3.8.5-34
+- Add patch for RH bug #1180174 (Check GConf XDG folder for migration too)
+
+* Mon Dec 08 2014 Milan Crha - 3.8.5-33
+- Add patch for RH bug #1170552 ([CamelDB] Use-after-free on DB close with pending sync request)
+
+* Wed Nov 12 2014 Milan Crha - 3.8.5-32
+- Update patch for RH bug #1153723 ([Camel] Enable TLS algorithms for SSL connections)
+
+* Wed Oct 22 2014 Milan Crha - 3.8.5-31
+- Re-enable parallel build
+- Build devel documentation conditionally
+
+* Tue Oct 21 2014 Milan Crha - 3.8.5-30
+- Add patch for RH bug #1153723 ([Camel] Enable TLS algorithms for SSL connections)
+
+* Wed Oct 08 2014 Milan Crha - 3.8.5-29
+- Add patch for RH bug #1079923 (Claim missing user name when authenticating)
+
+* Wed Oct 08 2014 Milan Crha - 3.8.5-28
+- Add patch for RH bug #1131927 (Crash in LDAP's stop_view function)
+- Add patch for RH bug #1150382 (Coverity scan warning in IMAPx)
+- Add patch for RH bug #1122644 (Weather calendar doesn't work)
+
+* Tue Oct 07 2014 Milan Crha - 3.8.5-27
+- Add patch for RH bug #1141691 (Adapt to new Google HTTP restriction)
-* Thu May 22 2014 Milan Crha - 3.8.5-23.3
-- Add patch for RH bug #1100240 (IMAPx: Check in all namespaces)
+* Thu May 22 2014 Milan Crha - 3.8.5-26
+- Add patch for RH bug #1098036 (IMAPx: Check in all namespaces)
-* Fri May 16 2014 Milan Crha - 3.8.5-23.2
-- Update patch for RH bug #1097250 (IMAPx: Avoid 'Empty cache file' error)
+* Fri May 16 2014 Milan Crha - 3.8.5-25
+- Update patch for RH bug #1084088 (IMAPx: Avoid 'Empty cache file' error)
-* Tue May 13 2014 Milan Crha - 3.8.5-23.1
-- Add patch for RH bug #1097249 (IMAPx: Improve responsiveness)
-- Add patch for RH bug #1097250 (IMAPx: Avoid 'Empty cache file' error)
-- Add patch for RH bug #1097251 (IMAPx: Avoid 'Source stream returned no data' error)
-- Add patch for RH bug #1097252 (IMAPx: Refetching summary information for all msgs)
-- Add patch for RH bug #1097253 (Fix various memory leaks)
+* Tue May 13 2014 Milan Crha - 3.8.5-24
+- Add patch for RH bug #1083601 (IMAPx: Improve responsiveness)
+- Add patch for RH bug #1084088 (IMAPx: Avoid 'Empty cache file' error)
+- Add patch for RH bug #1084112 (IMAPx: Avoid 'Source stream returned no data' error)
+- Add patch for RH bug #1084973 (IMAPx: Refetching summary information for all msgs)
+- Add patch for RH bug #1090816 (Fix various memory leaks)
* Mon Apr 07 2014 Milan Crha - 3.8.5-23
- Add patch for RH bug #1034384 (IMAPx: Disconnect changes)