Gentoo Archives: gentoo-dev

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

Attachments

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