2005-07-14 [colin] 1.9.12cvs49
authorColin Leroy <colin@colino.net>
Thu, 14 Jul 2005 11:29:21 +0000 (11:29 +0000)
committerColin Leroy <colin@colino.net>
Thu, 14 Jul 2005 11:29:21 +0000 (11:29 +0000)
* configure.ac
* src/common/Makefile.am
* src/common/plugin.c
* src/common/plugin.h
Add a little plugin dependancy system.
Plugins can ship a $plugin_name.deps file
(near them in PLUGINDIR) so that their
dependancies are loaded if possible.
* src/plugins/Makefile.am
* src/plugins/pgpcore/Makefile.am
* src/plugins/pgpcore/passphrase.c
* src/plugins/pgpcore/passphrase.h
* src/plugins/pgpcore/plugin.c
* src/plugins/pgpcore/prefs_gpg.c
* src/plugins/pgpcore/prefs_gpg.h
* src/plugins/pgpcore/select-keys.c
* src/plugins/pgpcore/select-keys.h
* src/plugins/pgpcore/sgpgme.c
* src/plugins/pgpcore/sgpgme.h
Introduce pgpcore, used by pgpmime and
pgpinline
* src/plugins/pgpmime/Makefile.am
* src/plugins/pgpmime/passphrase.c
* src/plugins/pgpmime/passphrase.h
* src/plugins/pgpmime/pgpmime.c
* src/plugins/pgpmime/pgpmime.deps
* src/plugins/pgpmime/plugin.c
* src/plugins/pgpmime/prefs_gpg.c
* src/plugins/pgpmime/prefs_gpg.h
* src/plugins/pgpmime/select-keys.c
* src/plugins/pgpmime/select-keys.h
* src/plugins/pgpmime/sgpgme.c
* src/plugins/pgpmime/sgpgme.h
Remove the core from pgpmime and add the
dependancy to pgpcore.

21 files changed:
ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/common/Makefile.am
src/common/plugin.c
src/common/plugin.h
src/plugins/Makefile.am
src/plugins/pgpcore/Makefile.am [new file with mode: 0644]
src/plugins/pgpcore/passphrase.c [moved from src/plugins/pgpmime/passphrase.c with 100% similarity]
src/plugins/pgpcore/passphrase.h [moved from src/plugins/pgpmime/passphrase.h with 100% similarity]
src/plugins/pgpcore/plugin.c [new file with mode: 0644]
src/plugins/pgpcore/prefs_gpg.c [moved from src/plugins/pgpmime/prefs_gpg.c with 100% similarity]
src/plugins/pgpcore/prefs_gpg.h [moved from src/plugins/pgpmime/prefs_gpg.h with 100% similarity]
src/plugins/pgpcore/select-keys.c [moved from src/plugins/pgpmime/select-keys.c with 100% similarity]
src/plugins/pgpcore/select-keys.h [moved from src/plugins/pgpmime/select-keys.h with 100% similarity]
src/plugins/pgpcore/sgpgme.c [moved from src/plugins/pgpmime/sgpgme.c with 100% similarity]
src/plugins/pgpcore/sgpgme.h [moved from src/plugins/pgpmime/sgpgme.h with 100% similarity]
src/plugins/pgpmime/Makefile.am
src/plugins/pgpmime/pgpmime.c
src/plugins/pgpmime/pgpmime.deps [new file with mode: 0644]
src/plugins/pgpmime/plugin.c

