From 2af36fb958b467b4b5b1bdc0eb1a18097a8a09f0 Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Thu, 14 Jul 2005 11:29:21 +0000 Subject: [PATCH] 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. --- ChangeLog-gtk2.claws | 38 ++++++ PATCHSETS | 1 + configure.ac | 17 ++- src/common/Makefile.am | 4 +- src/common/plugin.c | 122 +++++++++++++++--- src/common/plugin.h | 2 +- src/plugins/Makefile.am | 4 + src/plugins/pgpcore/Makefile.am | 30 +++++ src/plugins/{pgpmime => pgpcore}/passphrase.c | 0 src/plugins/{pgpmime => pgpcore}/passphrase.h | 0 src/plugins/pgpcore/plugin.c | 72 +++++++++++ src/plugins/{pgpmime => pgpcore}/prefs_gpg.c | 0 src/plugins/{pgpmime => pgpcore}/prefs_gpg.h | 0 .../{pgpmime => pgpcore}/select-keys.c | 0 .../{pgpmime => pgpcore}/select-keys.h | 0 src/plugins/{pgpmime => pgpcore}/sgpgme.c | 0 src/plugins/{pgpmime => pgpcore}/sgpgme.h | 0 src/plugins/pgpmime/Makefile.am | 15 +-- src/plugins/pgpmime/pgpmime.c | 8 +- src/plugins/pgpmime/pgpmime.deps | 1 + src/plugins/pgpmime/plugin.c | 6 - 21 files changed, 282 insertions(+), 38 deletions(-) create mode 100644 src/plugins/pgpcore/Makefile.am rename src/plugins/{pgpmime => pgpcore}/passphrase.c (100%) rename src/plugins/{pgpmime => pgpcore}/passphrase.h (100%) create mode 100644 src/plugins/pgpcore/plugin.c rename src/plugins/{pgpmime => pgpcore}/prefs_gpg.c (100%) rename src/plugins/{pgpmime => pgpcore}/prefs_gpg.h (100%) rename src/plugins/{pgpmime => pgpcore}/select-keys.c (100%) rename src/plugins/{pgpmime => pgpcore}/select-keys.h (100%) rename src/plugins/{pgpmime => pgpcore}/sgpgme.c (100%) rename src/plugins/{pgpmime => pgpcore}/sgpgme.h (100%) create mode 100644 src/plugins/pgpmime/pgpmime.deps diff --git a/ChangeLog-gtk2.claws b/ChangeLog-gtk2.claws index f4eddc830..f1dc062bd 100644 --- a/ChangeLog-gtk2.claws +++ b/ChangeLog-gtk2.claws @@ -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 diff --git a/PATCHSETS b/PATCHSETS index 9432e4367..61b18168e 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -643,3 +643,4 @@ ( 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 diff --git a/configure.ac b/configure.ac index 2e5ad9307..b88928706 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 7984eb06f..515d469d1 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -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) \ diff --git a/src/common/plugin.c b/src/common/plugin.c index 10cb9d4c9..da25e5c68 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -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); } diff --git a/src/common/plugin.h b/src/common/plugin.h index eb3606dd9..35db8d27a 100644 --- a/src/common/plugin.h +++ b/src/common/plugin.h @@ -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); diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index 433c99277..532e9fecf 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -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 index 000000000..832bef190 --- /dev/null +++ b/src/plugins/pgpcore/Makefile.am @@ -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/pgpmime/passphrase.c b/src/plugins/pgpcore/passphrase.c similarity index 100% rename from src/plugins/pgpmime/passphrase.c rename to src/plugins/pgpcore/passphrase.c diff --git a/src/plugins/pgpmime/passphrase.h b/src/plugins/pgpcore/passphrase.h similarity index 100% rename from src/plugins/pgpmime/passphrase.h rename to src/plugins/pgpcore/passphrase.h diff --git a/src/plugins/pgpcore/plugin.c b/src/plugins/pgpcore/plugin.c new file mode 100644 index 000000000..7062cabc9 --- /dev/null +++ b/src/plugins/pgpcore/plugin.c @@ -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 +#include +#include + +#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 \n"); +} + +const gchar *plugin_type(void) +{ + return "GTK2"; +} diff --git a/src/plugins/pgpmime/prefs_gpg.c b/src/plugins/pgpcore/prefs_gpg.c similarity index 100% rename from src/plugins/pgpmime/prefs_gpg.c rename to src/plugins/pgpcore/prefs_gpg.c diff --git a/src/plugins/pgpmime/prefs_gpg.h b/src/plugins/pgpcore/prefs_gpg.h similarity index 100% rename from src/plugins/pgpmime/prefs_gpg.h rename to src/plugins/pgpcore/prefs_gpg.h diff --git a/src/plugins/pgpmime/select-keys.c b/src/plugins/pgpcore/select-keys.c similarity index 100% rename from src/plugins/pgpmime/select-keys.c rename to src/plugins/pgpcore/select-keys.c diff --git a/src/plugins/pgpmime/select-keys.h b/src/plugins/pgpcore/select-keys.h similarity index 100% rename from src/plugins/pgpmime/select-keys.h rename to src/plugins/pgpcore/select-keys.h diff --git a/src/plugins/pgpmime/sgpgme.c b/src/plugins/pgpcore/sgpgme.c similarity index 100% rename from src/plugins/pgpmime/sgpgme.c rename to src/plugins/pgpcore/sgpgme.c diff --git a/src/plugins/pgpmime/sgpgme.h b/src/plugins/pgpcore/sgpgme.h similarity index 100% rename from src/plugins/pgpmime/sgpgme.h rename to src/plugins/pgpcore/sgpgme.h diff --git a/src/plugins/pgpmime/Makefile.am b/src/plugins/pgpmime/Makefile.am index f22781711..a5cffef19 100644 --- a/src/plugins/pgpmime/Makefile.am +++ b/src/plugins/pgpmime/Makefile.am @@ -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 diff --git a/src/plugins/pgpmime/pgpmime.c b/src/plugins/pgpmime/pgpmime.c index a48a0c6cb..50c3e963f 100644 --- a/src/plugins/pgpmime/pgpmime.c +++ b/src/plugins/pgpmime/pgpmime.c @@ -31,11 +31,13 @@ #include "utils.h" #include "privacy.h" #include "procmime.h" + #include "pgpmime.h" -#include "sgpgme.h" +#include +#include +#include + #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 index 000000000..222cb5d99 --- /dev/null +++ b/src/plugins/pgpmime/pgpmime.deps @@ -0,0 +1 @@ +pgpcore diff --git a/src/plugins/pgpmime/plugin.c b/src/plugins/pgpmime/plugin.c index 06c4f1231..d7bb76122 100644 --- a/src/plugins/pgpmime/plugin.c +++ b/src/plugins/pgpmime/plugin.c @@ -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) -- 2.25.1