Change the installation path for E-D-S backends.
authorMatthew Barnes <mbarnes@redhat.com>
Thu, 6 Jan 2011 16:20:17 +0000 (11:20 -0500)
committerMatthew Barnes <mbarnes@redhat.com>
Thu, 6 Jan 2011 16:20:17 +0000 (11:20 -0500)
Address book and calendar backend modules are now split into different
installation directories so the D-Bus factory processes will only load
relevant backend modules.

This changes some pkg-config details for third-party backend modules.

Instead of querying the backend directory with:

  pkg-config --variable=extensiondir evolution-data-server-1.2

you must query the directory for address book backends with:

  pkg-config --variable=backenddir libedata-book-1.2

and the directory for calendar backends with:

  pkg-config --variable=backenddir libedata-cal-1.2

25 files changed:
NEWS
addressbook/backends/file/Makefile.am
addressbook/backends/google/Makefile.am
addressbook/backends/groupwise/Makefile.am
addressbook/backends/ldap/Makefile.am
addressbook/backends/vcf/Makefile.am
addressbook/backends/webdav/Makefile.am
addressbook/libedata-book/Makefile.am
addressbook/libedata-book/e-data-book-factory.c
addressbook/libedata-book/libedata-book.pc.in
calendar/backends/caldav/Makefile.am
calendar/backends/contacts/Makefile.am
calendar/backends/file/Makefile.am
calendar/backends/groupwise/Makefile.am
calendar/backends/http/Makefile.am
calendar/backends/weather/Makefile.am
calendar/libedata-cal/Makefile.am
calendar/libedata-cal/e-data-cal-factory.c
calendar/libedata-cal/libedata-cal.pc.in
configure.ac
docs/reference/libebackend/tmpl/e-data-server-module.sgml
evolution-data-server.pc.in
libebackend/Makefile.am
libebackend/e-data-server-module.c
libebackend/e-data-server-module.h

diff --git a/NEWS b/NEWS
index dbb9ff8..19bde2b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,24 @@
+(NEWS blurb for 2.91.5.  Put this above the bug fixes and such.)
+
+Address book and calendar backend modules are now split into different
+installation directories so the D-Bus factory processes will only load
+relevant backend modules.
+
+This changes some pkg-config details for third-party backend modules.
+
+Instead of querying the backend directory with:
+
+  pkg-config --variable=extensiondir evolution-data-server-1.2
+
+you must query the directory for address book backends with:
+
+  pkg-config --variable=backenddir libedata-book-1.2
+
+and the directory for calendar backends with:
+
+  pkg-config --variable=backenddir libedata-cal-1.2
+
+
 Evolution-Data-Server 2.91.4 2010-12-20
 ---------------------------------------
 
index 7e1eea0..08cf58f 100644 (file)
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libebookbackendfile.la
+ebook_backend_LTLIBRARIES = libebookbackendfile.la
 
 libebookbackendfile_la_CPPFLAGS = \
        $(AM_CPPFLAGS)                                  \
index 3e903a7..581e662 100644 (file)
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libebookbackendgoogle.la
+ebook_backend_LTLIBRARIES = libebookbackendgoogle.la
 
 libebookbackendgoogle_la_CPPFLAGS = \
        $(AM_CPPFLAGS)                                  \
index 12bd8d7..3e64da5 100644 (file)
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libebookbackendgroupwise.la
+ebook_backend_LTLIBRARIES = libebookbackendgroupwise.la
 
 libebookbackendgroupwise_la_CPPFLAGS = \
        $(AM_CPPFLAGS)                                  \
index 48eea41..5b563c6 100644 (file)
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libebookbackendldap.la
+ebook_backend_LTLIBRARIES = libebookbackendldap.la
 
 libebookbackendldap_la_CPPFLAGS = \
        $(AM_CPPFLAGS)                                  \
index 9ac71e7..d8159ae 100644 (file)
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libebookbackendvcf.la
+ebook_backend_LTLIBRARIES = libebookbackendvcf.la
 
 libebookbackendvcf_la_CPPFLAGS = \
        $(AM_CPPFLAGS)                                  \
