1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python2_7 python3_{6,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="~alpha 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/2.2-1 )
33 kerberos? ( virtual/krb5 )
34 kyotocabinet? ( dev-db/kyotocabinet )
35 ldap? ( net-nds/openldap )
36 mysql? ( dev-db/mysql-connector-c )
37 nls? ( sys-devel/gettext )
39 postgres? ( dev-db/postgresql:= )
40 python? ( ${PYTHON_DEPS} )
41 sasl? ( virtual/gsasl )
42 servers? ( virtual/libiconv dev-libs/libunistring )
43 ssl? ( net-libs/gnutls:= )
44 tcpd? ( sys-apps/tcp-wrappers )
45 tokyocabinet? ( dev-db/tokyocabinet )"
50 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )
51 servers? ( tcpd ldap )"
53 DOCS=( ABOUT-NLS AUTHORS COPYING COPYING.LESSER ChangeLog INSTALL NEWS README THANKS TODO )
55 "${FILESDIR}"/${PN}-3.5-add-include.patch
56 "${FILESDIR}"/${PN}-3.6-underlinking.patch
57 "${FILESDIR}"/${PN}-3.8-fix-tests.patch
58 "${FILESDIR}"/${PN}-3.8-fno-common.patch
62 use python && python-single-r1_pkg_setup
68 sed -i -e /^INCLUDES/"s:$:$(mysql_config --include):" \
69 sql/Makefile.am || die
75 append-flags -fno-strict-aliasing
77 # maildir is the Gentoo default
78 econf MU_DEFAULT_SCHEME=maildir \
79 CURSES_LIBS="$($(tc-getPKG_CONFIG) --libs ncurses)" \
80 $(use_with berkdb berkeley-db) \
81 $(use_with bidi fribidi) \
84 $(use_with sasl gsasl) \
86 $(use_with kerberos gssapi) \
91 $(use_with postgres) \
92 $(use_enable python) \
93 $(use_with ssl gnutls) \
94 $(use_enable static-libs static) \
95 $(use_enable threads pthread) \
96 $(use_with tokyocabinet) \
97 $(use_with kyotocabinet) \
98 $(use_with tcpd tcp-wrappers) \
99 $(use_enable servers build-servers) \
100 $(use_with servers unistring ) \
101 $(use_enable clients build-clients) \
102 EMACS=$(usex emacs emacs no) \
103 --with-lispdir="${EPREFIX}${SITELISP}/${PN}" \
104 --with-mail-spool=/var/spool/mail \
115 newins "${FILESDIR}/mailutils.rc" mailutils.conf
116 keepdir /etc/mailutils.d/
117 insinto /etc/mailutils.d
118 doins "${FILESDIR}/mail"
122 if use static-libs; then
123 rm -r "${D}$(python_get_sitedir)/mailutils"/*.{a,la} || die
128 newinitd "${FILESDIR}"/imap4d.initd imap4d
129 newinitd "${FILESDIR}"/pop3d.initd pop3d
130 newinitd "${FILESDIR}"/comsatd.initd comsatd
134 if use clients && use split-usr; then
135 dosym ../usr/bin/mail /bin/mail
138 if ! use static-libs; then
139 find "${D}" -name "*.la" -delete || die