summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2009-06-28 10:44:22 +0000
committerFabian Groffen <grobian@gentoo.org>2009-06-28 10:44:22 +0000
commit85863e868906039ab86efe6213f4f4dd4fc6970c (patch)
tree0cb51391d34d40f732979353445c5f3e6aff3173 /mail-client/mutt
parentRemove old versions. (diff)
downloadgentoo-2-85863e868906039ab86efe6213f4f4dd4fc6970c.tar.gz
gentoo-2-85863e868906039ab86efe6213f4f4dd4fc6970c.tar.bz2
gentoo-2-85863e868906039ab86efe6213f4f4dd4fc6970c.zip
Version bump to 1.5.20, with a bunch of post release regression fixes from upstream. The pgp_timeout patch has been dropped for this release, since it no longer applies.
(Portage version: 2.2.00.13629-prefix/cvs/Darwin powerpc)
Diffstat (limited to 'mail-client/mutt')
-rw-r--r--mail-client/mutt/ChangeLog20
-rw-r--r--mail-client/mutt/files/mutt-1.5.13-prefix-mailcap.patch22
-rw-r--r--mail-client/mutt/files/mutt-1.5.18-bdb-prefix.patch23
-rw-r--r--mail-client/mutt/files/mutt-1.5.18-interix.patch22
-rw-r--r--mail-client/mutt/files/mutt-1.5.18-solaris-ncurses-chars.patch75
-rw-r--r--mail-client/mutt/files/mutt-1.5.20-display-unsigned-pgp-7f37d0a57d83.patch45
-rw-r--r--mail-client/mutt/files/mutt-1.5.20-header-weeding-f40de578e8ed.patch15
-rw-r--r--mail-client/mutt/files/mutt-1.5.20-imap-port-invalid-d6f88fbf8387.patch20
-rw-r--r--mail-client/mutt/files/mutt-1.5.20-mbox-new-mail-bd59be56c6b0.patch89
-rw-r--r--mail-client/mutt/files/mutt-1.5.20-mbox-unchanged-new-mail-9ae13dedb5ed.patch44
-rw-r--r--mail-client/mutt/files/mutt-1.5.20-unmailbox-segfault-25e46aad362b.patch15
-rw-r--r--mail-client/mutt/mutt-1.5.20.ebuild223
12 files changed, 611 insertions, 2 deletions
diff --git a/mail-client/mutt/ChangeLog b/mail-client/mutt/ChangeLog
index e9431b428071..6f1128ce1fa3 100644
--- a/mail-client/mutt/ChangeLog
+++ b/mail-client/mutt/ChangeLog
@@ -1,6 +1,22 @@
# ChangeLog for mail-client/mutt
-# Copyright 2002-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/mail-client/mutt/ChangeLog,v 1.134 2009/06/20 10:34:58 grobian Exp $
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/mail-client/mutt/ChangeLog,v 1.135 2009/06/28 10:44:22 grobian Exp $
+
+*mutt-1.5.20 (28 Jun 2009)
+
+ 28 Jun 2009; Fabian Groffen <grobian@gentoo.org>
+ +files/mutt-1.5.13-prefix-mailcap.patch,
+ +files/mutt-1.5.18-bdb-prefix.patch, +files/mutt-1.5.18-interix.patch,
+ +files/mutt-1.5.18-solaris-ncurses-chars.patch, +mutt-1.5.20.ebuild,
+ +files/mutt-1.5.20-display-unsigned-pgp-7f37d0a57d83.patch,
+ +files/mutt-1.5.20-header-weeding-f40de578e8ed.patch,
+ +files/mutt-1.5.20-imap-port-invalid-d6f88fbf8387.patch,
+ +files/mutt-1.5.20-mbox-new-mail-bd59be56c6b0.patch,
+ +files/mutt-1.5.20-mbox-unchanged-new-mail-9ae13dedb5ed.patch,
+ +files/mutt-1.5.20-unmailbox-segfault-25e46aad362b.patch:
+ Version bump to 1.5.20, with a bunch of post release regression fixes from
+ upstream. The pgp_timeout patch has been dropped for this release, since
+ it no longer applies.
20 Jun 2009; Fabian Groffen <grobian@gentoo.org> -mutt-1.5.13-r2.ebuild,
-mutt-1.5.14.ebuild:
diff --git a/mail-client/mutt/files/mutt-1.5.13-prefix-mailcap.patch b/mail-client/mutt/files/mutt-1.5.13-prefix-mailcap.patch
new file mode 100644
index 000000000000..9a5a67b52f6c
--- /dev/null
+++ b/mail-client/mutt/files/mutt-1.5.13-prefix-mailcap.patch
@@ -0,0 +1,22 @@
+--- Makefile.am
++++ Makefile.am
+@@ -51,7 +51,7 @@
+
+ DEFS=-DPKGDATADIR=\"$(pkgdatadir)\" -DSYSCONFDIR=\"$(sysconfdir)\" \
+ -DBINDIR=\"$(bindir)\" -DMUTTLOCALEDIR=\"$(datadir)/locale\" \
+- -DHAVE_CONFIG_H=1
++ -DHAVE_CONFIG_H=1 -DPREFIX=\"$(prefix)/..\"
+
+ AM_CPPFLAGS=-I. -I$(top_srcdir) $(IMAP_INCLUDES) $(LIBGPGME_CFLAGS) -Iintl
+
+--- init.c
++++ init.c
+@@ -2862,7 +2862,7 @@
+ else
+ {
+ /* Default search path from RFC1524 */
+- MailcapPath = safe_strdup ("~/.mailcap:" PKGDATADIR "/mailcap:" SYSCONFDIR "/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap");
++ MailcapPath = safe_strdup ("~/.mailcap:" PKGDATADIR "/mailcap:" SYSCONFDIR "/mailcap:" PREFIX "/etc/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap");
+ }
+
+ Tempdir = safe_strdup ((p = getenv ("TMPDIR")) ? p : "/tmp");
diff --git a/mail-client/mutt/files/mutt-1.5.18-bdb-prefix.patch b/mail-client/mutt/files/mutt-1.5.18-bdb-prefix.patch
new file mode 100644
index 000000000000..bb978ea24dd9
--- /dev/null
+++ b/mail-client/mutt/files/mutt-1.5.18-bdb-prefix.patch
@@ -0,0 +1,23 @@
+* berkely db check is completely broken, but mess with it just enough
+ such that it works for Gentoo Prefix
+
+--- configure.ac
++++ configure.ac
+@@ -891,7 +891,7 @@
+ then
+ if test x$ac_bdb_prefix = xyes || test x$ac_bdb_prefix = x
+ then
+- ac_bdb_prefix="$mutt_cv_prefix /opt/csw/bdb4 /opt /usr/local /usr"
++ ac_bdb_prefix="$mutt_cv_prefix"
+ fi
+ for d in $ac_bdb_prefix; do
+ bdbpfx="$bdbpfx $d"
+@@ -899,7 +899,7 @@
+ bdbpfx="$bdbpfx $d/$v"
+ done
+ done
+- BDB_VERSIONS="db-4 db4 db-4.6 db4.6 db46 db-4.5 db4.5 db45 db-4.4 db4.4 db44 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db ''"
++ BDB_VERSIONS="db db-4 db4 db-4.6 db4.6 db46 db-4.5 db4.5 db45 db-4.4 db4.4 db44 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 ''"
+ AC_MSG_CHECKING([for BerkeleyDB > 4.0])
+ for d in $bdbpfx; do
+ BDB_INCLUDE_DIR=""
diff --git a/mail-client/mutt/files/mutt-1.5.18-interix.patch b/mail-client/mutt/files/mutt-1.5.18-interix.patch
new file mode 100644
index 000000000000..4cbb21731353
--- /dev/null
+++ b/mail-client/mutt/files/mutt-1.5.18-interix.patch
@@ -0,0 +1,22 @@
+* Interix doesn't have btowc, but it does have mbtowc. Linux manpage
+ also discourages the use of btowc.
+
+--- regex.c
++++ regex.c
+@@ -2212,6 +2212,7 @@
+ boolean is_lower = STREQ (str, "lower");
+ boolean is_upper = STREQ (str, "upper");
+ wctype_t wt;
++ wchar_t twt;
+ int ch;
+
+ wt = wctype (str);
+@@ -2226,7 +2227,7 @@
+
+ for (ch = 0; ch < 1 << BYTEWIDTH; ++ch)
+ {
+- if (iswctype (btowc (ch), wt))
++ if (mbtowc (&twt, (char *)&ch, 1) >= 0 && iswctype (twt, wt))
+ SET_LIST_BIT (ch);
+
+ if (translate && (is_upper || is_lower)
diff --git a/mail-client/mutt/files/mutt-1.5.18-solaris-ncurses-chars.patch b/mail-client/mutt/files/mutt-1.5.18-solaris-ncurses-chars.patch
new file mode 100644
index 000000000000..41761b7bc310
--- /dev/null
+++ b/mail-client/mutt/files/mutt-1.5.18-solaris-ncurses-chars.patch
@@ -0,0 +1,75 @@
+--- menu.c
++++ menu.c
+@@ -58,7 +58,7 @@
+ if (option (OPTASCIICHARS))
+ addch ('`');
+ else if (Charset_is_utf8)
+- addstr ("\342\224\224"); /* WACS_LLCORNER */
++ add_wch (WACS_LLCORNER);
+ else
+ addch (ACS_LLCORNER);
+ break;
+@@ -66,7 +66,7 @@
+ if (option (OPTASCIICHARS))
+ addch (',');
+ else if (Charset_is_utf8)
+- addstr ("\342\224\214"); /* WACS_ULCORNER */
++ add_wch (WACS_ULCORNER);
+ else
+ addch (ACS_ULCORNER);
+ break;
+@@ -74,7 +74,7 @@
+ if (option (OPTASCIICHARS))
+ addch ('|');
+ else if (Charset_is_utf8)
+- addstr ("\342\224\234"); /* WACS_LTEE */
++ add_wch (WACS_LTEE);
+ else
+ addch (ACS_LTEE);
+ break;
+@@ -82,7 +82,7 @@
+ if (option (OPTASCIICHARS))
+ addch ('-');
+ else if (Charset_is_utf8)
+- addstr ("\342\224\200"); /* WACS_HLINE */
++ add_wch (WACS_HLINE);
+ else
+ addch (ACS_HLINE);
+ break;
+@@ -90,7 +90,7 @@
+ if (option (OPTASCIICHARS))
+ addch ('|');
+ else if (Charset_is_utf8)
+- addstr ("\342\224\202"); /* WACS_VLINE */
++ add_wch (WACS_VLINE);
+ else
+ addch (ACS_VLINE);
+ break;
+@@ -98,7 +98,7 @@
+ if (option (OPTASCIICHARS))
+ addch ('-');
+ else if (Charset_is_utf8)
+- addstr ("\342\224\254"); /* WACS_TTEE */
++ add_wch (WACS_TTEE);
+ else
+ addch (ACS_TTEE);
+ break;
+@@ -106,7 +106,7 @@
+ if (option (OPTASCIICHARS))
+ addch ('-');
+ else if (Charset_is_utf8)
+- addstr ("\342\224\264"); /* WACS_BTEE */
++ add_wch (WACS_BTEE);
+ else
+ addch (ACS_BTEE);
+ break;
+--- mutt_curses.h
++++ mutt_curses.h
+@@ -43,6 +43,7 @@
+ #else /* USE_SLANG_CURSES */
+
+ #if HAVE_NCURSESW_NCURSES_H
++# define _XOPEN_SOURCE_EXTENDED
+ # include <ncursesw/ncurses.h>
+ #elif HAVE_NCURSES_NCURSES_H
+ # include <ncurses/ncurses.h>
diff --git a/mail-client/mutt/files/mutt-1.5.20-display-unsigned-pgp-7f37d0a57d83.patch b/mail-client/mutt/files/mutt-1.5.20-display-unsigned-pgp-7f37d0a57d83.patch
new file mode 100644
index 000000000000..4e32011591de
--- /dev/null
+++ b/mail-client/mutt/files/mutt-1.5.20-display-unsigned-pgp-7f37d0a57d83.patch
@@ -0,0 +1,45 @@
+http://dev.mutt.org/trac/changeset/5908%3A7f37d0a57d83?format=diff&new=5908:7f37d0a57d83
+
+Display unsigned part of traditional PGP messages.
+Unbreaks [e2780a423d96], closes #3269
+
+Index: crypt-gpgme.c
+===================================================================
+--- crypt-gpgme.c (revision 5801:19e62bd1549b)
++++ crypt-gpgme.c (revision 5908:7f37d0a57d83)
+@@ -2372,8 +2372,7 @@
+ }
+ }
+-#if 0
+ else
+ {
+- /* why would we want to display this at all? */
++ /* A traditional PGP part may mix signed and unsigned content */
+ /* XXX - we may wish to recode here */
+ if (s->prefix)
+@@ -2381,5 +2380,4 @@
+ state_puts (buf, s);
+ }
+-#endif
+ }
+
+Index: pgp.c
+===================================================================
+--- pgp.c (revision 5827:776ef9dbe4d2)
++++ pgp.c (revision 5908:7f37d0a57d83)
+@@ -483,8 +483,7 @@
+ }
+ }
+-#if 0
+ else
+ {
+- /* why would we want to display this at all? */
++ /* A traditional PGP part may mix signed and unsigned content */
+ /* XXX - we may wish to recode here */
+ if (s->prefix)
+@@ -492,5 +491,4 @@
+ state_puts (buf, s);
+ }
+-#endif
+ }
+
diff --git a/mail-client/mutt/files/mutt-1.5.20-header-weeding-f40de578e8ed.patch b/mail-client/mutt/files/mutt-1.5.20-header-weeding-f40de578e8ed.patch
new file mode 100644
index 000000000000..710601f0080b
--- /dev/null
+++ b/mail-client/mutt/files/mutt-1.5.20-header-weeding-f40de578e8ed.patch
@@ -0,0 +1,15 @@
+http://dev.mutt.org/trac/changeset/5904%3Af40de578e8ed
+
+Unbreak header weeding for message/rfc822 parts. Closes #3265.
+
+Index: handler.c
+===================================================================
+--- handler.c (revision 5882:536771b4e085)
++++ handler.c (revision 5904:f40de578e8ed)
+@@ -1091,5 +1091,5 @@
+ (((s->flags & M_WEED) || ((s->flags & (M_DISPLAY|M_PRINTING)) && option (OPTWEED))) ? (CH_WEED | CH_REORDER) : 0) |
+ (s->prefix ? CH_PREFIX : 0) | CH_DECODE | CH_FROM |
+- (s->flags & M_DISPLAY) ? CH_DISPLAY : 0, s->prefix);
++ ((s->flags & M_DISPLAY) ? CH_DISPLAY : 0), s->prefix);
+
+ if (s->prefix)
diff --git a/mail-client/mutt/files/mutt-1.5.20-imap-port-invalid-d6f88fbf8387.patch b/mail-client/mutt/files/mutt-1.5.20-imap-port-invalid-d6f88fbf8387.patch
new file mode 100644
index 000000000000..19ae6885f177
--- /dev/null
+++ b/mail-client/mutt/files/mutt-1.5.20-imap-port-invalid-d6f88fbf8387.patch
@@ -0,0 +1,20 @@
+http://dev.mutt.org/trac/changeset/5899%3Ad6f88fbf8387
+
+Don't parse URL port as signed short, but to int and cast to unsigned
+short. Closes #3264.
+
+Index: url.c
+===================================================================
+--- url.c (revision 5845:0698e8195545)
++++ url.c (revision 5899:d6f88fbf8387)
+@@ -144,7 +144,9 @@
+ if ((p = strchr (t, ':')))
+ {
++ int t;
+ *p++ = '\0';
+- if (mutt_atos (p, (short*) &ciss->port) < 0)
++ if (mutt_atoi (p, &t) < 0 || t < 0 || t > 0xffff)
+ return NULL;
++ ciss->port = (unsigned short)t;
+ }
+ else
diff --git a/mail-client/mutt/files/mutt-1.5.20-mbox-new-mail-bd59be56c6b0.patch b/mail-client/mutt/files/mutt-1.5.20-mbox-new-mail-bd59be56c6b0.patch
new file mode 100644
index 000000000000..b06c506fe85e
--- /dev/null
+++ b/mail-client/mutt/files/mutt-1.5.20-mbox-new-mail-bd59be56c6b0.patch
@@ -0,0 +1,89 @@
+http://dev.mutt.org/trac/changeset/bd59be56c6b0
+
+Don't mangle atime/mtime for mbox folders without new mail upon sync.
+Closes #1362, #3271.
+
+Index: mbox.c
+===================================================================
+--- mbox.c (revision 5916:508bfe4a2e23)
++++ mbox.c (revision 5921:bd59be56c6b0)
+@@ -682,20 +682,28 @@
+ /* if mailbox has at least 1 new message, sets mtime > atime of mailbox
+ * so buffy check reports new mail */
+-static void reset_atime (CONTEXT *ctx)
++static void reset_atime (CONTEXT *ctx, struct stat *st)
+ {
+ struct utimbuf utimebuf;
+- int i;
+- time_t now = time (NULL);
+-
+- for (i = 0; i < ctx->msgcount; i++)
+- {
++ int i, found = 0;
++ struct stat _st;
++
++ if (!st)
++ {
++ if (stat (ctx->path, &_st) < 0)
++ return;
++ st = &_st;
++ }
++
++ utimebuf.actime = st->st_atime;
++ utimebuf.modtime = st->st_mtime;
++
++ for (i = 0; !found && i < ctx->msgcount; i++)
+ if (!ctx->hdrs[i]->deleted && !ctx->hdrs[i]->read && !ctx->hdrs[i]->old)
+- {
+- utimebuf.actime = now - 1;
+- utimebuf.modtime = now;
+- utime (ctx->path, &utimebuf);
+- return;
+- }
+- }
++ found = 1;
++
++ if (found && utimebuf.actime >= utimebuf.modtime)
++ utimebuf.actime = utimebuf.modtime - 1;
++
++ utime (ctx->path, &utimebuf);
+ }
+
+@@ -713,4 +721,5 @@
+ int first = -1; /* first message to be written */
+ LOFF_T offset; /* location in mailbox to write changed messages */
++ struct stat statbuf;
+ struct m_update_t *newOffset = NULL;
+ struct m_update_t *oldOffset = NULL;
+@@ -904,4 +913,13 @@
+ fp = NULL;
+
++ /* Save the state of this folder. */
++ if (stat (ctx->path, &statbuf) == -1)
++ {
++ mutt_perror (ctx->path);
++ mutt_sleep (5);
++ unlink (tempfile);
++ goto bail;
++ }
++
+ if ((fp = fopen (tempfile, "r")) == NULL)
+ {
+@@ -973,4 +991,7 @@
+ }
+
++ /* Restore the previous access/modification times */
++ reset_atime (ctx, &statbuf);
++
+ /* reopen the mailbox in read-only mode */
+ if ((ctx->fp = fopen (ctx->path, "r")) == NULL)
+@@ -998,9 +1019,4 @@
+ unlink (tempfile); /* remove partial copy of the mailbox */
+ mutt_unblock_signals ();
+-
+- /* if mailbox has new mail, mangle atime+mtime to make buffy check
+- * report new mail for it */
+- if (!option (OPTCHECKMBOXSIZE))
+- reset_atime (ctx);
+
+ return (0); /* signal success */
diff --git a/mail-client/mutt/files/mutt-1.5.20-mbox-unchanged-new-mail-9ae13dedb5ed.patch b/mail-client/mutt/files/mutt-1.5.20-mbox-unchanged-new-mail-9ae13dedb5ed.patch
new file mode 100644
index 000000000000..ca2b04699884
--- /dev/null
+++ b/mail-client/mutt/files/mutt-1.5.20-mbox-unchanged-new-mail-9ae13dedb5ed.patch
@@ -0,0 +1,44 @@
+http://dev.mutt.org/trac/changeset/9ae13dedb5ed
+
+Fixup atime for mbox/mmdf also when mailbox is unchanged but has new
+mail. See #1362.
+
+Index: mbox.c
+===================================================================
+--- mbox.c (revision 5921:bd59be56c6b0)
++++ mbox.c (revision 5922:9ae13dedb5ed)
+@@ -682,5 +682,5 @@
+ /* if mailbox has at least 1 new message, sets mtime > atime of mailbox
+ * so buffy check reports new mail */
+-static void reset_atime (CONTEXT *ctx, struct stat *st)
++void mbox_reset_atime (CONTEXT *ctx, struct stat *st)
+ {
+ struct utimbuf utimebuf;
+@@ -992,5 +992,5 @@
+
+ /* Restore the previous access/modification times */
+- reset_atime (ctx, &statbuf);
++ mbox_reset_atime (ctx, &statbuf);
+
+ /* reopen the mailbox in read-only mode */
+Index: mx.c
+===================================================================
+--- mx.c (revision 5907:a2a868fc40ea)
++++ mx.c (revision 5922:9ae13dedb5ed)
+@@ -927,4 +927,6 @@
+ if (!ctx->quiet)
+ mutt_message _("Mailbox is unchanged.");
++ if (ctx->magic == M_MBOX || ctx->magic == M_MMDF)
++ mbox_reset_atime (ctx, NULL);
+ mx_fastclose_mailbox (ctx);
+ return 0;
+Index: mx.h
+===================================================================
+--- mx.h (revision 4343:2bccf51eedac)
++++ mx.h (revision 5922:9ae13dedb5ed)
+@@ -57,4 +57,5 @@
+ void mbox_unlock_mailbox (CONTEXT *);
+ int mbox_check_empty (const char *);
++void mbox_reset_atime (CONTEXT *, struct stat *);
+
+ int mh_read_dir (CONTEXT *, const char *);
diff --git a/mail-client/mutt/files/mutt-1.5.20-unmailbox-segfault-25e46aad362b.patch b/mail-client/mutt/files/mutt-1.5.20-unmailbox-segfault-25e46aad362b.patch
new file mode 100644
index 000000000000..5cc32d69d785
--- /dev/null
+++ b/mail-client/mutt/files/mutt-1.5.20-unmailbox-segfault-25e46aad362b.patch
@@ -0,0 +1,15 @@
+http://dev.mutt.org/trac/changeset/25e46aad362b#file0
+
+Do not free statically-allocated buffy buffer.
+Unbreaks unmailboxes, closes #3273.
+
+Index: buffy.c
+===================================================================
+--- buffy.c (revision 5851:8b2af5b64981)
++++ buffy.c (revision 5914:25e46aad362b)
+@@ -237,5 +237,4 @@
+ if(*tmp)
+ {
+- FREE (&((*tmp)->path));
+ tmp1=(*tmp)->next;
+ FREE (tmp); /* __FREE_CHECKED__ */
diff --git a/mail-client/mutt/mutt-1.5.20.ebuild b/mail-client/mutt/mutt-1.5.20.ebuild
new file mode 100644
index 000000000000..395e6d4eada1
--- /dev/null
+++ b/mail-client/mutt/mutt-1.5.20.ebuild
@@ -0,0 +1,223 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-client/mutt/mutt-1.5.20.ebuild,v 1.1 2009/06/28 10:44:22 grobian Exp $
+
+inherit eutils flag-o-matic autotools
+
+PATCHSET_REV="-r1"
+
+# note: latest sidebar patches can be found here:
+# http://www.lunar-linux.org/index.php?option=com_content&task=view&id=44
+SIDEBAR_PATCH_N="patch-1.5.20.sidebar.20090619.txt"
+
+DESCRIPTION="a small but very powerful text-based mail client"
+HOMEPAGE="http://www.mutt.org"
+SRC_URI="ftp://ftp.mutt.org/mutt/devel/${P}.tar.gz
+ !vanilla? (
+ !sidebar? (
+ mirror://gentoo/${P}-gentoo-patches${PATCHSET_REV}.tar.bz2
+ http://dev.gentoo.org/~grobian/distfiles/${P}-gentoo-patches${PATCHSET_REV}.tar.bz2
+ )
+ )
+ sidebar? (
+ http://www.lunar-linux.org/~tchan/mutt/${SIDEBAR_PATCH_N}
+ )"
+IUSE="berkdb crypt debug gdbm gnutls gpgme idn imap mbox nls nntp pop qdbm sasl
+sidebar smime smtp ssl vanilla"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x64-freebsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+RDEPEND=">=sys-libs/ncurses-5.2
+ qdbm? ( dev-db/qdbm )
+ !qdbm? (
+ gdbm? ( sys-libs/gdbm )
+ !gdbm? ( berkdb? ( >=sys-libs/db-4 ) )
+ )
+ imap? (
+ gnutls? ( >=net-libs/gnutls-1.0.17 )
+ !gnutls? ( ssl? ( >=dev-libs/openssl-0.9.6 ) )
+ sasl? ( >=dev-libs/cyrus-sasl-2 )
+ )
+ pop? (
+ gnutls? ( >=net-libs/gnutls-1.0.17 )
+ !gnutls? ( ssl? ( >=dev-libs/openssl-0.9.6 ) )
+ sasl? ( >=dev-libs/cyrus-sasl-2 )
+ )
+ smtp? (
+ gnutls? ( >=net-libs/gnutls-1.0.17 )
+ !gnutls? ( ssl? ( >=dev-libs/openssl-0.9.6 ) )
+ sasl? ( >=dev-libs/cyrus-sasl-2 )
+ )
+ idn? ( net-dns/libidn )
+ gpgme? ( >=app-crypt/gpgme-0.9.0 )
+ smime? ( >=dev-libs/openssl-0.9.6 )
+ app-misc/mime-types"
+DEPEND="${RDEPEND}
+ net-mail/mailbase
+ !vanilla? (
+ dev-libs/libxml2
+ dev-libs/libxslt
+ app-text/docbook-xsl-stylesheets
+ || ( www-client/lynx www-client/w3m www-client/elinks )
+ )"
+
+PATCHDIR="${WORKDIR}"/${P}-gentoo-patches${PATCHSET_REV}
+
+src_unpack() {
+ unpack ${A//${SIDEBAR_PATCH_N}}
+ cd "${S}"
+
+ # this patch is non-generic and only works because we use a sysconfdir
+ # different from the one used by the mailbase ebuild
+ use prefix && epatch "${FILESDIR}"/mutt-1.5.13-prefix-mailcap.patch
+
+ epatch "${FILESDIR}"/mutt-1.5.18-bdb-prefix.patch # fix bdb detection
+ epatch "${FILESDIR}"/mutt-1.5.18-interix.patch
+ epatch "${FILESDIR}"/mutt-1.5.18-solaris-ncurses-chars.patch
+ # post-release hot-fixes
+ epatch "${FILESDIR}"/mutt-1.5.20-imap-port-invalid-d6f88fbf8387.patch
+ epatch "${FILESDIR}"/mutt-1.5.20-header-weeding-f40de578e8ed.patch
+ epatch "${FILESDIR}"/mutt-1.5.20-display-unsigned-pgp-7f37d0a57d83.patch
+ epatch "${FILESDIR}"/mutt-1.5.20-unmailbox-segfault-25e46aad362b.patch
+ epatch "${FILESDIR}"/mutt-1.5.20-mbox-new-mail-bd59be56c6b0.patch
+ epatch "${FILESDIR}"/mutt-1.5.20-mbox-unchanged-new-mail-9ae13dedb5ed.patch
+
+ if use !vanilla && use !sidebar ; then
+ use nntp || rm "${PATCHDIR}"/06-nntp.patch
+ for p in "${PATCHDIR}"/*.patch ; do
+ epatch "${p}"
+ done
+ fi
+
+ if use sidebar ; then
+ use vanilla || \
+ ewarn "The sidebar patch is only applied to a vanilla mutt tree."
+ epatch "${DISTDIR}"/${SIDEBAR_PATCH_N}
+ fi
+
+ AT_M4DIR="m4" eautoreconf
+
+ # this should be done only when we're not root
+ if [[ ${UID} != 0 ]] ; then
+ sed -i \
+ -e 's/@DOTLOCK_GROUP@/'"`id -gn`"'/g' \
+ Makefile.in \
+ || die "sed failed"
+ fi
+}
+
+src_compile() {
+ declare myconf="
+ $(use_enable nls) \
+ $(use_enable gpgme) \
+ $(use_enable imap) \
+ $(use_enable pop) \
+ $(use_enable smtp) \
+ $(use_enable crypt pgp) \
+ $(use_enable smime) \
+ $(use_enable debug) \
+ $(use_with idn) \
+ --with-curses \
+ --sysconfdir="${EPREFIX}"/etc/${PN} \
+ --with-docdir="${EPREFIX}"/usr/share/doc/${PN}-${PVR} \
+ --with-regex \
+ --enable-nfs-fix --enable-external-dotlock \
+ $(use_with !nntp mixmaster) \
+ --with-exec-shell=${EPREFIX}/bin/sh"
+
+ case $CHOST in
+ *-darwin7)
+ # locales are broken on Panther
+ myconf="${myconf} --enable-locales-fix --without-wc-funcs"
+ myconf="${myconf} --disable-fcntl --enable-flock"
+ ;;
+ *-solaris*)
+ # Solaris has no flock in the standard headers
+ myconf="${myconf} --enable-fcntl --disable-flock"
+ ;;
+ *)
+ myconf="${myconf} --disable-fcntl --enable-flock"
+ ;;
+ esac
+
+ # See Bug #22787
+ unset WANT_AUTOCONF_2_5 WANT_AUTOCONF
+
+ # mutt prioritizes gdbm over bdb, so we will too.
+ # hcache feature requires at least one database is in USE.
+ if use qdbm; then
+ myconf="${myconf} --enable-hcache \
+ --with-qdbm --without-gdbm --without-bdb"
+ elif use gdbm ; then
+ myconf="${myconf} --enable-hcache \
+ --without-qdbm --with-gdbm --without-bdb"
+ elif use berkdb; then
+ myconf="${myconf} --enable-hcache \
+ --without-gdbm --without-qdbm --with-bdb"
+ else
+ myconf="${myconf} --disable-hcache \
+ --without-qdbm --without-gdbm --without-bdb"
+ fi
+
+ # there's no need for gnutls, ssl or sasl without socket support
+ if use pop || use imap || use smtp ; then
+ if use gnutls; then
+ myconf="${myconf} --with-gnutls"
+ elif use ssl; then
+ myconf="${myconf} --with-ssl"
+ fi
+ # not sure if this should be mutually exclusive with the other two
+ myconf="${myconf} $(use_with sasl)"
+ else
+ myconf="${myconf} --without-gnutls --without-ssl --without-sasl"
+ fi
+
+ if use mbox; then
+ myconf="${myconf} --with-mailpath=${EPREFIX}/var/spool/mail"
+ else
+ myconf="${myconf} --with-homespool=Maildir"
+ fi
+
+ if use !vanilla && use !sidebar ; then
+ # rr.compressed patch
+ myconf="${myconf} --enable-compressed"
+
+ # nntp patch applied conditionally, so avoid QA warning when doing
+ # --disable-nntp while patch not being applied, bug #262069
+ use nntp && myconf="${myconf} --enable-nntp"
+ fi
+
+ econf ${myconf} || die "configure failed"
+ emake || die "make failed"
+}
+
+src_install() {
+ local ED=${ED-${D}}
+ make DESTDIR="${D}" install || die "install failed"
+ find "${ED}"/usr/share/doc -type f | grep -v "html\|manual" | xargs gzip
+ if use mbox; then
+ insinto /etc/mutt
+ newins "${FILESDIR}"/Muttrc.mbox Muttrc
+ else
+ insinto /etc/mutt
+ doins "${FILESDIR}"/Muttrc
+ fi
+
+ # A newer file is provided by app-misc/mime-types. So we link it.
+ rm "${ED}"/etc/${PN}/mime.types
+ dosym /etc/mime.types /etc/${PN}/mime.types
+
+ # charset.alias is installed by libiconv
+ rm -f "${ED}"/usr/lib/charset.alias
+ rm -f "${ED}"/usr/share/locale/locale.alias
+
+ dodoc BEWARE COPYRIGHT ChangeLog NEWS OPS* PATCHES README* TODO VERSION
+}
+
+pkg_postinst() {
+ echo
+ elog "If you are new to mutt you may want to take a look at"
+ elog "the Gentoo QuickStart Guide to Mutt E-Mail:"
+ elog " http://www.gentoo.org/doc/en/guide-to-mutt.xml"
+ echo
+}