index d7f85e9..62636f7 100644 (file)
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libebookbackendwebdav.la
+ebook_backend_LTLIBRARIES = libebookbackendwebdav.la
 
 libebookbackendwebdav_la_CPPFLAGS = \
        $(AM_CPPFLAGS)                                  \
index 997c727..492edb2 100644 (file)
@@ -69,6 +69,7 @@ e_addressbook_factory_CPPFLAGS = \
        $(EVOLUTION_ADDRESSBOOK_CFLAGS)         \
        -DG_LOG_DOMAIN=\"libedata-book\"        \
        -DE_PRGNAME=\"e-addressbook-factory\"   \
+       -DBACKENDDIR=\"$(ebook_backenddir)\"    \
        -I$(top_srcdir)                         \
        -I$(top_srcdir)/addressbook             \
        -I$(top_srcdir)/addressbook/libegdbus   \
index 737ba8c..37c56fc 100644 (file)
@@ -411,6 +411,8 @@ remove_data_book_cb (gpointer data_bk, gpointer user_data)
 static void
 e_data_book_factory_init (EDataBookFactory *factory)
 {
+       GError *error = NULL;
+
        factory->priv = E_DATA_BOOK_FACTORY_GET_PRIVATE (factory);
 
        factory->priv->gdbus_object = e_gdbus_book_factory_stub_new ();
@@ -433,7 +435,9 @@ e_data_book_factory_init (EDataBookFactory *factory)
                (GDestroyNotify) g_free,
                (GDestroyNotify) NULL);
 
-       e_data_server_module_init ();
+       if (!e_data_server_module_init (BACKENDDIR, &error))
+               g_error ("%s", error->message);
+
        e_data_book_factory_register_backends (factory);
 }
 
index 99eefed..cd346eb 100644 (file)
@@ -2,6 +2,7 @@ prefix=@prefix@
 exec_prefix=@exec_prefix@
 libdir=@libdir@
 includedir=@includedir@
+backenddir=@ebook_backenddir@
 datarootdir=@datarootdir@
 datadir=@datadir@
 
index d052945..1ae1232 100644 (file)
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libecalbackendcaldav.la
+ecal_backend_LTLIBRARIES = libecalbackendcaldav.la
 
 libecalbackendcaldav_la_CPPFLAGS = \
        $(AM_CPPFLAGS)  \
index c38a7b9..f386ed7 100644 (file)
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libecalbackendcontacts.la
+ecal_backend_LTLIBRARIES = libecalbackendcontacts.la
 
 libecalbackendcontacts_la_CPPFLAGS = \
        $(AM_CPPFLAGS)                                  \
index ed386df..fe79080 100644 (file)
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libecalbackendfile.la
+ecal_backend_LTLIBRARIES = libecalbackendfile.la
 
 libecalbackendfile_la_CPPFLAGS = \
        $(AM_CPPFLAGS)                                  \
index 424113e..f03da4c 100644 (file)
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libecalbackendgroupwise.la
+ecal_backend_LTLIBRARIES = libecalbackendgroupwise.la
 
 libecalbackendgroupwise_la_CPPFLAGS = \
        $(AM_CPPFLAGS)                                  \
index fd0c97c..3f0be8a 100644 (file)
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libecalbackendhttp.la
+ecal_backend_LTLIBRARIES = libecalbackendhttp.la
 
 libecalbackendhttp_la_CPPFLAGS = \
        $(AM_CPPFLAGS)                                  \
index dc1cbbb..cd57049 100644 (file)
@@ -1,4 +1,4 @@
-extension_LTLIBRARIES = libecalbackendweather.la
+ecal_backend_LTLIBRARIES = libecalbackendweather.la
 
 libecalbackendweather_la_CPPFLAGS = \
        $(AM_CPPFLAGS)                                  \
