Gentoo Archives: gentoo-commits

From: Conrad Kostecki <conikost@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-mta/ssmtp/
Date: Sat, 17 Apr 2021 19:20:32
Message-Id: 1618687164.12c54db65c251bc19961388f3cb505238f3b2b65.conikost@gentoo
1 commit: 12c54db65c251bc19961388f3cb505238f3b2b65
2 Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 17 17:59:29 2021 +0000
4 Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 17 19:19:24 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=12c54db6
7
8 mail-mta/ssmtp: migrate to glep 81
9
10 Closes: https://bugs.gentoo.org/781569
11 Package-Manager: Portage-3.0.18, Repoman-3.0.3
12 Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
13
14 mail-mta/ssmtp/ssmtp-2.64-r4.ebuild | 132 ++++++++++++++++++++++++++++++++++++
15 1 file changed, 132 insertions(+)
16
17 diff --git a/mail-mta/ssmtp/ssmtp-2.64-r4.ebuild b/mail-mta/ssmtp/ssmtp-2.64-r4.ebuild
18 new file mode 100644
19 index 00000000000..321bf549dfd
20 --- /dev/null
21 +++ b/mail-mta/ssmtp/ssmtp-2.64-r4.ebuild
22 @@ -0,0 +1,132 @@
23 +# Copyright 1999-2021 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +
28 +PATCHSET=4
29 +WANT_AUTOMAKE=none
30 +
31 +inherit autotools
32 +
33 +DESCRIPTION="Extremely simple MTA to get mail off the system to a Mailhub"
34 +HOMEPAGE="ftp://ftp.debian.org/debian/pool/main/s/ssmtp/"
35 +SRC_URI="
36 + mirror://debian/pool/main/s/ssmtp/${P/-/_}.orig.tar.bz2
37 + https://dev.gentoo.org/~pinkbyte/distfiles/patches/${P}-patches-${PATCHSET}.tar.xz
38 +"
39 +
40 +LICENSE="GPL-2"
41 +SLOT="0"
42 +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
43 +IUSE="ipv6 libressl +ssl gnutls +mta"
44 +
45 +DEPEND="
46 + !prefix? ( acct-group/ssmtp )
47 + ssl? (
48 + gnutls? ( net-libs/gnutls[openssl] )
49 + !gnutls? (
50 + !libressl? ( dev-libs/openssl:0= )
51 + libressl? ( dev-libs/libressl:0= )
52 + )
53 + )
54 +"
55 +RDEPEND="
56 + ${DEPEND}
57 + net-mail/mailbase
58 + mta? (
59 + !mail-mta/courier
60 + !mail-mta/esmtp
61 + !mail-mta/exim
62 + !mail-mta/mini-qmail
63 + !mail-mta/msmtp[mta]
64 + !mail-mta/netqmail
65 + !mail-mta/nullmailer
66 + !mail-mta/postfix
67 + !mail-mta/qmail-ldap
68 + !mail-mta/sendmail
69 + !mail-mta/opensmtpd
70 + )
71 +"
72 +
73 +REQUIRED_USE="gnutls? ( ssl )"
74 +
75 +src_prepare() {
76 + default
77 +
78 + eapply "${WORKDIR}"/patches/0010_all_maxsysuid.patch
79 + eapply "${WORKDIR}"/patches/0020_all_from-format-fix.patch
80 + eapply "${WORKDIR}"/patches/0030_all_authpass.patch
81 + eapply "${WORKDIR}"/patches/0040_all_darwin7.patch
82 + eapply "${WORKDIR}"/patches/0050_all_strndup.patch
83 + eapply "${WORKDIR}"/patches/0060_all_opessl_crypto.patch
84 + eapply "${WORKDIR}"/patches/0070_all_solaris-basename.patch
85 + eapply "${WORKDIR}"/patches/0080_all_gnutls.patch
86 + eapply "${WORKDIR}"/patches/0090_all_debian-remote-addr.patch
87 + eapply "${WORKDIR}"/patches/0100_all_ldflags.patch
88 + eapply "${WORKDIR}"/patches/0110_all_stdint.patch
89 + eapply "${WORKDIR}"/patches/0120_all_aliases.patch
90 + eapply -p0 "${WORKDIR}"/patches/0130_all_garbage-writes.patch
91 +
92 + # let's start by not using configure.in anymore as future autoconf
93 + # versions will not support it.
94 + mv configure.in configure.ac || die
95 +
96 + eautoconf
97 +}
98 +
99 +src_configure() {
100 + local myeconfargs=(
101 + --sysconfdir="${EPREFIX}"/etc/ssmtp
102 + $(use_enable ssl) $(use_with gnutls)
103 + $(use_enable ipv6 inet6)
104 + --enable-md5auth
105 + )
106 +
107 + econf "${myeconfargs[@]}"
108 +}
109 +
110 +src_compile() {
111 + emake etcdir="${EPREFIX}"/etc
112 +}
113 +
114 +src_install() {
115 + dosbin ssmtp
116 +
117 + doman ssmtp.8 ssmtp.conf.5
118 + dodoc ChangeLog CHANGELOG_OLD INSTALL README TLS
119 + newdoc ssmtp.lsm DESC
120 +
121 + insinto /etc/ssmtp
122 + doins ssmtp.conf revaliases
123 +
124 + local conffile="${ED}/etc/ssmtp/ssmtp.conf"
125 +
126 + # Sorry about the weird indentation, I couldn't figure out a cleverer way
127 + # to do this without having horribly >80 char lines.
128 + sed -i -e "s:^hostname=:\n# Gentoo bug #47562\\
129 + # Commenting the following line will force ssmtp to figure\\
130 + # out the hostname itself.\n\\
131 + # hostname=:" \
132 + "${conffile}" || die "sed failed"
133 +
134 + # Comment rewriteDomain (bug #243364)
135 + sed -i -e "s:^rewriteDomain=:#rewriteDomain=:" "${conffile}"
136 +
137 + # Set restrictive perms on ssmtp.conf as per #187841, #239197
138 + # Protect the ssmtp configfile from being readable by regular users as it
139 + # may contain login/password data to auth against a the mailhub used.
140 + if ! use prefix; then
141 + fowners root:ssmtp /etc/ssmtp/ssmtp.conf
142 + fperms 640 /etc/ssmtp/ssmtp.conf
143 + fowners root:ssmtp /usr/sbin/ssmtp
144 + fperms 2711 /usr/sbin/ssmtp
145 + fi
146 +
147 + if use mta; then
148 + dosym ../sbin/ssmtp /usr/lib/sendmail
149 + dosym ../sbin/ssmtp /usr/bin/sendmail
150 + dosym ssmtp /usr/sbin/sendmail
151 + dosym ../sbin/ssmtp /usr/bin/mailq
152 + dosym ../sbin/ssmtp /usr/bin/newaliases
153 + fi
154 +}