index f4eddc83091ac81313b0ac750078ba1b78fd93fe..f1dc062bd760211b1f531da9fafd9fdeba9232fb 100644 (file)
@@ -1,3 +1,41 @@
+2005-07-14 [colin]     1.9.12cvs49
+
+       * configure.ac
+       * src/common/Makefile.am
+       * src/common/plugin.c
+       * src/common/plugin.h
+               Add a little plugin dependancy system.
+               Plugins can ship a $plugin_name.deps file
+               (near them in PLUGINDIR) so that their
+               dependancies are loaded if possible.
+       * src/plugins/Makefile.am
+       * src/plugins/pgpcore/Makefile.am
+       * src/plugins/pgpcore/passphrase.c
+       * src/plugins/pgpcore/passphrase.h
+       * src/plugins/pgpcore/plugin.c
+       * src/plugins/pgpcore/prefs_gpg.c
+       * src/plugins/pgpcore/prefs_gpg.h
+       * src/plugins/pgpcore/select-keys.c
+       * src/plugins/pgpcore/select-keys.h
+       * src/plugins/pgpcore/sgpgme.c
+       * src/plugins/pgpcore/sgpgme.h
+               Introduce pgpcore, used by pgpmime and
+               pgpinline
+       * src/plugins/pgpmime/Makefile.am
+       * src/plugins/pgpmime/passphrase.c
+       * src/plugins/pgpmime/passphrase.h
+       * src/plugins/pgpmime/pgpmime.c
+       * src/plugins/pgpmime/pgpmime.deps
+       * src/plugins/pgpmime/plugin.c
+       * src/plugins/pgpmime/prefs_gpg.c
+       * src/plugins/pgpmime/prefs_gpg.h
+       * src/plugins/pgpmime/select-keys.c
+       * src/plugins/pgpmime/select-keys.h
+       * src/plugins/pgpmime/sgpgme.c
+       * src/plugins/pgpmime/sgpgme.h
+               Remove the core from pgpmime and add the
+               dependancy to pgpcore.
+
 2005-07-14 [paul]      1.9.12cvs48
 
        * src/stock_pixmap.c
index 9432e4367ca3b631b300597bd53c315e6bfcbebd..61b18168ef6d9a011bf767ac1b51960015746dae 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.19 -r 1.1.2.20 src/plugins/pgpmime/pgpmime.c;  cvs diff -u -r 1.1.2.11 -r 1.1.2.12 src/plugins/pgpmime/sgpgme.c;  ) > 1.9.12cvs46.patchset
 ( cvs diff -u -r 1.61.2.29 -r 1.61.2.30 src/account.c;  cvs diff -u -r 1.60.2.17 -r 1.60.2.18 src/addressbook.c;  cvs diff -u -r 1.382.2.141 -r 1.382.2.142 src/compose.c;  cvs diff -u -r 1.50.2.9 -r 1.50.2.10 src/compose.h;  cvs diff -u -r 1.26.2.16 -r 1.26.2.17 src/foldersel.c;  cvs diff -u -r 1.115.2.41 -r 1.115.2.42 src/main.c;  cvs diff -u -r 1.204.2.46 -r 1.204.2.47 src/prefs_common.c;  cvs diff -u -r 1.395.2.92 -r 1.395.2.93 src/summaryview.c;  cvs diff -u -r 1.96.2.62 -r 1.96.2.63 src/textview.c;  cvs diff -u -r 1.5.2.15 -r 1.5.2.16 src/gtk/menu.c;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/pixmaps/sylpheed_icon.xpm;  ) > 1.9.12cvs47.patchset
 ( cvs diff -u -r 1.25.2.14 -r 1.25.2.15 src/stock_pixmap.c;  ) > 1.9.12cvs48.patchset
+( cvs diff -u -r 1.654.2.683 -r 1.654.2.684 configure.ac;  cvs diff -u -r 1.24.2.7 -r 1.24.2.8 src/common/Makefile.am;  cvs diff -u -r 1.13.2.4 -r 1.13.2.5 src/common/plugin.c;  cvs diff -u -r 1.5 -r 1.6 src/common/plugin.h;  cvs diff -u -r 1.8.2.2 -r 1.8.2.3 src/plugins/Makefile.am;  diff -u /dev/null src/plugins/pgpcore/Makefile.am;  diff -u /dev/null src/plugins/pgpcore/passphrase.c;  diff -u /dev/null src/plugins/pgpcore/passphrase.h;  diff -u /dev/null src/plugins/pgpcore/plugin.c;  diff -u /dev/null src/plugins/pgpcore/prefs_gpg.c;  diff -u /dev/null src/plugins/pgpcore/prefs_gpg.h;  diff -u /dev/null src/plugins/pgpcore/select-keys.c;  diff -u /dev/null src/plugins/pgpcore/select-keys.h;  diff -u /dev/null src/plugins/pgpcore/sgpgme.c;  diff -u /dev/null src/plugins/pgpcore/sgpgme.h;  cvs diff -u -r 1.1.2.2 -r 1.1.2.3 src/plugins/pgpmime/Makefile.am;  cvs diff -u -r -1.1.2.9 -r -1.1.2.10 src/plugins/pgpmime/passphrase.c;  cvs diff -u -r -1.1.2.2 -r -1.1.2.3 src/plugins/pgpmime/passphrase.h;  cvs diff -u -r 1.1.2.20 -r 1.1.2.21 src/plugins/pgpmime/pgpmime.c;  diff -u /dev/null src/plugins/pgpmime/pgpmime.deps;  cvs diff -u -r 1.1.2.10 -r 1.1.2.11 src/plugins/pgpmime/plugin.c;  cvs diff -u -r -1.1.2.10 -r -1.1.2.11 src/plugins/pgpmime/prefs_gpg.c;  cvs diff -u -r -1.1.2.3 -r -1.1.2.4 src/plugins/pgpmime/prefs_gpg.h;  cvs diff -u -r -1.1.2.7 -r -1.1.2.8 src/plugins/pgpmime/select-keys.c;  cvs diff -u -r -1.1.2.2 -r -1.1.2.3 src/plugins/pgpmime/select-keys.h;  cvs diff -u -r -1.1.2.12 -r -1.1.2.13 src/plugins/pgpmime/sgpgme.c;  cvs diff -u -r -1.1.2.5 -r -1.1.2.6 src/plugins/pgpmime/sgpgme.h;  ) > 1.9.12cvs49.patchset
index 2e5ad9307a15999b1031a80463ce85d86ce354be..b8892870659b78926d584208e9ed71d29bc989a7 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=48
+EXTRA_VERSION=49
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
@@ -548,7 +548,19 @@ if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
 fi
 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
 
