1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
10 inherit eutils autotools user
12 DESCRIPTION="Extremely simple MTA to get mail off the system to a Mailhub"
13 HOMEPAGE="ftp://ftp.debian.org/debian/pool/main/s/ssmtp/"
14 SRC_URI="mirror://debian/pool/main/s/ssmtp/${P/-/_}.orig.tar.bz2
15 https://dev.gentoo.org/~pinkbyte/distfiles/patches/${P}-patches-${PATCHSET}.tar.xz"
19 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 m68k ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
20 IUSE="ipv6 libressl +ssl gnutls +mta"
23 gnutls? ( net-libs/gnutls[openssl] )
25 !libressl? ( dev-libs/openssl:0= )
26 libressl? ( dev-libs/libressl:0= )
47 REQUIRED_USE="gnutls? ( ssl )"
56 EPATCH_SUFFIX="patch" EPATCH_SOURCE="${WORKDIR}/patches" \
60 # let's start by not using configure.in anymore as future autoconf
61 # versions will not support it.
62 mv configure.in configure.ac || die
69 --sysconfdir="${EPREFIX}"/etc/ssmtp \
70 $(use_enable ssl) $(use_with gnutls) \
71 $(use_enable ipv6 inet6) \
76 emake etcdir="${EPREFIX}"/etc
82 doman ssmtp.8 ssmtp.conf.5
83 dodoc ChangeLog CHANGELOG_OLD INSTALL README TLS
87 doins ssmtp.conf revaliases
89 local conffile="${ED}etc/ssmtp/ssmtp.conf"
91 # Sorry about the weird indentation, I couldn't figure out a cleverer way
92 # to do this without having horribly >80 char lines.
93 sed -i -e "s:^hostname=:\n# Gentoo bug #47562\\
94 # Commenting the following line will force ssmtp to figure\\
95 # out the hostname itself.\n\\
97 "${conffile}" || die "sed failed"
99 # Comment rewriteDomain (bug #243364)
100 sed -i -e "s:^rewriteDomain=:#rewriteDomain=:" "${conffile}"
102 # Set restrictive perms on ssmtp.conf as per #187841, #239197
103 # Protect the ssmtp configfile from being readable by regular users as it
104 # may contain login/password data to auth against a the mailhub used.
105 if ! use prefix; then
106 fowners root:ssmtp /etc/ssmtp/ssmtp.conf
107 fperms 640 /etc/ssmtp/ssmtp.conf
108 fowners root:ssmtp /usr/sbin/ssmtp
109 fperms 2711 /usr/sbin/ssmtp
113 dosym ../sbin/ssmtp /usr/lib/sendmail
114 dosym ../sbin/ssmtp /usr/bin/sendmail
115 dosym ssmtp /usr/sbin/sendmail
116 dosym ../sbin/ssmtp /usr/bin/mailq
117 dosym ../sbin/ssmtp /usr/bin/newaliases