1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python2_7 )
7 inherit autotools 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"
12 SRC_URI="mirror://gnu/mailutils/${P}.tar.xz"
14 LICENSE="GPL-2 LGPL-2.1"
16 KEYWORDS="~amd64 ~arm64 ~hppa ~ppc ~x86 ~ppc-macos ~x64-macos ~x86-macos"
17 IUSE="berkdb bidi +clients gdbm sasl guile ipv6 kerberos kyotocabinet ldap \
18 mysql nls pam postgres python servers ssl static-libs +threads tcpd \
21 RDEPEND="!mail-client/nmh
29 berkdb? ( sys-libs/db:= )
30 bidi? ( dev-libs/fribidi )
31 gdbm? ( sys-libs/gdbm )
32 guile? ( dev-scheme/guile:= )
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 sed -i -e /AM_GNU_GETTEXT_VERSION/s/0.18/0.19/ configure.ac || die
61 # add missing tests so that make check doesn't fail
62 cp "${FILESDIR}"/{hdr,nohdr,twomsg,weed}.at "${S}"/readmsg/tests || die
64 sed -i -e /^INCLUDES/"s:$:$(mysql_config --include):" \
65 sql/Makefile.am || die
68 eapply "${FILESDIR}"/${P}-fix-build.patch
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 --with-mail-spool=/var/spool/mail \
108 emake DESTDIR="${D}" install
111 doins "${FILESDIR}/mailutils.rc"
112 keepdir /etc/mailutils.d/
113 insinto /etc/mailutils.d
114 doins "${FILESDIR}/mail"
118 if use static-libs; then
119 rm -r "${D}$(python_get_sitedir)/mailutils"/*.{a,la} || die
124 newinitd "${FILESDIR}"/imap4d.initd imap4d
125 newinitd "${FILESDIR}"/pop3d.initd pop3d
126 newinitd "${FILESDIR}"/comsatd.initd comsatd
129 dodoc AUTHORS ChangeLog NEWS README* THANKS TODO
132 use clients && dosym /usr/bin/mail /bin/mail
134 use static-libs || find "${D}" -name "*.la" -delete