1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
|
# New ports collection makefile for: sendmail
# Date created: 20 Apr 2000
# Whom: dirk.meyer@dinoex.sub.org
#
# $FreeBSD$
#
PORTNAME= sendmail
PORTVERSION= 8.12.9
CATEGORIES= mail ipv6
MASTER_SITES= ftp://ftp.sendmail.org/pub/sendmail/ \
${MASTER_SITE_RINGSERVER:S,%SUBDIR%,net/mail/sendmail/&,}
DISTNAME= ${PORTNAME}.${PORTVERSION}
MAINTAINER= dinoex@FreeBSD.org
COMMENT= Reliable, highly configurable mail transfer agent with utilities
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
WCONF= ${WRKSRC}/devtools/Site
SITE= ${FILESDIR}/site.config.m4.pre4
PLIST= ${WRKDIR}/.PLIST.more
DOCS= KNOWNBUGS LICENSE PGPKEYS README RELEASE_NOTES \
sendmail/TRACEFLAGS sendmail/SECURITY sendmail/TUNING
MAN1= mailq.1 newaliases.1 vacation.1
MAN5= aliases.5
MAN8= sendmail.8 mailstats.8 makemap.8 praliases.8 smrsh.8 \
mail.local.8 rmail.8 editmap.8
SENDMAIL= ${PREFIX}/sbin/sendmail
PLIST_SUB+= PREFIX=${PREFIX:S=${PREFIX}/==}
# Options to define Features:
# SENDMAIL_WITHOUT_IPV6=yes
# SENDMAIL_WITHOUT_MILTER=yes
# SENDMAIL_WITH_TLS=yes
# SENDMAIL_WITH_SASL=yes
# SENDMAIL_WITH_SASL2=yes
# SENDMAIL_WITH_LDAP=yes
# SENDMAIL_WITH_PICKY_HELO_CHECK=yes
.if defined(SENDMAIL_WITH_LDAP)
PKGNAMESUFFIX?= -ldap
LIB_DEPENDS+= ldap.2:${PORTSDIR}/net/openldap20
LIB_DEPENDS+= lber.2:${PORTSDIR}/net/openldap20
.endif
.if defined(SENDMAIL_WITH_SASL)
LIB_DEPENDS+= sasl.8:${PORTSDIR}/security/cyrus-sasl
PKGNAMESUFFIX?= -sasl
.endif
.if defined(SENDMAIL_WITH_SASL2)
LIB_DEPENDS+= sasl2.2:${PORTSDIR}/security/cyrus-sasl2
PKGNAMESUFFIX?= -sasl2
.endif
.if defined(SENDMAIL_WITH_TLS) || defined(WITH_TLS)
PKGNAMESUFFIX?= -tls
.endif
# Build site.config.m4
.if exists(${DESTDIR}/etc/mail/mailer.conf)
SITE+= ${FILESDIR}/site.config.m4
.if ! defined(SENDMAIL_WITHOUT_IPV6)
SITE+= ${FILESDIR}/site.config.m4.ipv6
.endif
.endif
.if defined(SENDMAIL_WITH_TLS) || defined(WITH_TLS)
.if ! defined(WITH_OPENSSL_BASE)
SITE+= ${FILESDIR}/site.config.m4.ssl
.else
.if ! exists(${DESTDIR}/etc/mail/mailer.conf)
SITE+= ${FILESDIR}/site.config.m4.ssl
.endif
.endif
SITE+= ${FILESDIR}/site.config.m4.tls
.endif
.if defined(SENDMAIL_WITH_SASL)
SITE+= ${FILESDIR}/site.config.m4.sasl
.endif
.if defined(SENDMAIL_WITH_SASL2)
SITE+= ${FILESDIR}/site.config.m4.sasl2
.endif
.if defined(SENDMAIL_WITH_LDAP)
SITE+= ${FILESDIR}/site.config.m4.ldap
.endif
.if ! defined(SENDMAIL_WITHOUT_MILTER)
SITE+= ${FILESDIR}/site.config.m4.milter
.endif
# install directly if no mailwrapper support
.if ! exists(${DESTDIR}/etc/mail/mailer.conf)
PREFIX?= ${DESTDIR}/usr
MANPREFIX?= ${DESTDIR}/usr/share
PLIST_SUB+= ETCPORT="@comment "
.else
PLIST_SUB+= ETCPORT=""
.endif
post-extract:
@${SED} -e "s=%%PREFIX%%=${PREFIX}=" ${FILESDIR}/sm-client.sh \
> ${WRKSRC}/sm-client.sh
@${SED} -e "s=%%PREFIX%%=${PREFIX}=" ${FILESDIR}/sendmail.sh \
> ${WRKSRC}/sendmail.sh
do-configure:
@${MV} ${WRKSRC}/devtools/OS/FreeBSD ${WRKSRC}/devtools/OS/FreeBSD.sed
${SED} -e "s,\`-pthread\',\`${PTHREAD_LIBS}\'," \
-e "s,\`-O\',\`${CFLAGS}\'," \
${WRKSRC}/devtools/OS/FreeBSD.sed \
> ${WRKSRC}/devtools/OS/FreeBSD
${SED} -e "s=%%PREFIX%%=${PREFIX}=" -e "s=%%LOCALBASE%%=${LOCALBASE}=" \
${SITE} > ${WCONF}/site.config.m4
.if defined(SENDMAIL_WITH_PICKY_HELO_CHECK)
${ECHO_CMD} \
'APPENDDEF(`conf_sendmail_ENVDEF'\'', `-DPICKY_HELO_CHECK'\'')' \
>> ${WCONF}/site.config.m4
.endif
post-build:
( cd ${WRKSRC}/doc/op && ${MAKE} op.txt )
.if ! defined(SENDMAIL_WITHOUT_MILTER)
( cd ${WRKSRC}/libmilter && ${MAKE} )
.endif
pre-install:
@${CAT} ${PKGDIR}/pkg-plist >${PLIST}
.if ! defined(SENDMAIL_WITHOUT_MILTER)
@${CAT} ${FILESDIR}/pkg-milter >>${PLIST}
.endif
if ! pw groupshow smmsp; then pw groupadd smmsp -g 25; fi
if ! pw usershow smmsp; then pw useradd smmsp -g smmsp -u 25 \
-h - -d /nonexistent -s /nonexistent -c "Sendmail Queue"; fi
.if !defined(NOPORTDOCS)
@cd ${WRKSRC} && find cf -type f | \
${AWK} '{print "share/sendmail/" $$1}' >>${PLIST}
@cd ${WRKSRC} && find -d cf -type d | \
${AWK} '{print "@dirrm share/sendmail/" $$1}' >>${PLIST}
@${ECHO_CMD} "@dirrm share/sendmail" >>${PLIST}
.for i in ${DOCS}
@${ECHO_CMD} `${BASENAME} ${i}` | \
${AWK} '{print "share/doc/sendmail/" $$1}' >>${PLIST}
.endfor
@${ECHO_CMD} "@dirrm share/doc/sendmail" >>${PLIST}
.endif
# We want mail.local and rmail for our system.
# the build install catmans only, we have to fix this.
post-install:
( cd ${WRKSRC}/mail.local && ${MAKE} force-install )
( cd ${WRKSRC}/rmail && ${MAKE} force-install )
.if ! defined(SENDMAIL_WITHOUT_MILTER)
${MKDIR} ${PREFIX}/include/libmilter
${INSTALL_DATA} ${WRKSRC}/include/libmilter/mfapi.h \
${WRKSRC}/include/libmilter/mfdef.h \
${PREFIX}/include/libmilter/
${INSTALL_DATA} \
${WRKSRC}/obj.`${WRKSRC}/devtools/bin/Build -A`/libmilter/libmilter.a \
${PREFIX}/lib/
.endif
.if exists(${DESTDIR}/etc/mail/mailer.conf)
${INSTALL_SCRIPT} ${WRKSRC}/sm-client.sh \
${LOCALBASE}/etc/rc.d/sm-client.sh.sample
${INSTALL_SCRIPT} ${WRKSRC}/sendmail.sh \
${LOCALBASE}/etc/rc.d/sendmail.sh.sample
.endif
${CHOWN} smmsp:smmsp /var/spool/clientmqueue
${CHMOD} 770 /var/spool/clientmqueue
.for i in ${MAN8}
@${RM} -f ${MANPREFIX}/man/cat8/${i} ${MANPREFIX}/man/cat8/${i}.gz
${INSTALL_MAN} ${WRKSRC}/*/${i} ${MANPREFIX}/man/man8
.endfor
.for i in ${MAN5}
@${RM} -f ${MANPREFIX}/man/cat5/${i} ${MANPREFIX}/man/cat5/${i}.gz
${INSTALL_MAN} ${WRKSRC}/*/${i} ${MANPREFIX}/man/man5
.endfor
.for i in ${MAN1}
@${RM} -f ${MANPREFIX}/man/cat1/${i} ${MANPREFIX}/man/cat1/${i}.gz
${INSTALL_MAN} ${WRKSRC}/*/${i} ${MANPREFIX}/man/man1
.endfor
.if !defined(NOPORTDOCS)
${MKDIR} ${PREFIX}/share/sendmail ${DOCSDIR}
@${TAR} -C ${WRKSRC} -cf - cf | \
${TAR} -C ${PREFIX}/share/sendmail -xf -
@cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}/
${INSTALL_DATA} ${WRKSRC}/doc/op/op.ps ${DOCSDIR}/op.ps
${INSTALL_DATA} ${WRKSRC}/doc/op/op.txt ${DOCSDIR}/op.txt
${INSTALL_DATA} ${WRKSRC}/devtools/README ${DOCSDIR}/DEVTOOLS
${INSTALL_DATA} ${WRKSRC}/sendmail/README ${DOCSDIR}/SENDMAIL
${INSTALL_DATA} ${WRKSRC}/mail.local/README ${DOCSDIR}/MAIL.LOCAL
${INSTALL_DATA} ${WRKSRC}/smrsh/README ${DOCSDIR}/SMRSH
.if ! defined(SENDMAIL_WITHOUT_MILTER)
${INSTALL_DATA} ${WRKSRC}/libmilter/README ${DOCSDIR}/MILTER
${MKDIR} ${DOCSDIR}/libmilter
@${TAR} -C ${WRKSRC}/libmilter/docs -cf - . | \
${TAR} -C ${DOCSDIR}/libmilter -xf -
.endif
.endif
.if exists(${DESTDIR}/etc/mail/mailer.conf)
@${SED} s!%%PREFIX%%!${PREFIX}!g ${PKGMESSAGE}
mailer.conf:
@${SED} \
-e "s=^sendmail[ ]*/.*$$=sendmail ${SENDMAIL}=" \
-e "s=^send-mail[ ]*/.*$$=send-mail ${SENDMAIL}=" \
-e "s=^mailq[ ]*/.*$$=mailq ${SENDMAIL}=" \
-e "s=^newaliases[ ]*/.*$$=newaliases ${SENDMAIL}=" \
-e "s=^hoststat[ ]*/.*$$=hoststat ${SENDMAIL}=" \
-e "s=^purgestat[ ]*/.*$$=purgestat ${SENDMAIL}=" \
${DESTDIR}/etc/mail/mailer.conf > ${DESTDIR}/etc/mail/mailer.conf.new
${MV} ${DESTDIR}/etc/mail/mailer.conf.new \
${DESTDIR}/etc/mail/mailer.conf
.endif
# create sumbit.cf on older systems
#
submit.cf: ${DESTDIR}/etc/mail/submit.cf
${DESTDIR}/etc/mail/submit.mc:
${INSTALL_DATA} ${PREFIX}/share/sendmail/cf/cf/submit.mc \
${DESTDIR}/etc/mail/submit.mc
${DESTDIR}/etc/mail/submit.cf: ${DESTDIR}/etc/mail/submit.mc
@( cd ${DESTDIR}/etc/mail && ${MAKE} \
SENDMAIL_CF_DIR=${PREFIX}/share/sendmail/cf \
SENDMAIL_MC=submit )
# create basics for smtp-auth
#
install-sasldb:
@${ECHO_CMD} "# Links:"
@${ECHO_CMD} "#"
@${ECHO_CMD} "# http://www.sendmail.org/~gshapiro/"
@${ECHO_CMD} "# http://www.sendmail.org/~ca/email/auth.html"
@${ECHO_CMD} "# http://www.asp.ogi.edu/people/paja/linux/sendmail/"
@${ECHO_CMD} "# http://blue-labs.org/clue/sendmail.php"
@${ECHO_CMD} "# http://www.digitalanswers.org/sendmail/"
@${ECHO_CMD} "#"
# create certificates for TLS/SSL
#
tls-install:
${SETENV} DESTDIR=${DESTDIR} FILESDIR=${FILESDIR} \
${SH} ${FILESDIR}/tls-install.sh
.include <bsd.port.pre.mk>
.if defined(SENDMAIL_WITH_TLS) || defined(WITH_TLS)
.include "${PORTSDIR}/security/openssl/bsd.openssl.mk"
.endif
.if exists(${FILESDIR}/site.config.m4.local)
SITE+= ${FILESDIR}/site.config.m4.local
.endif
.include <bsd.port.post.mk>
|