mail-mta/exim: Stable for HPPA (bug #585212).
[gentoo.git] / mail-mta / msmtp / msmtp-1.6.4.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 inherit multilib
7
8 DESCRIPTION="An SMTP client and SMTP plugin for mail user agents such as Mutt"
9 HOMEPAGE="http://msmtp.sourceforge.net/"
10 SRC_URI="mirror://sourceforge/msmtp/${P}.tar.xz"
11
12 LICENSE="GPL-3"
13 SLOT="0"
14 KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x86-macos"
15 IUSE="doc gnutls idn libressl libsecret +mta nls sasl ssl vim-syntax"
16
17 CDEPEND="
18         idn? ( net-dns/libidn )
19         libsecret? ( app-crypt/libsecret )
20         nls? ( virtual/libintl )
21         sasl? ( virtual/gsasl )
22         ssl? (
23                 gnutls? ( net-libs/gnutls )
24                 !gnutls? (
25                         !libressl? ( dev-libs/openssl:0= )
26                         libressl? ( dev-libs/libressl:0= )
27                 )
28         )
29 "
30
31 RDEPEND="${CDEPEND}
32         net-mail/mailbase
33         mta? (
34                 !mail-mta/courier
35                 !mail-mta/esmtp
36                 !mail-mta/exim
37                 !mail-mta/mini-qmail
38                 !mail-mta/netqmail
39                 !mail-mta/nullmailer
40                 !mail-mta/postfix
41                 !mail-mta/qmail-ldap
42                 !mail-mta/sendmail
43                 !mail-mta/opensmtpd
44                 !<mail-mta/ssmtp-2.64-r2
45                 !>=mail-mta/ssmtp-2.64-r2[mta]
46         )
47 "
48
49 DEPEND="${CDEPEND}
50         doc? ( virtual/texi2dvi )
51         nls? ( sys-devel/gettext )
52         virtual/pkgconfig
53 "
54
55 REQUIRED_USE="gnutls? ( ssl )"
56
57 DOCS="AUTHORS ChangeLog NEWS README THANKS doc/msmtprc*"
58
59 src_prepare() {
60         # Use default Gentoo location for mail aliases
61         sed -i 's:/etc/aliases:/etc/mail/aliases:' scripts/find_alias/find_alias_for_msmtp.sh || die
62 }
63
64 src_configure() {
65         econf \
66                 $(use_enable nls) \
67                 $(use_with ssl ssl $(usex gnutls gnutls openssl)) \
68                 $(use_with sasl libgsasl) \
69                 $(use_with idn libidn) \
70                 $(use_with libsecret )
71 }
72
73 src_compile() {
74         default
75
76         if use doc ; then
77                 cd doc || die
78                 emake html pdf
79         fi
80 }
81
82 src_install() {
83         default
84
85         if use doc ; then
86                 dohtml doc/msmtp.html
87                 dodoc doc/msmtp.pdf
88         fi
89
90         if use mta ; then
91                 dodir /usr/sbin
92                 dosym /usr/bin/msmtp /usr/sbin/sendmail
93                 dosym /usr/bin/msmtp /usr/bin/sendmail
94                 dosym /usr/bin/msmtp /usr/$(get_libdir)/sendmail
95         fi
96
97         if use vim-syntax ; then
98                 insinto /usr/share/vim/vimfiles/syntax
99                 doins scripts/vim/msmtp.vim
100         fi
101
102         insinto /etc
103         newins doc/msmtprc-system.example msmtprc
104
105         src_install_contrib find_alias find_alias_for_msmtp.sh
106         src_install_contrib msmtpqueue "*.sh" "README ChangeLog"
107         src_install_contrib msmtpq "msmtpq msmtp-queue" README.msmtpq
108         src_install_contrib set_sendmail set_sendmail.sh set_sendmail.conf
109 }
110
111 pkg_postinst() {
112         if [[ -z ${REPLACING_VERSIONS} ]]; then
113                 einfo "Please edit ${ROOT}etc/msmtprc before first use."
114                 einfo "In addition, per user configuration files can be placed"
115                 einfo "as '~/.msmtprc'.  See the msmtprc-user.example file under"
116                 einfo "/usr/share/doc/${PF}/ for an example."
117         fi
118 }
119
120 src_install_contrib() {
121         subdir="$1"
122         bins="$2"
123         docs="$3"
124         local dir=/usr/share/${PN}/$subdir
125         insinto ${dir}
126         exeinto ${dir}
127         for i in $bins ; do
128                 doexe scripts/$subdir/$i
129         done
130         for i in $docs ; do
131                 newdoc scripts/$subdir/$i $subdir.$i
132         done
133 }