1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python2_7 )
7 inherit autotools elisp-common eutils flag-o-matic python-single-r1 toolchain-funcs
9 DESCRIPTION="A useful collection of mail servers, clients, and filters"
10 HOMEPAGE="https://www.gnu.org/software/mailutils/mailutils.html"
11 SRC_URI="mirror://gnu/mailutils/${P}.tar.xz"
13 LICENSE="GPL-2 LGPL-2.1"
15 KEYWORDS="amd64 arm arm64 ~hppa ia64 ppc ppc64 ~s390 ~sparc x86 ~ppc-macos ~x64-macos ~x86-macos"
16 IUSE="berkdb bidi +clients emacs gdbm sasl guile ipv6 kerberos kyotocabinet \
17 ldap mysql nls pam postgres python servers split-usr ssl static-libs +threads tcpd \
20 RDEPEND="!mail-client/nmh
28 berkdb? ( sys-libs/db:= )
29 bidi? ( dev-libs/fribidi )
30 emacs? ( >=app-editors/emacs-23.1:* )
31 gdbm? ( sys-libs/gdbm )
32 guile? ( dev-scheme/guile:12/22 )
33 kerberos? ( virtual/krb5 )
34 kyotocabinet? ( dev-db/kyotocabinet )
35 ldap? ( net-nds/openldap )
36 mysql? ( virtual/mysql )
37 nls? ( sys-devel/gettext )
39 postgres? ( dev-db/postgresql:= )
40 python? ( ${PYTHON_DEPS} )
41 sasl? ( virtual/gsasl )
42 ssl? ( net-libs/gnutls:= )
43 tcpd? ( sys-apps/tcp-wrappers )
44 tokyocabinet? ( dev-db/tokyocabinet )"
49 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )
53 use python && python-single-r1_pkg_setup
57 # Disable bytecompilation of Python modules.
58 echo "#!/bin/sh" > build-aux/py-compile
60 "${FILESDIR}"/${P}-MH-testsuite.patch \
61 "${FILESDIR}"/${P}-fix-endianness.patch \
62 "${FILESDIR}"/${PN}-3.4-fno-common.patch
63 # add missing tests so that make check doesn't fail
64 cp "${FILESDIR}"/{hdr,nohdr,twomsg,weed}.at "${S}"/readmsg/tests || die
66 sed -i -e /^INCLUDES/"s:$:$(mysql_config --include):" \
67 sql/Makefile.am || die
74 append-flags -fno-strict-aliasing
76 # maildir is the Gentoo default
77 econf MU_DEFAULT_SCHEME=maildir \
78 CURSES_LIBS="$($(tc-getPKG_CONFIG) --libs ncurses)" \
79 $(use_with berkdb berkeley-db) \
80 $(use_with bidi fribidi) \
83 $(use_with sasl gsasl) \
85 $(use_with kerberos gssapi) \
90 $(use_with postgres) \
91 $(use_enable python) \
92 $(use_with ssl gnutls) \
93 $(use_enable static-libs static) \
94 $(use_enable threads pthread) \
95 $(use_with tokyocabinet) \
96 $(use_with kyotocabinet) \
97 $(use_with tcpd tcp-wrappers) \
98 $(use_enable servers build-servers) \
99 $(use_enable clients build-clients) \
100 EMACS=$(usex emacs emacs no) \
101 --with-lispdir="${EPREFIX}${SITELISP}/${PN}" \
102 --with-mail-spool=/var/spool/mail \
114 newins "${FILESDIR}/mailutils.rc" mailutils.conf
115 keepdir /etc/mailutils.d/
116 insinto /etc/mailutils.d
117 doins "${FILESDIR}/mail"
121 if use static-libs; then
122 rm -r "${D}$(python_get_sitedir)/mailutils"/*.{a,la} || die
127 newinitd "${FILESDIR}"/imap4d.initd imap4d
128 newinitd "${FILESDIR}"/pop3d.initd pop3d
129 newinitd "${FILESDIR}"/comsatd.initd comsatd
133 if use clients && use split-usr; then
134 dosym ../usr/bin/mail /bin/mail
137 if ! use static-libs; then
138 find "${D}" -name "*.la" -delete || die