-dnl --- PGP/MIME ---
+dnl --- PGP/CORE ---
+AC_ARG_ENABLE(pgpcore-plugin,
+       [  --disable-pgpcore-plugin           Do not build PGP/Core plugin],
+       [ac_cv_enable_pgpcore_plugin=$enableval], [ac_cv_enable_pgpcore_plugin=yes])
+if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
+       AM_PATH_GPGME(0.4.5, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
+                     [ac_cv_enable_pgpcore_plugin=no])
+       if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
+               PLUGINS="pgpcore $PLUGINS"
+       fi
+fi
+AM_CONDITIONAL(BUILD_PGPCORE_PLUGIN, test x"$ac_cv_enable_pgpcore_plugin" = xyes)
+
 AC_ARG_ENABLE(pgpmime-plugin,
        [  --disable-pgpmime-plugin           Do not build PGP/MIME plugin],
        [ac_cv_enable_pgpmime_plugin=$enableval], [ac_cv_enable_pgpmime_plugin=yes])
@@ -669,6 +681,7 @@ src/plugins/dillo_viewer/Makefile
 src/plugins/trayicon/Makefile
 src/plugins/trayicon/libeggtrayicon/Makefile
 src/plugins/clamav/Makefile
+src/plugins/pgpcore/Makefile
 src/plugins/pgpmime/Makefile
 doc/Makefile
 doc/faq/Makefile
index 7984eb06f356d9fced7b7779bc0602e97ac9f48d..515d469d1e6f9b6569567b67e6d0c7a2dfab28ee 100644 (file)
@@ -1,3 +1,4 @@
+PLUGINDIR = $(pkglibdir)/plugins/
 noinst_LTLIBRARIES = libsylpheedcommon.la
 
 libsylpheedcommon_la_SOURCES = \
@@ -62,7 +63,8 @@ INCLUDES = \
 AM_CPPFLAGS = \
        $(GLIB_CFLAGS) \
        $(OPENSSL_CFLAGS) \
-       -DLOCALEDIR=\""$(localedir)"\"
+       -DLOCALEDIR=\""$(localedir)"\" \
+       -DPLUGINDIR=\"$(PLUGINDIR)\" 
 
 libsylpheedcommon_la_LIBADD = \
        $(GLIB_LIBS) \
index 10cb9d4c9b2d20e9845f5d850c178c08e74ef7ff..da25e5c68d87640bff93c3c9b3825eef9dc4894f 100644 (file)
@@ -35,6 +35,7 @@ struct _Plugin
        const gchar *(*name) (void);
        const gchar *(*desc) (void);
        const gchar *(*type) (void);
