/[gentoo-x86]/mail-mta/sendmail/sendmail-8.14.2.ebuild
Gentoo

Contents of /mail-mta/sendmail/sendmail-8.14.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Mon Mar 28 09:47:24 2011 UTC (3 years, 3 months ago) by eras
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
remove old

(Portage version: 2.1.9.45/cvs/Linux x86_64)

1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/mail-mta/sendmail/sendmail-8.14.2.ebuild,v 1.3 2009/09/19 08:34:16 tove Exp $
4
5 inherit eutils
6
7 DESCRIPTION="Widely-used Mail Transport Agent (MTA)"
8 HOMEPAGE="http://www.sendmail.org/"
9 SRC_URI="ftp://ftp.sendmail.org/pub/${PN}/${PN}.${PV}.tar.gz"
10
11 LICENSE="Sendmail"
12 SLOT="0"
13 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
14 IUSE="ssl ldap sasl tcpd mbox mailwrapper ipv6 nis sockets"
15
16 DEPEND="net-mail/mailbase
17 sys-devel/m4
18 sasl? ( >=dev-libs/cyrus-sasl-2.1.10 )
19 tcpd? ( sys-apps/tcp-wrappers )
20 ssl? ( dev-libs/openssl )
21 ldap? ( net-nds/openldap )
22 >=sys-libs/db-3.2
23 !net-mail/vacation
24 "
25 RDEPEND="${DEPEND}
26 >=net-mail/mailbase-0.00
27 !mailwrapper? ( !virtual/mta !net-mail/mailwrapper )
28 mailwrapper? ( >=net-mail/mailwrapper-0.2 )"
29 PDEPEND="!mbox? ( mail-filter/procmail )"
30 PROVIDE="virtual/mta"
31
32 src_unpack() {
33 unpack ${A}
34 cd ${S}
35
36 epatch ${FILESDIR}/sendmail-delivered_hdr.patch || die
37
38 confCCOPTS="${CFLAGS}"
39 confMAPDEF="-DMAP_REGEX"
40 conf_sendmail_LIBS=""
41 use sasl && confLIBS="${confLIBS} -lsasl2" \
42 && confENVDEF="${confENVDEF} -DSASL=2" \
43 && confCCOPTS="${confCCOPTS} -I/usr/include/sasl" \
44 && conf_sendmail_LIBS="${conf_sendmail_LIBS} -lsasl2"
45 use tcpd && confENVDEF="${confENVDEF} -DTCPWRAPPERS" \
46 && confLIBS="${confLIBS} -lwrap"
47 use ssl && confENVDEF="${confENVDEF} -DSTARTTLS -D_FFR_DEAL_WITH_ERROR_SSL" \
48 && confLIBS="${confLIBS} -lssl -lcrypto" \
49 && conf_sendmail_LIBS="${conf_sendmail_LIBS} -lssl -lcrypto"
50 use ldap && confMAPDEF="${confMAPDEF} -DLDAPMAP" \
51 && confLIBS="${confLIBS} -lldap -llber"
52 use ipv6 && confENVDEF="${confENVDEF} -DNETINET6"
53 use nis && confENVDEF="${confENVDEF} -DNIS"
54 use sockets && confENVDEF="${confENVDEF} -DSOCKETMAP"
55 sed -e "s:@@confCCOPTS@@:${confCCOPTS}:" \
56 -e "/@@confLDOPTS@@/d" \
57 -e "/@@confCC@@/d" \
58 -e "s/@@confMAPDEF@@/${confMAPDEF}/" \
59 -e "s/@@confENVDEF@@/${confENVDEF}/" \
60 -e "s/@@confLIBS@@/${confLIBS}/" \
61 -e "s/@@conf_sendmail_LIBS@@/${conf_sendmail_LIBS}/" \
62 ${FILESDIR}/site.config.m4 > ${S}/devtools/Site/site.config.m4
63 }
64
65 src_compile() {
66 sh Build || die "compilation failed in main Build script"
67 pushd libmilter
68 sh Build || die "libmilter compilation failed"
69 popd
70 }
71
72 src_install () {
73 OBJDIR="obj.`uname -s`.`uname -r`.`uname -m`"
74 dodir /usr/bin /usr/lib
75 dodir /usr/share/man/man{1,5,8} /usr/sbin /var/log /usr/share/sendmail-cf
76 dodir /var/spool/{mqueue,clientmqueue} /etc/conf.d
77 keepdir /var/spool/{clientmqueue,mqueue}
78 for dir in libsmutil sendmail mailstats praliases smrsh makemap vacation editmap
79 do
80 make DESTDIR=${D} MANROOT=/usr/share/man/man \
81 SBINOWN=root SBINGRP=root UBINOWN=root UBINGRP=root \
82 MANOWN=root MANGRP=root INCOWN=root INCGRP=root \
83 LIBOWN=root LIBGRP=root GBINOWN=root GBINGRP=root \
84 MSPQOWN=root CFOWN=root CFGRP=root \
85 install -C ${OBJDIR}/${dir} \
86 || die "install failed"
87 done
88 for dir in rmail mail.local
89 do
90 make DESTDIR=${D} MANROOT=/usr/share/man/man \
91 SBINOWN=root SBINGRP=root UBINOWN=root UBINGRP=root \
92 MANOWN=root MANGRP=root INCOWN=root INCGRP=root \
93 LIBOWN=root LIBGRP=root GBINOWN=root GBINGRP=root \
94 MSPQOWN=root CFOWN=root CFGRP=root \
95 force-install -C ${OBJDIR}/${dir} \
96 || die "install failed"
97 done
98
99 dodir /usr/include/libmilter
100 make DESTDIR=${D} MANROOT=/usr/share/man/man \
101 SBINOWN=root SBINGRP=root UBINOWN=root UBINGRP=root \
102 MANOWN=root MANGRP=root INCOWN=root INCGRP=root \
103 LIBOWN=root LIBGRP=root GBINOWN=root GBINGRP=root \
104 MSPQOWN=root CFOWN=root CFGRP=root \
105 install -C ${OBJDIR}/libmilter \
106 || die "install failed"
107
108 fowners root:smmsp /usr/sbin/sendmail
109 fperms 2555 /usr/sbin/sendmail
110 fowners smmsp:smmsp /var/spool/clientmqueue
111 fperms 770 /var/spool/clientmqueue
112 fperms 700 /var/spool/mqueue
113 dosym /usr/sbin/makemap /usr/bin/makemap
114 dodoc FAQ LICENSE KNOWNBUGS README RELEASE_NOTES doc/op/op.ps
115 newdoc sendmail/README README.sendmail
116 newdoc sendmail/SECURITY SECURITY
117 newdoc sendmail/TUNING TUNING
118 newdoc smrsh/README README.smrsh
119 newdoc libmilter/README README.libmilter
120
121 newdoc cf/README README.cf
122 newdoc cf/cf/README README.install-cf
123 cp -pPR cf/* ${D}/usr/share/sendmail-cf
124 insinto /etc/mail
125 if use mbox
126 then
127 doins ${FILESDIR}/sendmail.mc
128 else
129 newins ${FILESDIR}/sendmail-procmail.mc sendmail.mc
130 fi
131 m4 ${D}/usr/share/sendmail-cf/m4/cf.m4 ${D}/etc/mail/sendmail.mc \
132 > ${D}/etc/mail/sendmail.cf
133 echo "include(\`/usr/share/sendmail-cf/m4/cf.m4')dnl" \
134 > ${D}/etc/mail/submit.mc
135 cat ${D}/usr/share/sendmail-cf/cf/submit.mc >> ${D}/etc/mail/submit.mc
136 echo "# local-host-names - include all aliases for your machine here" \
137 > ${D}/etc/mail/local-host-names
138 cat <<- EOF > ${D}/etc/mail/trusted-users
139 # trusted-users - users that can send mail as others without a warning
140 # apache, mailman, majordomo, uucp are good candidates
141 EOF
142 cat <<- EOF > ${D}/etc/mail/access
143 # Check the /usr/share/doc/sendmail/README.cf file for a description
144 # of the format of this file. (search for access_db in that file)
145 # The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
146 # package.
147 #
148
149 EOF
150 cat <<- EOF > ${D}/etc/conf.d/sendmail
151 # Config file for /etc/init.d/sendmail
152 # add start-up options here
153 SENDMAIL_OPTS="-bd -q30m -L sm-mta" # default daemon mode
154 CLIENTMQUEUE_OPTS="-Ac -q30m -L sm-cm" # clientmqueue
155 KILL_OPTS="" # add -9/-15/your favorite evil SIG level here
156
157 EOF
158 doinitd ${FILESDIR}/sendmail
159 keepdir /usr/adm/sm.bin
160
161 if use mailwrapper
162 then
163 mv ${D}/usr/sbin/sendmail ${D}/usr/sbin/sendmail.sendmail
164 insinto /etc/mail
165 doins ${FILESDIR}/mailer.conf
166 rm ${D}/usr/bin/mailq
167 rm ${D}/usr/bin/newaliases
168 mv ${D}/usr/share/man/man8/sendmail.8 \
169 ${D}/usr/share/man/man8/sendmail-sendmail.8
170 mv ${D}/usr/share/man/man1/mailq.1 \
171 ${D}/usr/share/man/man1/mailq-sendmail.1
172 mv ${D}/usr/share/man/man1/newaliases.1 \
173 ${D}/usr/share/man/man1/newaliases-sendmail.1
174 mv ${D}/usr/share/man/man5/aliases.5 \
175 ${D}/usr/share/man/man5/aliases-sendmail.5
176 dosed 's/} sendmail/} sendmail.sendmail/' /etc/init.d/sendmail
177 dosed 's/sbin\/sendmail/sbin\/sendmail.sendmail/' /etc/init.d/sendmail
178 fi
179
180 }
181
182 pkg_setup() {
183 einfo "checking for smmsp group... create if missing."
184 enewgroup smmsp 209 || die "problem adding group smmsp"
185 einfo "checking for smmsp user... create if missing."
186 enewuser smmsp 209 -1 /var/spool/mqueue smmsp \
187 || die "problem adding user smmsp"
188 }
189
190 pkg_postinst() {
191 if ! use mailwrapper && [[ -e /etc/mailer.conf ]]
192 then
193 elog
194 elog "Since you emerged sendmail without mailwrapper in USE,"
195 elog "you probably want to 'emerge -C mailwrapper' now."
196 elog
197 fi
198 }

  ViewVC Help
Powered by ViewVC 1.1.20