index 91d9757..326c27d 100644 (file)
@@ -101,6 +101,7 @@ e_calendar_factory_CPPFLAGS = \
        $(AM_CPPFLAGS)                                  \
        -DG_LOG_DOMAIN=\"libedata-cal\"                 \
        -DE_PRGNAME=\"e-calendar-factory\"              \
+       -DBACKENDDIR=\"$(ecal_backenddir)\"             \
        -DLOCALEDIR=\"$(localedir)\"                    \
        -I$(top_srcdir)                                 \
        -I$(top_srcdir)/calendar                        \
index 76c53dd..4345c85 100644 (file)
@@ -522,6 +522,8 @@ remove_data_cal_cb (gpointer data_cl,
 static void
 e_data_cal_factory_init (EDataCalFactory *factory)
 {
+       GError *error = NULL;
+
        factory->priv = E_DATA_CAL_FACTORY_GET_PRIVATE (factory);
 
        factory->priv->gdbus_object = e_gdbus_cal_factory_stub_new ();
@@ -549,7 +551,9 @@ e_data_cal_factory_init (EDataCalFactory *factory)
                (GDestroyNotify) g_free,
                (GDestroyNotify) NULL);
 
-       e_data_server_module_init ();
+       if (!e_data_server_module_init (BACKENDDIR, &error))
+               g_error ("%s", error->message);
+
        e_data_cal_factory_register_backends (factory);
 }
 
index 42fba7a..5a9efa1 100644 (file)
@@ -2,6 +2,7 @@ prefix=@prefix@
 exec_prefix=@exec_prefix@
 libdir=@libdir@
 includedir=@includedir@
+backenddir=@ecal_backenddir@
 datarootdir=@datarootdir@
 datadir=@datadir@
 
index 5e60c8e..7e183b0 100644 (file)
@@ -97,11 +97,11 @@ LIBECAL_CURRENT=10
 LIBECAL_REVISION=2
 LIBECAL_AGE=2
 
-LIBEDATACAL_CURRENT=10
+LIBEDATACAL_CURRENT=11
 LIBEDATACAL_REVISION=0
 LIBEDATACAL_AGE=0
 
-LIBEDATABOOK_CURRENT=8
+LIBEDATABOOK_CURRENT=9
 LIBEDATABOOK_REVISION=0
 LIBEDATABOOK_AGE=0
 
@@ -113,12 +113,12 @@ LIBEGROUPWISE_CURRENT=13
 LIBEGROUPWISE_REVISION=1
 LIBEGROUPWISE_AGE=0
 
-LIBCAMEL_CURRENT=21
+LIBCAMEL_CURRENT=22
 LIBCAMEL_REVISION=0
 LIBCAMEL_AGE=0
 
-LIBEBACKEND_CURRENT=0
-LIBEBACKEND_REVISION=1
+LIBEBACKEND_CURRENT=1
+LIBEBACKEND_REVISION=0
 LIBEBACKEND_AGE=0
 
 AC_SUBST(EDS_MAJOR_VERSION)
@@ -1373,8 +1373,11 @@ AC_SUBST(privlibdir)
 imagesdir='${datadir}'/pixmaps/evolution-data-server
 AC_SUBST(imagesdir)
 
-extensiondir='${libdir}'/evolution-data-server-$API_VERSION/extensions
-AC_SUBST(extensiondir)
+ebook_backenddir='${libdir}'/evolution-data-server/addressbook-backends
+AC_SUBST(ebook_backenddir)
+
+ecal_backenddir='${libdir}'/evolution-data-server/calendar-backends
+AC_SUBST(ecal_backenddir)
 
 if test "x$use_gweather" = "xyes"; then
        weatherdatadir="$privdatadir/weather"
@@ -1382,7 +1385,7 @@ if test "x$use_gweather" = "xyes"; then
 fi
 
 dnl separate camel from e-d-s? or should it be under the same spot? same for now.
-camel_providerdir='${libdir}'/evolution-data-server-$API_VERSION/camel-providers
+camel_providerdir='${libdir}'/evolution-data-server/camel-providers
 AC_SUBST(camel_providerdir)
 
 dnl ******************************
index 0f066cf..f13a5be 100644 (file)
@@ -25,7 +25,9 @@ e-data-server-module
 
 </para>
 
-@void: 
+@module_path: 
+@error: 
+@Returns: 
 
 
 <!-- ##### FUNCTION e_data_server_get_extensions_for_type ##### -->
