Gentoo Archives: gentoo-commits

From: Julian Ospald <hasufell@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-mta/sendmail/
Date: Wed, 30 Sep 2015 11:59:25
Message-Id: 1443614338.08613910e10f2eac03b188536ed285b850026454.hasufell@gentoo
1 commit: 08613910e10f2eac03b188536ed285b850026454
2 Author: Julian Ospald <hasufell <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 30 11:00:25 2015 +0000
4 Commit: Julian Ospald <hasufell <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 30 11:58:58 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=08613910
7
8 mail-mta/sendmail: add libressl support
9
10 mail-mta/sendmail/sendmail-8.14.9-r1.ebuild | 206 ++++++++++++++++++++++++++++
11 1 file changed, 206 insertions(+)
12
13 diff --git a/mail-mta/sendmail/sendmail-8.14.9-r1.ebuild b/mail-mta/sendmail/sendmail-8.14.9-r1.ebuild
14 new file mode 100644
15 index 0000000..98d9ca2
16 --- /dev/null
17 +++ b/mail-mta/sendmail/sendmail-8.14.9-r1.ebuild
18 @@ -0,0 +1,206 @@
19 +# Copyright 1999-2015 Gentoo Foundation
20 +# Distributed under the terms of the GNU General Public License v2
21 +# $Id$
22 +
23 +EAPI="5"
24 +inherit eutils multilib systemd toolchain-funcs user
25 +
26 +DESCRIPTION="Widely-used Mail Transport Agent (MTA)"
27 +HOMEPAGE="http://www.sendmail.org/"
28 +SRC_URI="ftp://ftp.sendmail.org/pub/${PN}/${PN}.${PV}.tar.gz"
29 +
30 +LICENSE="Sendmail GPL-2" # GPL-2 is here for initscript
31 +SLOT="0"
32 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
33 +IUSE="ssl ldap libressl sasl tcpd mbox ipv6 nis sockets"
34 +
35 +DEPEND="net-mail/mailbase
36 + sys-devel/m4
37 + sasl? ( >=dev-libs/cyrus-sasl-2.1.10 )
38 + tcpd? ( sys-apps/tcp-wrappers )
39 + ssl? (
40 + !libressl? ( dev-libs/openssl:0 )
41 + libressl? ( dev-libs/libressl )
42 + )
43 + ldap? ( net-nds/openldap )
44 + >=sys-libs/db-3.2
45 + !net-mail/vacation
46 + "
47 +RDEPEND="${DEPEND}
48 + >=net-mail/mailbase-0.00
49 + !mail-mta/courier
50 + !mail-mta/esmtp
51 + !mail-mta/exim
52 + !mail-mta/mini-qmail
53 + !mail-mta/msmtp[mta]
54 + !mail-mta/netqmail
55 + !mail-mta/nullmailer
56 + !mail-mta/postfix
57 + !mail-mta/opensmtpd
58 + !mail-mta/qmail-ldap
59 + !<mail-mta/ssmtp-2.64-r2
60 + !>=mail-mta/ssmtp-2.64-r2[mta]"
61 +
62 +PDEPEND="!mbox? ( mail-filter/procmail )"
63 +
64 +# libmilter library is part of sendmail, but it does not share the version number with it.
65 +# In order to find the right libmilter version number, check SMFI_VERSION definition
66 +# that can be found in ${S}/include/libmilter/mfapi.h (see also SM_LM_VRS_* defines).
67 +# For example, version 1.0.1 has a SMFI_VERSION of 0x01000001.
68 +LIBMILTER_VER=1.0.2
69 +
70 +pkg_setup() {
71 + enewgroup smmsp 209
72 + enewuser smmsp 209 -1 /var/spool/mqueue smmsp
73 +}
74 +
75 +src_prepare() {
76 + epatch "${FILESDIR}"/"${PN}"-8.14.6-build-system.patch
77 + epatch "${FILESDIR}"/sendmail-delivered_hdr.patch
78 + epatch "${FILESDIR}"/libmilter-sharedlib.patch
79 + epatch "${FILESDIR}"/"${PN}"-8.14.5+db-5.0.patch
80 + epatch "${FILESDIR}"/sendmail-starttls-multi-crl.patch
81 +
82 + local confCC="$(tc-getCC)"
83 + local confCCOPTS="${CFLAGS}"
84 + local confLDOPTS="${LDFLAGS}"
85 + local confMAPDEF="-DMAP_REGEX"
86 + local conf_sendmail_LIBS=""
87 + use sasl && confLIBS="${confLIBS} -lsasl2" \
88 + && confENVDEF="${confENVDEF} -DSASL=2" \
89 + && confCCOPTS="${confCCOPTS} -I/usr/include/sasl" \
90 + && conf_sendmail_LIBS="${conf_sendmail_LIBS} -lsasl2"
91 + use tcpd && confENVDEF="${confENVDEF} -DTCPWRAPPERS" \
92 + && confLIBS="${confLIBS} -lwrap"
93 + use ssl && confENVDEF="${confENVDEF} -DSTARTTLS -D_FFR_DEAL_WITH_ERROR_SSL" \
94 + && confENVDEF="${confENVDEF} -D_FFR_TLS_1" \
95 + && confLIBS="${confLIBS} -lssl -lcrypto" \
96 + && conf_sendmail_LIBS="${conf_sendmail_LIBS} -lssl -lcrypto"
97 + use ldap && confMAPDEF="${confMAPDEF} -DLDAPMAP" \
98 + && confLIBS="${confLIBS} -lldap -llber"
99 + use ipv6 && confENVDEF="${confENVDEF} -DNETINET6"
100 + use nis && confENVDEF="${confENVDEF} -DNIS"
101 + use sockets && confENVDEF="${confENVDEF} -DSOCKETMAP"
102 + sed -e "s:@@confCCOPTS@@:${confCCOPTS}:" \
103 + -e "s/@@confLDOPTS@@/${confLDOPTS}/" \
104 + -e "s/@@confCC@@/${confCC}/" \
105 + -e "s/@@confMAPDEF@@/${confMAPDEF}/" \
106 + -e "s/@@confENVDEF@@/${confENVDEF}/" \
107 + -e "s/@@confLIBS@@/${confLIBS}/" \
108 + -e "s/@@conf_sendmail_LIBS@@/${conf_sendmail_LIBS}/" \
109 + "${FILESDIR}"/site.config.m4 > devtools/Site/site.config.m4
110 +}
111 +
112 +src_compile() {
113 + sh Build AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" || die "compilation failed in main Build script"
114 + pushd libmilter
115 + sh Build AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" MILTER_SOVER=${LIBMILTER_VER} || die "libmilter compilation failed"
116 + popd
117 +}
118 +
119 +src_install () {
120 + local MY_LIBDIR=/usr/$(get_libdir)
121 + local MY_OBJDIR="obj.`uname -s`.`uname -r`.`uname -m`"
122 + dodir /usr/bin ${MY_LIBDIR} /usr/include/libmilter
123 + dodir /usr/share/man/man{1,5,8} /usr/sbin /var/log /usr/share/sendmail-cf
124 + dodir /var/spool/{mqueue,clientmqueue} /etc/conf.d
125 + keepdir /var/spool/{clientmqueue,mqueue}
126 + for dir in libsmutil sendmail mailstats praliases smrsh makemap vacation editmap
127 + do
128 + make DESTDIR="${D}" LIBDIR="${MY_LIBDIR}" MANROOT=/usr/share/man/man \
129 + SBINOWN=root SBINGRP=root UBINOWN=root UBINGRP=root \
130 + MANOWN=root MANGRP=root INCOWN=root INCGRP=root \
131 + LIBOWN=root LIBGRP=root GBINOWN=root GBINGRP=root \
132 + MSPQOWN=root CFOWN=root CFGRP=root \
133 + install -C "${MY_OBJDIR}/${dir}" \
134 + || die "install failed"
135 + done
136 + for dir in rmail mail.local
137 + do
138 + make DESTDIR="${D}" LIBDIR="${MY_LIBDIR}" MANROOT=/usr/share/man/man \
139 + SBINOWN=root SBINGRP=root UBINOWN=root UBINGRP=root \
140 + MANOWN=root MANGRP=root INCOWN=root INCGRP=root \
141 + LIBOWN=root LIBGRP=root GBINOWN=root GBINGRP=root \
142 + MSPQOWN=root CFOWN=root CFGRP=root \
143 + force-install -C "${MY_OBJDIR}/${dir}" \
144 + || die "install failed"
145 + done
146 +
147 + make DESTDIR="${D}" LIBDIR="${MY_LIBDIR}" MANROOT=/usr/share/man/man \
148 + SBINOWN=root SBINGRP=root UBINOWN=root UBINGRP=root \
149 + MANOWN=root MANGRP=root INCOWN=root INCGRP=root \
150 + LIBOWN=root LIBGRP=root GBINOWN=root GBINGRP=root \
151 + MSPQOWN=root CFOWN=root CFGRP=root \
152 + MILTER_SOVER=${LIBMILTER_VER} \
153 + install -C "${MY_OBJDIR}/libmilter" \
154 + || die "install failed"
155 +
156 + fowners root:smmsp /usr/sbin/sendmail
157 + fperms 2555 /usr/sbin/sendmail
158 + fowners smmsp:smmsp /var/spool/clientmqueue
159 + fperms 770 /var/spool/clientmqueue
160 + fperms 700 /var/spool/mqueue
161 + dosym /usr/sbin/makemap /usr/bin/makemap
162 + dodoc FAQ KNOWNBUGS README RELEASE_NOTES doc/op/op.ps
163 + newdoc sendmail/README README.sendmail
164 + newdoc sendmail/SECURITY SECURITY
165 + newdoc sendmail/TUNING TUNING
166 + newdoc smrsh/README README.smrsh
167 + newdoc libmilter/README README.libmilter
168 +
169 + newdoc cf/README README.cf
170 + newdoc cf/cf/README README.install-cf
171 + cp -pPR cf/* "${D}"/usr/share/sendmail-cf
172 +
173 + docinto contrib
174 + dodoc contrib/*
175 +
176 + insinto /etc/mail
177 + if use mbox
178 + then
179 + newins "${FILESDIR}"/sendmail.mc-r1 sendmail.mc
180 + else
181 + newins "${FILESDIR}"/sendmail-procmail.mc sendmail.mc
182 + fi
183 + m4 "${D}"/usr/share/sendmail-cf/m4/cf.m4 "${D}"/etc/mail/sendmail.mc \
184 + > "${D}"/etc/mail/sendmail.cf
185 + echo "include(\`/usr/share/sendmail-cf/m4/cf.m4')dnl" \
186 + > "${D}"/etc/mail/submit.mc
187 + cat "${D}"/usr/share/sendmail-cf/cf/submit.mc >> "${D}"/etc/mail/submit.mc
188 + echo "# local-host-names - include all aliases for your machine here" \
189 + > "${D}"/etc/mail/local-host-names
190 + cat <<- EOF > "${D}"/etc/mail/trusted-users
191 + # trusted-users - users that can send mail as others without a warning
192 + # apache, mailman, majordomo, uucp are good candidates
193 + EOF
194 + cat <<- EOF > "${D}"/etc/mail/access
195 + # Check the /usr/share/doc/sendmail/README.cf file for a description
196 + # of the format of this file. (search for access_db in that file)
197 + # The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
198 + # package.
199 + #
200 +
201 + EOF
202 + cat <<- EOF > "${D}"/etc/conf.d/sendmail
203 + # Config file for /etc/init.d/sendmail
204 + # add start-up options here
205 + SENDMAIL_OPTS="-bd -q30m -L sm-mta" # default daemon mode
206 + CLIENTMQUEUE_OPTS="-Ac -q30m -L sm-cm" # clientmqueue
207 + KILL_OPTS="" # add -9/-15/your favorite evil SIG level here
208 +
209 + EOF
210 + if use sasl; then
211 + dodir /etc/sasl2
212 + cat <<- EOF > "${D}"/etc/sasl2/Sendmail.conf
213 + pwcheck_method: saslauthd
214 + mech_list: PLAIN LOGIN
215 +
216 + EOF
217 + fi
218 +
219 + doinitd "${FILESDIR}"/sendmail
220 + systemd_dounit "${FILESDIR}"/sendmail.service
221 + systemd_dounit "${FILESDIR}"/sm-client.service
222 +
223 + keepdir /usr/adm/sm.bin
224 +}