+       GSList *rdeps;
 };
 
 /**
@@ -53,7 +54,6 @@ static gint list_find_by_plugin_filename(const Plugin *plugin, const gchar *file
         g_return_val_if_fail(plugin, 1);
         g_return_val_if_fail(plugin->filename, 1);
         g_return_val_if_fail(filename, 1);
-        
         return strcmp(filename, plugin->filename);
 }
 
@@ -90,14 +90,103 @@ void plugin_save_list(void)
        }
 }
 
+static gboolean plugin_is_loaded(const gchar *filename)
+{
+       return (g_slist_find_custom(plugins, filename, 
+                  (GCompareFunc)list_find_by_plugin_filename) != NULL);
+}
+
+static Plugin *plugin_get_by_filename(const gchar *filename)
+{
+       GSList *cur = plugins;
+       for(; cur; cur = cur->next) {
+               Plugin *p = (Plugin *)cur->data;
+               if (!strcmp(p->filename, filename)) {
+                       return p;
+               } 
+       }
+       return NULL;
+}
+
+/** 
+ * Loads a plugin dependancies
+ * 
+ * Plugin dependancies are, optionnaly, listed in a file in
+ * PLUGINDIR/$pluginname.deps.
+ * \param filename The filename of the plugin for which we have to load deps
+ * \param error The location where an error string can be stored
+ * \return 0 on success, -1 otherwise
+ */
+static gint plugin_load_deps(const gchar *filename, gchar **error)
+{
+       gchar *tmp = g_strdup(filename);
+       gchar *deps_file = NULL;
+       FILE *fp = NULL;
+       gchar buf[BUFFSIZE];
+       
+       *strrchr(tmp, '.') = '\0';
+       deps_file = g_strconcat(tmp, ".deps", NULL);
+       g_free(tmp);
+       
+       fp = fopen(deps_file, "rb");
+       g_free(deps_file);
+       
+       if (!fp)
+               return 0;
+       
+       while (fgets(buf, sizeof(buf), fp) != NULL) {
+               Plugin *dep_plugin = NULL;
+               gchar *path = NULL;
+               buf[strlen(buf)-1]='\0'; /* chop off \n */
+               path = g_strconcat(PLUGINDIR, buf,
+                               ".", G_MODULE_SUFFIX, NULL);
+               if ((dep_plugin = plugin_get_by_filename(path)) == NULL) {
+                       debug_print("trying to load %s\n", path);
+                       dep_plugin = plugin_load(path, error);
+                       if (dep_plugin == NULL) {
+                               g_free(path);
+                               return -1;
+                       }
+               }
+               if (!g_slist_find_custom(dep_plugin->rdeps, 
+                               (gpointer) filename, list_find_by_string)) {
+                       debug_print("adding %s to %s rdeps\n",
+                               filename,
+                               dep_plugin->filename);
+                       dep_plugin->rdeps = 
+                               g_slist_append(dep_plugin->rdeps, 
+                                       g_strdup(filename));
+               }
+       }
+       fclose(fp);
+       return 0;
+}
+
+static void plugin_unload_rdeps(Plugin *plugin)
+{
+       GSList *cur = plugin->rdeps;
+       debug_print("removing %s rdeps\n", plugin->filename);
+       while (cur) {
+               gchar *file = (gchar *)cur->data;
+               Plugin *rdep_plugin = file?plugin_get_by_filename(file):NULL;
+               debug_print(" rdep %s: %p\n", file, rdep_plugin);
+               if (rdep_plugin) {
+                       plugin_unload(rdep_plugin);
+               }
+               g_free(file);
+               cur = cur->next;
+       }
+       g_slist_free(plugin->rdeps);
+       plugin->rdeps = NULL;
+}
 /**
  * Loads a plugin
  *
  * \param filename The filename of the plugin to load
  * \param error The location where an error string can be stored
- * \return 0 on success, -1 otherwise
+ * \return the plugin on success, NULL otherwise
  */
