Gentoo Archives: gentoo-dev

From: Patrice Clement <monsieurp@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] New package neomutt
Date: Mon, 31 Jul 2017 08:35:04
Message-Id: 20170731083453.GI8732@patriceclement.me
In Reply to: Re: [gentoo-dev] New package neomutt by Nicolas Bock
1 Hi Nicolas
2
3 See my comments inline.
4
5 Monday 31 Jul 2017 09:23:51, Nicolas Bock wrote :
6 > On Mon, Jul 31, 2017 at 09:11:19AM +0200, Nicolas Bock wrote:
7 > >Hi,
8 > >
9 > >I would like to add neomutt to the tree. This new package is meant as
10 > >an alternative and not a replacement of the existing mutt package.
11 >
12 > I should have inlined the patch. Sorry.
13 >
14 >
15 >
16 > From 63f5d569aec514d67645b1c2e891e51810bb7ab5 Mon Sep 17 00:00:00 2001
17 > From: Nicolas Bock <nicolasbock@g.o>
18 > Date: Mon, 31 Jul 2017 09:06:07 +0200
19 > Subject: [PATCH] mail-client/neomutt: New package mail-client/neomutt-20170714
20 >
21 > Package-Manager: Portage-2.3.6, Repoman-2.3.1
22 > ---
23 > mail-client/neomutt/Manifest | 1 +
24 > mail-client/neomutt/metadata.xml | 24 +++++
25 > mail-client/neomutt/neomutt-20170714.ebuild | 161 ++++++++++++++++++++++++++++
26 > 3 files changed, 186 insertions(+)
27 > create mode 100644 mail-client/neomutt/Manifest
28 > create mode 100644 mail-client/neomutt/metadata.xml
29 > create mode 100644 mail-client/neomutt/neomutt-20170714.ebuild
30 >
31 > diff --git a/mail-client/neomutt/Manifest b/mail-client/neomutt/Manifest
32 > new file mode 100644
33 > index 00000000000..2b38484e24d
34 > --- /dev/null
35 > +++ b/mail-client/neomutt/Manifest
36 > @@ -0,0 +1 @@
37 > +DIST neomutt-20170714.tar.gz 2509160 SHA256 40d48920f95ca49ab96eb109b658f5cf6e1c222320c58bdd03769c1355d7a383 SHA512 eb31d2f23b7211904cd66ba293c008f953778b37f13fd09d4db571d013f1c8e6449fccd827872f3ad0a2c8e62555f92b3f9591a1f0f4ac37ab362a4681abaaa0 WHIRLPOOL 455495501a2ab1989d5f3bfa75aa2370896956cdfd7d2e852e225c96aa23a1abdaf2dbb9d886d1d96486d19b2b38c225e8263f268ebafcef8cbd0024885189f3
38 > diff --git a/mail-client/neomutt/metadata.xml b/mail-client/neomutt/metadata.xml
39 > new file mode 100644
40 > index 00000000000..081f253b3a1
41 > --- /dev/null
42 > +++ b/mail-client/neomutt/metadata.xml
43 > @@ -0,0 +1,24 @@
44 > +<?xml version="1.0" encoding="UTF-8"?>
45 > +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
46 > +<pkgmetadata>
47 > + <maintainer type="person">
48 > + <email>nicolasbock@g.o</email>
49 > + <name>Nicolas Bock</name>
50 > + </maintainer>
51 > + <maintainer type="project">
52 > + <email>net-mail@g.o</email>
53 > + <name>Net-Mail</name>
54 > + </maintainer>
55 > + <use>
56 > + <flag name="gpg">Enable support for <pkg>app-crypt/gpgme</pkg></flag>
57 > + <flag name="notmuch">Enable support for <pkg>net-mail/notmuch</pkg></flag>
58 > + <flag name="smime">Enable support for S/MIME</flag>
59 > + <flag name="tokyocabinet">Enable <pkg>dev-db/tokyocabinet</pkg>
60 > + database backend for header caching</flag>
61 > + </use>
62 > + <longdescription lang="en">
63 > + </longdescription>
64 > + <upstream>
65 > + <remote-id type="github">neomutt/neomutt</remote-id>
66 > + </upstream>
67 > +</pkgmetadata>
68 > diff --git a/mail-client/neomutt/neomutt-20170714.ebuild b/mail-client/neomutt/neomutt-20170714.ebuild
69 > new file mode 100644
70 > index 00000000000..9bcf72e7479
71 > --- /dev/null
72 > +++ b/mail-client/neomutt/neomutt-20170714.ebuild
73 > @@ -0,0 +1,161 @@
74 > +# Copyright 1999-2017 Gentoo Foundation
75 > +# Distributed under the terms of the GNU General Public License v2
76 > +# $Id$
77 > +
78 > +EAPI=6
79 > +
80 > +inherit autotools eutils flag-o-matic
81 > +
82 > +DESCRIPTION="A small but very powerful text-based mail client"
83 > +HOMEPAGE="https://www.neomutt.org/"
84 > +SRC_URI="https://github.com/${PN}/${PN}/archive/${P}.tar.gz"
85 > +
86 > +LICENSE="GPL-2"
87 > +SLOT="0"
88 > +KEYWORDS="~amd64 ~x86"
89 > +IUSE="berkdb crypt debug doc gdbm gnutls gpg idn kerberos libressl mbox nls
90 > + notmuch qdbm sasl selinux slang smime ssl tokyocabinet vanilla"
91 > +
92 > +CDEPEND="
93 > + !mail-client/mutt
94 > + app-misc/mime-types
95 > + nls? ( virtual/libintl )
96 > + tokyocabinet? ( dev-db/tokyocabinet )
97 > + !tokyocabinet? (
98 > + qdbm? ( dev-db/qdbm )
99 > + !qdbm? (
100 > + gdbm? ( sys-libs/gdbm )
101 > + !gdbm? ( berkdb? ( >=sys-libs/db-4:= ) )
102 > + )
103 > + )
104 > + gnutls? ( >=net-libs/gnutls-1.0.17 )
105 > + !gnutls? (
106 > + ssl? (
107 > + !libressl? ( >=dev-libs/openssl-0.9.6:0 )
108 > + libressl? ( dev-libs/libressl )
109 > + )
110 > + )
111 > + sasl? ( >=dev-libs/cyrus-sasl-2 )
112 > + kerberos? ( virtual/krb5 )
113 > + idn? ( net-dns/libidn )
114 > + gpg? ( >=app-crypt/gpgme-0.9.0 )
115 > + smime? (
116 > + !libressl? ( >=dev-libs/openssl-0.9.6:0 )
117 > + libressl? ( dev-libs/libressl )
118 > + )
119 > + notmuch? ( net-mail/notmuch )
120 > + slang? ( sys-libs/slang )
121 > + !slang? ( >=sys-libs/ncurses-5.2:0 )
122 > +"
123 > +DEPEND="${CDEPEND}
124 > + net-mail/mailbase
125 > + doc? (
126 > + dev-libs/libxml2
127 > + dev-libs/libxslt
128 > + app-text/docbook-xsl-stylesheets
129 > + || ( www-client/lynx www-client/w3m www-client/elinks )
130 > + )"
131 > +RDEPEND="${CDEPEND}
132 > + selinux? ( sec-policy/selinux-mutt )
133 > +"
134 > +
135 > +S="${WORKDIR}/${PN}-${P}"
136 > +
137 > +src_prepare() {
138 > + eapply_user
139 > + eautoreconf
140 > +}
141 > +
142 > +src_configure() {
143 > + local myconf=(
144 > + "$(use_enable crypt pgp)"
145 > + "$(use_enable debug)"
146 > + "$(use_enable doc)"
147 > + "$(use_enable gpg gpgme)"
148 > + "$(use_enable nls)"
149 > + "$(use_enable smime)"
150 > + "$(use_enable notmuch)"
151 > + "$(use_with idn)"
152 > + "$(use_with kerberos gss)"
153 > + "--with-$(use slang && echo slang || echo curses)=${EPREFIX}/usr"
154 > + "--sysconfdir=${EPREFIX}/etc/${PN}"
155 > + "--with-docdir=${EPREFIX}/usr/share/doc/${PN}-${PVR}"
156 > + )
157 > +
158 > + if [[ ${CHOST} == *-solaris* ]] ; then
159 > + # arrows in index view do not show when using wchar_t
160 > + myconf+=( "--without-wc-funcs" )
161 > + fi
162 > +
163 > + # mutt prioritizes gdbm over bdb, so we will too.
164 > + # hcache feature requires at least one database is in USE.
165 > + local hcaches=(
166 > + "tokyocabinet"
167 > + "qdbm"
168 > + "gdbm"
169 > + "berkdb:bdb"
170 > + )
171 > + local ucache hcache lcache
172 > + for hcache in "${hcaches[@]}" ; do
173 > + if use ${hcache%%:*} ; then
174 > + ucache=${hcache}
175 > + break
176 > + fi
177 > + done
178 > + for hcache in "${hcaches[@]}" ; do
179 > + [[ ${hcache} == ${ucache} ]] \
180 > + && myconf+=( "--with-${hcache#*:}" ) \
181 > + || myconf+=( "--without-${hcache#*:}" )
182 > + done
183 Can you simplify this code a little?
184
185 > +
186 > + # there's no need for gnutls, ssl or sasl without socket support
187 > + if use gnutls; then
188 > + myconf+=( "--with-gnutls" )
189 > + elif use ssl; then
190 > + myconf+=( "--with-ssl" )
191 > + fi
192 > + # not sure if this should be mutually exclusive with the other two
193 > + myconf+=( "$(use_with sasl)" )
194 > +
195 > + if use mbox; then
196 > + myconf+=( "--with-mailpath=${EPREFIX}/var/spool/mail" )
197 > + else
198 > + myconf+=( "--with-homespool=Maildir" )
199 > + fi
200 > +
201 > + econf "${myconf[@]}" || die "configure failed"
202 econf dies on its own, please nix || die.
203
204 > +}
205 > +
206 > +src_install() {
207 > + emake DESTDIR="${D}" install || die "install failed"
208 > + if use mbox; then
209 > + insinto /etc/neomutt
210 > + newins "${FILESDIR}"/Muttrc.mbox Muttrc
211 > + else
212 > + insinto /etc/neomutt
213 > + doins "${FILESDIR}"/Muttrc
214 > + fi
215 > +
216 > + # A newer file is provided by app-misc/mime-types. So we link it.
217 > + rm "${ED}"/etc/${PN}/mime.types
218 Please append || die here.
219
220 > + dosym /etc/mime.types /etc/${PN}/mime.types
221 > +
222 > + # A man-page is always handy, so fake one
223 > + if use !doc; then
224 > + emake -C doc DESTDIR="${D}" muttrc.man || die
225 emake dies on its own.
226
227 > + # make the fake slightly better, bug #413405
228 > + sed -e 's#@docdir@/manual.txt#http://www.mutt.org/doc/devel/manual.html#' \
229 > + -e 's#in @docdir@,#at http://www.mutt.org/,#' \
230 > + -e "s#@sysconfdir@#${EPREFIX}/etc/${PN}#" \
231 > + -e "s#@bindir@#${EPREFIX}/usr/bin#" \
232 > + doc/mutt.man > mutt.1
233 Ditto, append || die here as well.
234
235 > + cp doc/muttrc.man muttrc.5
236 Ditto.
237
238 > + doman mutt.1 muttrc.5
239 > + else
240 > + # nuke manpages that should be provided by an MTA, bug #177605
241 > + rm "${ED}"/usr/share/man/man5/{mbox,mmdf}.5 \
242 > + || ewarn "failed to remove files, please file a bug"
243 > + fi
244 > +
245 > + dodoc COPYRIGHT ChangeLog.md OPS* README*
246 > +}
247 > --
248 > 2.13.0
249 >
250 >
251 > --
252 > Nicolas Bock <nicolasbock@g.o>
253
254
255
256 --
257 Patrice Clement
258 Gentoo Linux developer
259 http://www.gentoo.org

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] New package neomutt Nicolas Bock <nicolasbock@g.o>