From 2d38e49d6db5472651bbd8692b7ecb99a3b67459 Mon Sep 17 00:00:00 2001 From: Andrew Savchenko Date: Sun, 19 Aug 2018 22:06:28 +0300 Subject: mail-client/sylpheed: add TOFU support 1. Add GPG TOFU support. 2. Update gpgme version check. 3. Enhance signature status information. Upstream feature request: http://sylpheed.sraoss.jp/redmine/issues/304 --- mail-client/sylpheed/Manifest | 1 + mail-client/sylpheed/files/sylpheed-tofu.patch | 184 +++++++++++++++++++++++++ mail-client/sylpheed/metadata.xml | 15 ++ mail-client/sylpheed/sylpheed-3.7.0-r1.ebuild | 67 +++++++++ profiles/categories | 1 + 5 files changed, 268 insertions(+) create mode 100644 mail-client/sylpheed/Manifest create mode 100644 mail-client/sylpheed/files/sylpheed-tofu.patch create mode 100644 mail-client/sylpheed/metadata.xml create mode 100644 mail-client/sylpheed/sylpheed-3.7.0-r1.ebuild diff --git a/mail-client/sylpheed/Manifest b/mail-client/sylpheed/Manifest new file mode 100644 index 0000000..8bcca88 --- /dev/null +++ b/mail-client/sylpheed/Manifest @@ -0,0 +1 @@ +DIST sylpheed-3.7.0.tar.bz2 3612328 BLAKE2B bd8182db8a46b956e12b3da4b15d3ee8184a612e2fb216aca20fd4a022610b17416f994d36b390a5a92835915e95f08bd59bf71154a86962c9564162be891f21 SHA512 490837528bf7ba9d26994cd5fff00b6e5390a127419b9d0efd9fc25c38be1291d55c5b8daebdf5ca9d9159a51c938449e76212328f3eae40cc039db88cb5caa4 diff --git a/mail-client/sylpheed/files/sylpheed-tofu.patch b/mail-client/sylpheed/files/sylpheed-tofu.patch new file mode 100644 index 0000000..b9d758f --- /dev/null +++ b/mail-client/sylpheed/files/sylpheed-tofu.patch @@ -0,0 +1,184 @@ +diff -Naurd -x '*.swp' sylpheed-3.7.0.orig/INSTALL sylpheed-3.7.0/INSTALL +--- sylpheed-3.7.0.orig/INSTALL 2017-06-28 11:38:36.000000000 +0300 ++++ sylpheed-3.7.0/INSTALL 2018-08-11 21:26:14.701733236 +0300 +@@ -137,7 +137,7 @@ + + http://freshmeat.net/projects/compface/ + +-GnuPG (>= 1.2.0) and GPGME (>= 1.0.0) are required for GnuPG (PGP) support. ++GnuPG (>= 1.2.0) and GPGME (>= 1.7.0) are required for GnuPG (PGP) support. + You can get GnuPG and GPGME from the following location: + + ftp://ftp.gnupg.org/gcrypt/gpgme/ +diff -Naurd -x '*.swp' sylpheed-3.7.0.orig/INSTALL.ja sylpheed-3.7.0/INSTALL.ja +--- sylpheed-3.7.0.orig/INSTALL.ja 2017-06-28 11:38:43.000000000 +0300 ++++ sylpheed-3.7.0/INSTALL.ja 2018-08-11 21:26:25.734570136 +0300 +@@ -137,7 +137,7 @@ + + http://freshmeat.net/projects/compface/ + +-GnuPG (PGP)対応を有効にしたい場合は、 GPGME 1.0.0 以降と GnuPG 1.2.0 以降が ++GnuPG (PGP)対応を有効にしたい場合は、 GPGME 1.7.0 以降と GnuPG 1.2.0 以降が + 必要です。 GnuPG と GPGME は以下の場所から取得できます: + + ftp://ftp.gnupg.org/gcrypt/gpgme/ +diff -Naurd -x '*.swp' sylpheed-3.7.0.orig/configure.ac sylpheed-3.7.0/configure.ac +--- sylpheed-3.7.0.orig/configure.ac 2018-01-30 11:49:52.000000000 +0300 ++++ sylpheed-3.7.0/configure.ac 2018-08-11 20:36:02.043543279 +0300 +@@ -179,7 +179,7 @@ + AC_MSG_CHECKING([whether to use GPGME]) + if test $ac_cv_enable_gpgme = yes; then + AC_MSG_RESULT(yes) +- AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.), ++ AM_PATH_GPGME(1.7.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.), + [use_gpgme=no + ac_cv_enable_gpgme=no]) + if test $ac_cv_enable_gpgme = yes; then +diff -Naurd -x '*.swp' sylpheed-3.7.0.orig/src/rfc2015.c sylpheed-3.7.0/src/rfc2015.c +--- sylpheed-3.7.0.orig/src/rfc2015.c 2014-03-26 09:55:35.000000000 +0400 ++++ sylpheed-3.7.0/src/rfc2015.c 2018-08-19 08:59:42.143390253 +0300 +@@ -157,6 +157,12 @@ + (str, _(" aka \"%s\"\n"), user->uid); + user = user->next; + } ++ ++ /* gpgme_get_key doesn't set tofu description field even with ++ * GPGME_KEYLIST_MODE_WITH_TOFU flag set, so it should be ++ * extracted from sig->key directly */ ++ if (sig->key && sig->key->uids && sig->key->uids->tofu) ++ gpgmegtk_tofu_status_to_string (str, sig->key->uids); + } + + static gchar *sig_status_full(gpgme_ctx_t ctx, gpgme_verify_result_t result) +diff -Naurd -x '*.swp' sylpheed-3.7.0.orig/src/sigstatus.c sylpheed-3.7.0/src/sigstatus.c +--- sylpheed-3.7.0.orig/src/sigstatus.c 2010-12-21 11:53:18.000000000 +0300 ++++ sylpheed-3.7.0/src/sigstatus.c 2018-08-19 10:58:18.915063156 +0300 +@@ -238,9 +238,15 @@ + case GPG_ERR_NO_ERROR: + switch (signature->validity) { + case GPGME_VALIDITY_ULTIMATE: ++ result = use_name ? _("Good signature (ultimate trust) from \"%s\"") : ++ _("Good signature"); ++ break; + case GPGME_VALIDITY_FULL: ++ result = use_name ? _("Good signature (full trust) from \"%s\"") : ++ _("Good signature"); ++ break; + case GPGME_VALIDITY_MARGINAL: +- result = use_name ? _("Good signature from \"%s\"") : ++ result = use_name ? _("Good signature (marginal trust) from \"%s\"") : + _("Good signature"); + break; + default: +@@ -270,11 +276,100 @@ + result = _("No public key to verify the signature"); + break; + default: +- result = _("Error verifying the signature"); ++ switch (signature->summary) { ++ case GPGME_SIGSUM_KEY_REVOKED: ++ result = _("The key or at least one certificate has been revoked"); ++ break; ++ case GPGME_SIGSUM_KEY_MISSING: ++ result = _("Can't verify due to a missing key or certificate"); ++ break; ++ case GPGME_SIGSUM_CRL_MISSING: ++ result = _("The CRL (or an equivalent mechanism) is not available"); ++ break; ++ case GPGME_SIGSUM_CRL_TOO_OLD: ++ result = _("Available CRL is too old"); ++ break; ++ case GPGME_SIGSUM_BAD_POLICY: ++ result = _("A policy requirement was not met"); ++ break; ++ case GPGME_SIGSUM_SYS_ERROR: ++ result = _("A system error occured"); ++ break; ++ case GPGME_SIGSUM_TOFU_CONFLICT: ++ result = _("A TOFU conflict was detected"); ++ break; ++ default: ++ result = _("Error verifying the signature"); ++ } + break; + } + + return result; + } + ++void tofu_to_string(GString *str, gpgme_tofu_info_t tofu, char *uid) ++{ ++ if (tofu->description) ++ g_string_sprintfa(str, _("%s\n"), tofu->description); ++ else ++ g_string_sprintfa(str, _("%s:\n"), uid); ++ ++ switch (tofu->validity) { ++ case 0: ++ g_string_append(str, _(" Validity [0]: CONFLICT. ")); ++ break; ++ case 1: ++ g_string_append(str, _(" Validity [1]: no prior history. ")); ++ break; ++ case 2: ++ g_string_append(str, _(" Validity [2]: too little history. ")); ++ break; ++ case 3: ++ g_string_append(str, _(" Validity [3]: enough history for basic trust. ")); ++ break; ++ case 4: ++ g_string_append(str, _(" Validity [4]: long established history. ")); ++ break; ++ default: ++ g_string_append(str, _(" Validity: unknown. ")); ++ break; ++ } ++ ++ switch (tofu->policy) { ++ case GPGME_TOFU_POLICY_AUTO: ++ g_string_append(str, _("Policy: auto.\n")); ++ break; ++ case GPGME_TOFU_POLICY_GOOD: ++ g_string_append(str, _("Policy: good.\n")); ++ break; ++ case GPGME_TOFU_POLICY_BAD: ++ g_string_append(str, _("Policy: bad.\n")); ++ break; ++ case GPGME_TOFU_POLICY_ASK: ++ g_string_append(str, _("Policy: ask.\n")); ++ break; ++ default: ++ g_string_append(str, _("Policy: unknown.\n")); ++ break; ++ } ++} ++ ++void gpgmegtk_tofu_status_to_string(GString *str, gpgme_user_id_t user) ++{ ++ gpgme_tofu_info_t tofu; ++ g_string_append(str, _("TOFU status:\n")); ++ ++ do { ++ if (!(tofu = user->tofu)) ++ continue; ++ tofu_to_string (str, tofu, user->uid); ++ ++ while ((tofu = tofu->next)) { ++ g_string_append(str, _("and:\n")); ++ tofu_to_string (str, tofu, user->uid); ++ } ++ } ++ while ((user = user->next)); ++} ++ + #endif /* USE_GPGME */ +diff -Naurd -x '*.swp' sylpheed-3.7.0.orig/src/sigstatus.h sylpheed-3.7.0/src/sigstatus.h +--- sylpheed-3.7.0.orig/src/sigstatus.h 2006-08-31 12:21:21.000000000 +0400 ++++ sylpheed-3.7.0/src/sigstatus.h 2018-08-19 07:45:17.422291629 +0300 +@@ -30,5 +30,6 @@ + + const gchar *gpgmegtk_sig_status_to_string(gpgme_signature_t signature, + gboolean use_name); ++void gpgmegtk_tofu_status_to_string(GString *str, gpgme_user_id_t user); + + #endif /* GPGMEGTK_SIGSTATUS_H */ diff --git a/mail-client/sylpheed/metadata.xml b/mail-client/sylpheed/metadata.xml new file mode 100644 index 0000000..ee28f29 --- /dev/null +++ b/mail-client/sylpheed/metadata.xml @@ -0,0 +1,15 @@ + + + + + hattya@gentoo.org + Akinori Hattori + + + net-mail@gentoo.org + Net-Mail + + + Use dev-libs/oniguruma for regular expression + + diff --git a/mail-client/sylpheed/sylpheed-3.7.0-r1.ebuild b/mail-client/sylpheed/sylpheed-3.7.0-r1.ebuild new file mode 100644 index 0000000..9d6e961 --- /dev/null +++ b/mail-client/sylpheed/sylpheed-3.7.0-r1.ebuild @@ -0,0 +1,67 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" + +DESCRIPTION="A lightweight email client and newsreader" +HOMEPAGE="http://sylpheed.sraoss.jp/" +SRC_URI="http://${PN}.sraoss.jp/${PN}/v${PV%.*}/${P}.tar.bz2" + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" +IUSE="crypt ipv6 ldap libressl nls oniguruma pda spell ssl xface" + +CDEPEND="net-libs/liblockfile + x11-libs/gtk+:2 + crypt? ( app-crypt/gpgme ) + ldap? ( net-nds/openldap ) + nls? ( sys-devel/gettext ) + oniguruma? ( dev-libs/oniguruma:= ) + pda? ( app-pda/jpilot ) + spell? ( + app-text/gtkspell:2 + dev-libs/dbus-glib + ) + ssl? ( + !libressl? ( dev-libs/openssl:0 ) + libressl? ( dev-libs/libressl ) + )" +RDEPEND="${CDEPEND} + app-misc/mime-types + net-misc/curl" +BDEPEND="virtual/pkgconfig" +DEPEND="${CDEPEND} + xface? ( media-libs/compface )" + +DOCS="AUTHORS ChangeLog* NEW* PLUGIN* README* TODO*" +PATCHES=( "${FILESDIR}/${PN}-tofu.patch" ) + +src_configure() { + local htmldir="${EPREFIX}"/usr/share/doc/${PF}/html + econf \ + $(use_enable crypt gpgme) \ + $(use_enable ipv6) \ + $(use_enable ldap) \ + $(use_enable oniguruma) \ + $(use_enable pda jpilot) \ + $(use_enable spell gtkspell) \ + $(use_enable ssl) \ + $(use_enable xface compface) \ + --with-plugindir="${EPREFIX}"/usr/$(get_libdir)/${PN}/plugins \ + --with-manualdir="${htmldir}"/manual \ + --with-faqdir="${htmldir}"/faq \ + --disable-updatecheck +} + +src_install() { + default + + doicon *.png + domenu *.desktop + + cd plugin/attachment_tool + emake DESTDIR="${D}" install-plugin + docinto plugin/attachment_tool + dodoc README +} diff --git a/profiles/categories b/profiles/categories index 97f96c4..21e2eb6 100644 --- a/profiles/categories +++ b/profiles/categories @@ -6,6 +6,7 @@ app-vim dev-libs dev-python dev-util +mail-client media-gfx media-libs media-video -- cgit v1.2.3-65-gdbad