sys-process/glances: revbump 3.1.4.1, add missing doc dep
[gentoo.git] / mail-client / neomutt / neomutt-20200417.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit eutils flag-o-matic
7
8 if [[ ${PV} =~ 99999999$ ]]; then
9         inherit git-r3
10         EGIT_REPO_URI="https://github.com/neomutt/neomutt.git"
11         EGIT_CHECKOUT_DIR="${WORKDIR}/neomutt-${P}"
12 else
13         SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
14         KEYWORDS="~amd64 ~x86"
15 fi
16
17 DESCRIPTION="A small but very powerful text-based mail client"
18 HOMEPAGE="https://neomutt.org/"
19
20 LICENSE="GPL-2"
21 SLOT="0"
22 IUSE="berkdb doc gdbm gnutls gpgme idn kerberos kyotocabinet libressl
23         lmdb nls notmuch pgp-classic qdbm sasl selinux slang smime-classic
24         ssl tokyocabinet"
25
26 CDEPEND="
27         app-misc/mime-types
28         berkdb? (
29                 || (
30                         sys-libs/db:6.2
31                         sys-libs/db:5.3
32                         sys-libs/db:4.8
33                 )
34                 <sys-libs/db-6.3:=
35         )
36         gdbm? ( sys-libs/gdbm )
37         kyotocabinet? ( dev-db/kyotocabinet )
38         lmdb? ( dev-db/lmdb )
39         nls? ( virtual/libintl )
40         qdbm? ( dev-db/qdbm )
41         tokyocabinet? ( dev-db/tokyocabinet )
42         gnutls? ( >=net-libs/gnutls-1.0.17 )
43         gpgme? ( >=app-crypt/gpgme-0.9.0 )
44         idn? ( net-dns/libidn:= )
45         kerberos? ( virtual/krb5 )
46         notmuch? ( net-mail/notmuch )
47         sasl? ( >=dev-libs/cyrus-sasl-2 )
48         !slang? ( sys-libs/ncurses:0 )
49         slang? ( sys-libs/slang )
50         ssl? (
51                 !libressl? ( >=dev-libs/openssl-0.9.6:0 )
52                 libressl? ( dev-libs/libressl )
53         )
54 "
55 DEPEND="${CDEPEND}
56         dev-lang/tcl
57         net-mail/mailbase
58         doc? (
59                 dev-libs/libxml2
60                 dev-libs/libxslt
61                 app-text/docbook-xsl-stylesheets
62                 || ( www-client/lynx www-client/w3m www-client/elinks )
63         )"
64 RDEPEND="${CDEPEND}
65         selinux? ( sec-policy/selinux-mutt )
66 "
67
68 src_configure() {
69         local myconf=(
70                 "$(usex doc --full-doc --disable-doc)"
71                 "$(use_enable nls)"
72                 "$(use_enable notmuch)"
73
74                 "$(use_enable gpgme)"
75                 "$(use_enable pgp-classic pgp)"
76                 "$(use_enable smime-classic smime)"
77
78                 # Database backends.
79                 "$(use_enable berkdb bdb)"
80                 "$(use_enable gdbm)"
81                 "$(use_enable kyotocabinet)"
82                 "$(use_enable qdbm)"
83                 "$(use_enable tokyocabinet)"
84
85                 "$(use_enable idn)"
86                 "$(use_enable kerberos gss)"
87                 "$(use_enable lmdb)"
88                 "$(use_enable sasl)"
89                 "--with-ui=$(usex slang slang ncurses)"
90                 "--sysconfdir=${EPREFIX}/etc/${PN}"
91                 "$(use_enable ssl)"
92                 "$(use_enable gnutls)"
93         )
94
95         econf CCACHE=none "${myconf[@]}"
96 }
97
98 src_install() {
99         emake DESTDIR="${D}" install
100
101         # A man-page is always handy, so fake one – here neomuttrc.5
102         # (neomutt.1 already exists)
103         if use !doc; then
104                 sed -n \
105                         -e '/^\(CC_FOR_BUILD\|CFLAGS_FOR_BUILD\)\s*=/p' \
106                         -e '/^\(EXTRA_CFLAGS_FOR_BUILD\|LDFLAGS_FOR_BUILD\)\s*=/p' \
107                         -e '/^\(EXEEXT\|SRCDIR\)\s*=/p' \
108                         Makefile > docs/Makefile.fakedoc || die
109                 sed -n \
110                         -e '/^MAKEDOC_CPP\s*=/,/^\s*$/p' \
111                         -e '/^docs\/\(makedoc$(EXEEXT)\|neomutt\.1\|neomuttrc\.5\)\s*:/,/^\s*$/p' \
112                         docs/Makefile.autosetup >> docs/Makefile.fakedoc || die
113                 emake -f docs/Makefile.fakedoc docs/neomutt.1
114                 emake -f docs/Makefile.fakedoc docs/neomuttrc.5
115                 doman docs/neomutt.1 docs/neomuttrc.5
116         fi
117
118         dodoc LICENSE* ChangeLog* README*
119 }
120
121 pkg_postinst() {
122         if use gpgme && ( use pgp-classic || use smime-classic ); then
123                 ewarn "  Note that gpgme (old gpg) includes both pgp and smime"
124                 ewarn "  support.  You can probably remove pgp-classic (old crypt)"
125                 ewarn "  and smime-classic (old smime) from your USE-flags and"
126                 ewarn "  only enable gpgme."
127         fi
128 }