index c10806c..22d68e0 100644 (file)
@@ -3,7 +3,6 @@ exec_prefix=@exec_prefix@
 libdir=@libdir@
 includedir=@includedir@
 privlibdir=@privlibdir@
-extensiondir=@extensiondir@
 datarootdir=@datarootdir@
 datadir=@datadir@
 privdatadir=@privdatadir@
index 44296cc..424e6db 100644 (file)
@@ -4,7 +4,6 @@ libebackend_1_2_la_CPPFLAGS = \
        $(AM_CPPFLAGS)                                          \
        -I$(top_srcdir)                                         \
        -DG_LOG_DOMAIN=\"e-data-server\"                        \
-       -DE_DATA_SERVER_EXTENSIONDIR=\"$(extensiondir)\"        \
        $(DB_CFLAGS)                                            \
        $(E_BACKEND_CFLAGS)
 
index 52fb35b..d5739ee 100644 (file)
@@ -182,42 +182,38 @@ e_data_server_module_load_file (const gchar *filename)
        }
 }
 
-static void
-load_module_dir (const gchar *dirname)
+gboolean
+e_data_server_module_init (const gchar *module_path,
+                           GError **error)
 {
+       static gboolean initialized = FALSE;
+       const gchar *name;
        GDir *dir;
 
-       dir = g_dir_open (dirname, 0, NULL);
+       if (initialized)
+               return TRUE;
+
+       g_return_val_if_fail (module_path != NULL, FALSE);
 
-       if (dir) {
-               const gchar *name;
+       dir = g_dir_open (module_path, 0, error);
+       if (dir == NULL)
+               return FALSE;
 
-               while ((name = g_dir_read_name (dir))) {
-                       if (g_str_has_suffix (name, "." G_MODULE_SUFFIX)) {
-                               gchar *filename;
+       while ((name = g_dir_read_name (dir))) {
+               if (g_str_has_suffix (name, "." G_MODULE_SUFFIX)) {
+                       gchar *filename;
 
-                               filename = g_build_filename (dirname,
-                                                            name,
-                                                            NULL);
-                               e_data_server_module_load_file (filename);
-                               g_free (filename);
-                       }
+                       filename = g_build_filename (module_path, name, NULL);
+                       e_data_server_module_load_file (filename);
+                       g_free (filename);
                }
-
-               g_dir_close (dir);
        }
-}
 
-void
-e_data_server_module_init (void)
-{
-       static gboolean initialized = FALSE;
+       g_dir_close (dir);
 
-       if (!initialized) {
-               initialized = TRUE;
+       initialized = TRUE;
 
-               load_module_dir (E_DATA_SERVER_EXTENSIONDIR);
-       }
+       return TRUE;
 }
 
 GList *
index a7e9c4a..7220cde 100644 (file)
 
 G_BEGIN_DECLS
 
-void   e_data_server_module_init             (void);
-GList *e_data_server_get_extensions_for_type (GType type);
-void   e_data_server_extension_list_free     (GList *list);
-void   e_data_server_module_remove_unused    (void);
+gboolean       e_data_server_module_init       (const gchar *module_path,
+                                                GError **error);
+GList *                e_data_server_get_extensions_for_type
+                                               (GType type);
+void           e_data_server_extension_list_free
+                                               (GList *list);
+void           e_data_server_module_remove_unused
+                                               (void);
 
 /* Add a type to the module interface - allows EDS to add its own modules
  * without putting them in separate shared libraries */
-void   e_data_server_module_add_type         (GType  type);
+void           e_data_server_module_add_type   (GType  type);
 
 /* The following three functions should exist in modules that are
    written to be dynamically loaded */
-void                 eds_module_initialize (GTypeModule *module);
-void                 eds_module_shutdown   (void);
-void                 eds_module_list_types (const GType **types, gint *num_types);
+void           eds_module_initialize           (GTypeModule *module);
+void           eds_module_shutdown             (void);
+void           eds_module_list_types           (const GType **types,
+                                                gint *num_types);
 
 G_END_DECLS