-gint plugin_load(const gchar *filename, gchar **error)
+Plugin *plugin_load(const gchar *filename, gchar **error)
 {
        Plugin *plugin;
        gint (*plugin_init) (gchar **error);
@@ -105,27 +194,28 @@ gint plugin_load(const gchar *filename, gchar **error)
        const gchar *(*plugin_type)(void);
        gint ok;
 
-       g_return_val_if_fail(filename != NULL, -1);
-       g_return_val_if_fail(error != NULL, -1);
+       g_return_val_if_fail(filename != NULL, NULL);
+       g_return_val_if_fail(error != NULL, NULL);
 
         /* check duplicate plugin path name */
-        if (g_slist_find_custom(plugins, filename, 
-                                (GCompareFunc)list_find_by_plugin_filename)) {
+        if (plugin_is_loaded(filename)) {
                 *error = g_strdup(_("Plugin already loaded"));
-                return -1;                
+                return NULL;                
         }                               
        
+       if (plugin_load_deps(filename, error) < 0)
+               return NULL;
        plugin = g_new0(Plugin, 1);
        if (plugin == NULL) {
                *error = g_strdup(_("Failed to allocate memory for Plugin"));
-               return -1;
+               return NULL;
        }
 
        plugin->module = g_module_open(filename, 0);
        if (plugin->module == NULL) {
                *error = g_strdup(g_module_error());
                g_free(plugin);
-               return -1;
+               return NULL;
        }
 
        if (!g_module_symbol(plugin->module, "plugin_name", &plugin_name) ||
@@ -135,20 +225,20 @@ gint plugin_load(const gchar *filename, gchar **error)
                *error = g_strdup(g_module_error());
                g_module_close(plugin->module);
                g_free(plugin);
-               return -1;
+               return NULL;
        }
        
        if (!strcmp(plugin_type(), "GTK")) {
                *error = g_strdup(_("This module is for Sylpheed-Claws GTK1."));
                g_module_close(plugin->module);
                g_free(plugin);
-               return -1;
+               return NULL;
        }
 
        if ((ok = plugin_init(error)) < 0) {
                g_module_close(plugin->module);
                g_free(plugin);
-               return ok;
+               return NULL;
        }
 
        plugin->name = plugin_name;
@@ -160,13 +250,15 @@ gint plugin_load(const gchar *filename, gchar **error)
 
        debug_print("Plugin %s (from file %s) loaded\n", plugin->name(), filename);
 
-       return 0;
+       return plugin;
 }
 
 void plugin_unload(Plugin *plugin)
 {
        void (*plugin_done) (void);
 
+       plugin_unload_rdeps(plugin);
+
        if (g_module_symbol(plugin->module, "plugin_done", (gpointer *)&plugin_done)) {
                plugin_done();
        }
@@ -200,7 +292,7 @@ void plugin_load_all(const gchar *type)
                        break;
 
                g_strstrip(buf);
-               if ((buf[0] != '\0') && (plugin_load(buf, &error) < 0)) {
+               if ((buf[0] != '\0') && (plugin_load(buf, &error) == NULL)) {
                        g_warning("plugin loading error: %s\n", error);
                        g_free(error);
                }                                                       
index eb3606dd9e74575651bf445a8d00ac3f6862741f..35db8d27a2d58ba88ecd3df2e48589fe9ff97a8a 100644 (file)
@@ -31,7 +31,7 @@ const gchar *plugin_name      (void);
 const gchar *plugin_desc       (void);
 
 /* Functions by the sylpheed plugin system */
-gint plugin_load               (const gchar     *filename,
+Plugin *plugin_load            (const gchar     *filename,
                                 gchar          **error);
 void plugin_unload             (Plugin          *plugin);
 void plugin_load_all           (const gchar     *type);
index 433c99277c8f6719990dc59c321543a9838098e5..532e9fecf46f06ad7aaa760d9bb597d2db50fd94 100644 (file)
@@ -22,9 +22,12 @@ if BUILD_CLAMAV_PLUGIN
 clamav_dir = clamav
 endif
 
+if BUILD_PGPCORE_PLUGIN
+pgpcore_dir = pgpcore
 if BUILD_PGPMIME_PLUGIN
 pgpmime_dir = pgpmime
 endif
+endif
 
 SUBDIRS = $(demo_dir) \
        $(spamassasssin_dir) \
@@ -32,4 +35,5 @@ SUBDIRS = $(demo_dir) \
        $(dillo_viewer_dir) \
        $(trayicon_dir) \
        $(clamav_dir) \
+       $(pgpcore_dir) \
        $(pgpmime_dir)
diff --git a/src/plugins/pgpcore/Makefile.am b/src/plugins/pgpcore/Makefile.am
new file mode 100644 (file)
index 0000000..832bef1
--- /dev/null
@@ -0,0 +1,30 @@
+plugindir = $(pkglibdir)/plugins
+
+plugin_LTLIBRARIES = pgpcore.la
+
+pgpcore_la_SOURCES = \
+       passphrase.c \
+       plugin.c \
+       prefs_gpg.c \
+       select-keys.c \
+       sgpgme.c
+
+pluginincludedir = $(pkgincludedir)/plugins/pgpcore
+plugininclude_HEADERS = \
+       passphrase.h \
+       prefs_gpg.h \
+       select-keys.h \
+       sgpgme.h
+
+pgpcore_la_LDFLAGS = \
+       -avoid-version -module
+
+INCLUDES = \
+       -I../../ \
+       -I../../common \
+       -I../../gtk
+
+AM_CPPFLAGS = \
+       $(GLIB_CFLAGS) \
+       $(GTK_CFLAGS) \
+       $(GPGME_CFLAGS)
diff --git a/src/plugins/pgpcore/plugin.c b/src/plugins/pgpcore/plugin.c
new file mode 100644 (file)
index 0000000..7062cab
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2003 Hiroyuki Yamamoto
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <stddef.h>
+#include <glib.h>
+#include <glib/gi18n.h>
+
+#include "version.h"
+#include "common/sylpheed.h"
+#include "sgpgme.h"
+#include "prefs_gpg.h"
+
+gint plugin_init(gchar **error)
+{
+       if ((sylpheed_get_version() > VERSION_NUMERIC)) {
+               *error = g_strdup("Your sylpheed version is newer than the version the plugin was built with");
+               return -1;
+       }
+
+       if ((sylpheed_get_version() < MAKE_NUMERIC_VERSION(1, 9, 12, 40))) {
+               *error = g_strdup("Your sylpheed version is too old");
+               return -1;
+       }
+
+       sgpgme_init();
+       prefs_gpg_init();
+
+       return 0;       
+}
+
+void plugin_done(void)
+{
+       prefs_gpg_done();
+       sgpgme_done();
+}
+
+const gchar *plugin_name(void)
+{
+       return _("PGP/Core");
+}
+
+const gchar *plugin_desc(void)
+{
+       return _("This plugin handles PGP core operations. It is used by other\n"
+                "plugins, like PGP/Mime.\n\n"
+                "GPGME is copyright 2001 by Werner Koch <dd9jn@gnu.org>\n");
+}
+
+const gchar *plugin_type(void)
+{
+       return "GTK2";
+}
index f22781711cc307121d675fa7cc3ccacfd24fd01c..a5cffef19f9c64898af3f3e38957a1742c1f5a74 100644 (file)
@@ -1,22 +1,17 @@
 plugindir = $(pkglibdir)/plugins
+plugin_DATA=pgpmime.deps
 
 plugin_LTLIBRARIES = pgpmime.la
 
+EXTRA_DIST=pgpmime.deps
+
 pgpmime_la_SOURCES = \
-       passphrase.c \
        plugin.c \
-       pgpmime.c \
-       prefs_gpg.c \
-       select-keys.c \
-       sgpgme.c
+       pgpmime.c
 
 pluginincludedir = $(pkgincludedir)/plugins/pgpmime
 plugininclude_HEADERS = \
-       passphrase.h \
-       pgpmime.h \
-       prefs_gpg.h \
-       select-keys.h \
-       sgpgme.h
+       pgpmime.h 
 
 pgpmime_la_LDFLAGS = \
        -avoid-version -module
index a48a0c6cb58c7e7716b2285ffb8295d860cc6e2e..50c3e963fbf94b64d9d6799dc44b5f5f4896e1ea 100644 (file)
 #include "utils.h"
 #include "privacy.h"
 #include "procmime.h"
+
 #include "pgpmime.h"
-#include "sgpgme.h"
+#include <plugins/pgpcore/sgpgme.h>
+#include <plugins/pgpcore/prefs_gpg.h>
+#include <plugins/pgpcore/passphrase.h>
+
 #include "prefs_common.h"
-#include "prefs_gpg.h"
-#include "passphrase.h"
 
 typedef struct _PrivacyDataPGP PrivacyDataPGP;
 
diff --git a/src/plugins/pgpmime/pgpmime.deps b/src/plugins/pgpmime/pgpmime.deps
new file mode 100644 (file)
index 0000000..222cb5d
--- /dev/null
@@ -0,0 +1 @@
+pgpcore
index 06c4f1231405c3abdf91d3adaa25d3ea88c09876..d7bb7612214f972422bdbc18f09c892a1b4dd546 100644 (file)
@@ -27,9 +27,7 @@
 
 #include "version.h"
 #include "common/sylpheed.h"
-#include "sgpgme.h"
 #include "pgpmime.h"
-#include "prefs_gpg.h"
 
 gint plugin_init(gchar **error)
 {
@@ -43,18 +41,14 @@ gint plugin_init(gchar **error)
                return -1;
        }
 
-       sgpgme_init();
        pgpmime_init();
-       prefs_gpg_init();
 
        return 0;       
 }
 
 void plugin_done(void)
 {
-       prefs_gpg_done();
        pgpmime_done();
-       sgpgme_done();
 }
 
 const gchar *plugin_name(void)