net-mail/cyrus-imapd: stable 3.0.13 for ppc, bug #703630
[gentoo.git] / net-mail / mu / mu-1.3.6-r2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit autotools elisp-common
7
8 DESCRIPTION="Set of tools to deal with Maildirs, in particular, searching and indexing"
9 HOMEPAGE="https://www.djcbsoftware.nl/code/mu/ https://github.com/djcb/mu"
10 SRC_URI="https://github.com/djcb/mu/archive/${PV}.tar.gz -> ${P}.tar.gz"
11
12 LICENSE="GPL-3+"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="emacs guile mug"
16
17 DEPEND="
18         dev-libs/glib:2
19         dev-libs/gmime:3.0
20         >=dev-libs/xapian-1.4
21         emacs? ( >=app-editors/emacs-24.4:* )
22         guile? ( >=dev-scheme/guile-2.0 )
23         mug? (
24                 net-libs/webkit-gtk:4
25                 x11-libs/gtk+:3
26         )"
27 RDEPEND="${DEPEND}"
28 BDEPEND="virtual/pkgconfig"
29
30 SITEFILE="70mu-gentoo-autoload.el"
31
32 src_prepare() {
33         default
34         eautoreconf
35 }
36
37 src_configure() {
38         local myeconfargs=(
39                 $(use_enable emacs mu4e)
40                 $(use_enable mug gtk)
41                 $(use_enable mug webkit)
42                 $(use_enable guile)
43         )
44
45         econf "${myeconfargs[@]}"
46 }
47
48 src_install() {
49         dobin mu/mu
50         dodoc AUTHORS HACKING NEWS NEWS.org TODO README README.org ChangeLog
51         if use emacs; then
52                 elisp-install ${PN} mu4e/*.el mu4e/*.elc
53                 elisp-site-file-install "${FILESDIR}/${SITEFILE}"
54                 doinfo mu4e/mu4e.info
55         fi
56
57         doman man/mu-add.1 man/mu-bookmarks.5 man/mu-cfind.1 man/mu-easy.1 \
58                 man/mu-extract.1 man/mu-find.1 man/mu-help.1 man/mu-index.1 \
59                 man/mu-mkdir.1 man/mu-query.7 man/mu-remove.1 \
60                 man/mu-script.1 man/mu-server.1 man/mu-verify.1 \
61                 man/mu-view.1 man/mu.1
62
63         if use guile; then
64                   doinfo guile/mu-guile.info
65         fi
66
67         if use mug; then
68                   dobin toys/mug/mug
69         fi
70 }
71
72 src_test() {
73         emake check
74 }
75
76 pkg_preinst() {
77         if [[ -n ${REPLACING_VERSIONS} ]]; then
78                 elog "After upgrading from an old major version, you should"
79                 elog "rebuild your mail index."
80         fi
81 }
82
83 pkg_postinst() {
84         if use emacs; then
85                 einfo "To use mu4e you need to configure it in your .emacs file"
86                 einfo "See the manual for more information:"
87                 einfo "https://www.djcbsoftware.nl/code/mu/mu4e/"
88         fi
89
90         use emacs && elisp-site-regen
91 }
92
93 pkg_postrm() {
94         use emacs && elisp-site-regen
95 }