media-gfx/termtosvg: version bump to 1.1.0
[gentoo.git] / mail-client / s-nail / s-nail-14.9.16.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit toolchain-funcs
7
8 HOMEPAGE="https://www.sdaoden.eu/code.html"
9 DESCRIPTION="Enhanced mailx-compatible mail client based on Hierloom mailx (nail)"
10 LICENSE="BSD BSD-4 ISC RSA"
11
12 SRC_URI="https://ftp.sdaoden.eu/${P}.tar.xz"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
15 IUSE="idn kerberos libressl net ssl"
16
17 RDEPEND="
18         sys-libs/ncurses:0=
19         virtual/libiconv
20         idn? ( net-dns/libidn2 )
21         net? (
22                 ssl? (
23                         !libressl? ( dev-libs/openssl:0= )
24                         libressl? ( dev-libs/libressl:0= )
25                 )
26                 kerberos? ( virtual/krb5 )
27         )
28         !mail-client/mailx
29         !net-mail/mailutils
30         !mail-client/nail
31 "
32 DEPEND="${RDEPEND}"
33 BDEPEND="virtual/awk"
34
35 src_configure() {
36         local confopts=(
37                 CC=$(tc-getCC)
38                 EXTRA_CFLAGS=-std=c99
39                 strip=/bin/true
40                 OPT_AUTOCC=no
41                 VAL_PREFIX="${EPREFIX}"/usr
42                 VAL_SYSCONFDIR="${EPREFIX}"/etc
43                 VAL_MTA="${EPREFIX}/usr/sbin/sendmail"
44                 VAL_MAIL='/var/spool/mail'
45                 VAL_PAGER=less
46                 $(usex idn VAL_IDNA=idn2 OPT_IDNA=no)
47                 VERBOSE=1
48         )
49
50         if use net; then
51                 confopts+=( OPT_TLS=$(usex ssl require no)
52                         OPT_GSSAPI=$(usex kerberos require no)
53                 )
54         else
55                 confopts+=( OPT_NET=no )
56         fi
57
58         tc-is-cross-compiler && confopts+=( OPT_CROSS_BUILD=yes )
59
60         emake "${confopts[@]}" config
61 }
62
63 src_compile() {
64         emake build
65 }
66
67 src_install () {
68         # Use /usr/sbin/sendmail by default and provide an example
69         cat <<- EOSMTP >> nail.rc
70
71                 # Use the local sendmail (/usr/sbin/sendmail) binary by default.
72                 # (Uncomment the following line to use a SMTP server)
73                 #set smtp=localhost
74
75                 # Ask for CC: list too.
76                 set askcc
77         EOSMTP
78
79         emake DESTDIR="${D}" install
80
81         dodoc INSTALL NEWS README THANKS
82
83         dodir /bin
84         dosym ../usr/bin/mailx /bin/mail
85         dosym s-nail /usr/bin/mailx
86         dosym mailx /usr/bin/mail
87         dosym mailx /usr/bin/Mail
88
89         dosym s-nail.1 /usr/share/man/man1/mailx.1
90         dosym mailx.1 /usr/share/man/man1/mail.1
91         dosym mailx.1 /usr/share/man/man1/Mail.1
92 }