blob: 50bc39792f24e4ead19186d07f56a778e00cb781 (
plain) (
blame)
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
|
# New ports collection makefile for: dkim-milter
# Date created: 10 Jan 2006
# Whom: Hirohisa Yamaguchi <umq@ueo.co.jp>
#
# $FreeBSD$
#
## There is a new option WITH_POSTFIX_MILTER
## to make this port work with mail/postfix port.
## WITH_POSTFIX_MILTER knob implicitly defines
## WITH_SENDMAIL_BASE, to build with libmilter*
## in base system. If you have deleted sendamil in
## base system, building this port may fail.
PORTNAME= dkim-milter
PORTVERSION= 2.5.5
PORTREVISION= 1
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
MAINTAINER= umq@ueo.co.jp
COMMENT= Domainkeys Identified Mail (DKIM) milter
USE_RC_SUBR= milter-dkim.sh
USE_OPENSSL= yes
.if defined(WITH_POSTFIX_MILTER) || defined(WITH_POSTFIX) || defined(WITH_POSTFIX_CURRENT)
WITH_SENDMAIL_BASE= yes
PKGMESSAGE= ${PKGDIR}/pkg-message.postfix
.if defined(SENDMAIL_MILTER_IN_BASE)
WITH_SENDMAIL_BASE=yes
.endif
.if defined(WITH_POSTFIX_CURRENT)
RUN_DEPENDS+= ${LOCALBASE}/libexec/postfix/smtpd:${PORTSDIR}/mail/postfix-current
.else
RUN_DEPENDS+= ${LOCALBASE}/libexec/postfix/smtpd:${PORTSDIR}/mail/postfix
.endif
.endif
SUB_FILES= milter-dkim.sh
WCONF= ${WRKSRC}/devtools/Site
MAN5= dkim-filter.conf.5
MAN8= dkim-filter.8 dkim-genkey.8 dkim-testkey.8 dkim-testssp.8
PLIST_FILES= etc/mail/dkim-filter.conf.sample include/dkim.h \
bin/dkim-genkey %%STATS%%bin/dkim-stats bin/dkim-testkey \
bin/dkim-testssp %%LIBDKIM%%lib/libdkim.a \
%%LIBDKIMSHARED%%lib/libdkim.so %%LIBDKIMSHARED%%lib/libdkim.so.0 \
libexec/dkim-filter
PLIST_DIRS= etc/mail
PORTDOCS= FEATURES INSTALL KNOWNBUGS LICENSE README RELEASE_NOTES \
autorespond.csh \
draft-hoffman-dac-vbr-02.txt draft-ietf-dkim-deployment-01.txt \
draft-ietf-dkim-overview-09.txt draft-ietf-dkim-ssp-03.txt \
draft-kucherawy-sender-auth-header-14.txt \
rfc4686.txt rfc4871.txt rfc5016.txt
.if !defined(NOPORTDOCS)
LIBDOCS= ${DOCSDIR_REL}/libdkim/index.html \
${DOCSDIR_REL}/libdkim/overview.html \
${DOCSDIR_REL}/libdkim/dkim.html \
${DOCSDIR_REL}/libdkim/dkim_alg_t.html \
${DOCSDIR_REL}/libdkim/dkim_body.html \
${DOCSDIR_REL}/libdkim/dkim_canon_t.html \
${DOCSDIR_REL}/libdkim/dkim_cbstat.html \
${DOCSDIR_REL}/libdkim/dkim_chunk.html \
${DOCSDIR_REL}/libdkim/dkim_close.html \
${DOCSDIR_REL}/libdkim/dkim_eoh.html \
${DOCSDIR_REL}/libdkim/dkim_eom.html \
${DOCSDIR_REL}/libdkim/dkim_flush_cache.html \
${DOCSDIR_REL}/libdkim/dkim_free.html \
${DOCSDIR_REL}/libdkim/dkim_get_user_context.html \
${DOCSDIR_REL}/libdkim/dkim_getcachestats.html \
${DOCSDIR_REL}/libdkim/dkim_getdomain.html \
${DOCSDIR_REL}/libdkim/dkim_geterror.html \
${DOCSDIR_REL}/libdkim/dkim_getmode.html \
${DOCSDIR_REL}/libdkim/dkim_getpolicystr.html \
${DOCSDIR_REL}/libdkim/dkim_getpresult.html \
${DOCSDIR_REL}/libdkim/dkim_getpresultstr.html \
${DOCSDIR_REL}/libdkim/dkim_getresultstr.html \
${DOCSDIR_REL}/libdkim/dkim_getsighdr.html \
${DOCSDIR_REL}/libdkim/dkim_getsiglist.html \
${DOCSDIR_REL}/libdkim/dkim_getsignature.html \
${DOCSDIR_REL}/libdkim/dkim_header.html \
${DOCSDIR_REL}/libdkim/dkim_init.html \
${DOCSDIR_REL}/libdkim/dkim_key_syntax.html \
${DOCSDIR_REL}/libdkim/dkim_lib.html \
${DOCSDIR_REL}/libdkim/dkim_minbody.html \
${DOCSDIR_REL}/libdkim/dkim_ohdrs.html \
${DOCSDIR_REL}/libdkim/dkim_options.html \
${DOCSDIR_REL}/libdkim/dkim_param_t.html \
${DOCSDIR_REL}/libdkim/dkim_policy.html \
${DOCSDIR_REL}/libdkim/dkim_policy_syntax.html \
${DOCSDIR_REL}/libdkim/dkim_policy_t.html \
${DOCSDIR_REL}/libdkim/dkim_presult.html \
${DOCSDIR_REL}/libdkim/dkim_pstate.html \
${DOCSDIR_REL}/libdkim/dkim_query_t.html \
${DOCSDIR_REL}/libdkim/dkim_reportinfo.html \
${DOCSDIR_REL}/libdkim/dkim_set_dns_callback.html \
${DOCSDIR_REL}/libdkim/dkim_set_final.html \
${DOCSDIR_REL}/libdkim/dkim_set_key_lookup.html \
${DOCSDIR_REL}/libdkim/dkim_set_policy_lookup.html \
${DOCSDIR_REL}/libdkim/dkim_set_prescreen.html \
${DOCSDIR_REL}/libdkim/dkim_set_signature_handle.html \
${DOCSDIR_REL}/libdkim/dkim_set_signature_handle_free.html \
${DOCSDIR_REL}/libdkim/dkim_set_signature_tagvalues.html \
${DOCSDIR_REL}/libdkim/dkim_set_signer.html \
${DOCSDIR_REL}/libdkim/dkim_set_user_context.html \
${DOCSDIR_REL}/libdkim/dkim_sig_getbh.html \
${DOCSDIR_REL}/libdkim/dkim_sig_getcanonlen.html \
${DOCSDIR_REL}/libdkim/dkim_sig_getcontext.html \
${DOCSDIR_REL}/libdkim/dkim_sig_getdomain.html \
${DOCSDIR_REL}/libdkim/dkim_sig_geterror.html \
${DOCSDIR_REL}/libdkim/dkim_sig_geterrorstr.html \
${DOCSDIR_REL}/libdkim/dkim_sig_getflags.html \
${DOCSDIR_REL}/libdkim/dkim_sig_getkeysize.html \
${DOCSDIR_REL}/libdkim/dkim_sig_getselector.html \
${DOCSDIR_REL}/libdkim/dkim_sig_getsignalg.html \
${DOCSDIR_REL}/libdkim/dkim_sig_getsigntime.html \
${DOCSDIR_REL}/libdkim/dkim_sig_ignore.html \
${DOCSDIR_REL}/libdkim/dkim_sig_process.html \
${DOCSDIR_REL}/libdkim/dkim_sig_syntax.html \
${DOCSDIR_REL}/libdkim/dkim_sigerror.html \
${DOCSDIR_REL}/libdkim/dkim_siginfo.html \
${DOCSDIR_REL}/libdkim/dkim_sigkey_t.html \
${DOCSDIR_REL}/libdkim/dkim_sign.html \
${DOCSDIR_REL}/libdkim/dkim_ssl_version.html \
${DOCSDIR_REL}/libdkim/dkim_stat.html \
${DOCSDIR_REL}/libdkim/dkim_verify.html \
${DOCSDIR_REL}/libdkim/rfc2822_mailbox_split.html
PLIST_FILES+= ${DOCSDIR_REL}/README.dkim-filter \
${DOCSDIR_REL}/README.libdkim \
${LIBDOCS}
PLIST_DIRS+= ${DOCSDIR_REL}/libdkim
.endif
.include <bsd.port.pre.mk>
WITHOUT_MILTER_CFLAGS= yes
WITHOUT_MILTER_LDFLAGS= yes
.include "${PORTSDIR}/mail/sendmail/bsd.milter.mk"
SITE+= ${FILESDIR}/site.config.m4
.if defined(WITH_SENDMAIL_PORT)
SITE+= ${FILESDIR}/site.config.m4.milter
.endif
SITE+= ${WRKSRC}/site.config.m4.dist
SITE_SUB+= -e "s|%%PREFIX%%|${PREFIX}|g" \
-e "s|%%LOCALBASE%%|${LOCALBASE}|g"
.if defined(WITH_SENDMAIL_STATIC_MILTER)
SITE_SUB+= -e 's|%%STATIC%%||g'
.else
SITE_SUB+= -e 's|%%STATIC%%|dnl |g'
.endif
SUB_LIST= "RC_SCRIPT=${PREFIX}/etc/rc.d/${USE_RC_SUBR:S/.sh$//}${RC_SUBR_SUFFIX}"
.if defined(WITH_LIBDKIM_SHARED)
.if ${ARCH} == "amd64"
BROKEN= The devtools do not support the feature
.endif
SITE_SUB+= -e '\|bld_LIBDKIM_SHARED|s/^dnl //g'
.else
.endif
.if defined(WITH_LIBDKIM_INSTALL)
SITE_SUB+= -e '\|bld_LIBDKIM_INSTALL|s/^dnl //g'
.if defined(WITH_LIBDKIM_SHARED)
PLIST_SUB+= LIBDKIM="@comment "
PLIST_SUB+= LIBDKIMSHARED=""
USE_LDCONFIG= yes
.else
PLIST_SUB+= LIBDKIM=""
PLIST_SUB+= LIBDKIMSHARED="@comment "
.endif
.else
PLIST_SUB+= LIBDKIM="@comment "
PLIST_SUB+= LIBDKIMSHARED="@comment "
.endif
.if defined(WITH_DEBUG)
SITE_SUB+= -e '\|confOPTIMIZE.*-g|s/^dnl //g'
.endif
.if !defined(WITHOUT_ARLIB)
SITE_SUB+= -e '\|bld_USE_ARLIB|s/^dnl //g'
.endif
.if defined(WITH_POPAUTH) && !defined(WITHOUT_POPAUTH)
SITE_SUB+= -e '/-DPOPAUTH/s/^dnl //g'
.endif
.if defined(WITH_QUERY_CACHE) && !defined(WITHOUT_QUERY_CACHE)
SITE_SUB+= -e '/-DQUERY_CACHE/s/^dnl //g'
.endif
.if defined(WITH_VERIFY_DOMAINKEYS) && !defined(WITHOUT_VERIFY_DOMAINKEYS)
LIBDK_PORT= mail/dk-milter
BUILD_DEPENDS+= ${NONEXISTENT}:${PORTSDIR}/${LIBDK_PORT}:patch
LIBDK_PATH!= cd ${PORTSDIR}/${LIBDK_PORT} && ${MAKE} -V WRKSRC
SITE_SUB+= -e '\|bld_VERIFY_DOMAINKEYS|s/^dnl //'
PORTDOCS+= rfc4870.txt
.endif
.if defined(WITH_STATS) && !defined(WITHOUT_STATS)
MAN8+= dkim-stats.8
PLIST_SUB+= STATS=""
.else
PLIST_SUB+= STATS="@comment "
.endif
.if (defined(WITH_POPAUTH) \
|| defined(WITH_QUERY_CACHE) \
|| defined(WITH_BODYLENGTH_DB) \
|| defined(WITH_STATS)) \
&& !defined(WITH_BDB_BASE)
USE_BDB= 41+
SITE_SUB+= -e 's|%%BDB%%||g' \
-e "s|%%BDB_LIB_DIR%%|${BDB_LIB_DIR}|g" \
-e "s|%%BDB_INCLUDE_DIR%%|${BDB_INCLUDE_DIR}|g" \
-e "s|%%BDB_LIB_NAME%%|${BDB_LIB_NAME}|g"
.else
SITE_SUB+= -e 's|%%BDB%%|dnl |g'
.endif
.if defined(WITH_OPENSSL_BASE) || defined(OPENSSL_OVERWRITE_BASE)
SITE_SUB+= -e 's|%%OPENSSL%%|dnl |g'
.else
SITE_SUB+= -e 's|%%OPENSSL%%||g' \
-e "s|%%OPENSSLINC%%|${OPENSSLINC}|g" \
-e "s|%%OPENSSLLIB%%|${OPENSSLLIB}|g"
.endif
.if defined(WITH_DIFFHEADERS) && !defined(WITHOUT_DIFFHEADERS)
SITE_SUB+= -e 's|%%LIBTRE%%||g'
LIB_DEPENDS+= tre:${PORTSDIR}/textproc/libtre
.else
SITE_SUB+= -e 's|%%LIBTRE%%|dnl |g'
.endif
pre-fetch:
.if defined(SENDMAIL_MILTER_IN_BASE)
@${ECHO_MSG}
@${ECHO_MSG} "SENDMAIL_MILTER_IN_BASE now deprecated,"
@${ECHO_MSG} "please set WITH_SENDMAIL_BASE=yes instead"
.endif
@${ECHO_MSG}
@${ECHO_MSG} "If you do not have OpenSSL 0.9.8 or later installed,"
@${ECHO_MSG} "set WITH_OPENSSL_PORT=yes to support rsa-sha256 algorithm"
@${ECHO_MSG} "which is requied in the latest specification."
@${ECHO_MSG}
@${ECHO_MSG} "dkim-milter has the following tunable option(s):"
@${ECHO_MSG} " WITH_POPAUTH=yes Query POP-before-SMTP authentication database"
@${ECHO_MSG} " WITH_QUERY_CACHE=yes Cache DNS Query"
@${ECHO_MSG} " WITH_VERIFY_DOMAINKEYS=yes Verify DomainKeys using dk-milter's libdk"
@${ECHO_MSG} " WITH_SENDMAIL_BASE=yes Build to run with base sendmail"
@${ECHO_MSG} " WITH_SENDMAIL_PORT=yes Build to run with ports' sendmail"
@${ECHO_MSG} " WITH_POSTFIX=yes Build to run with postfix port"
@${ECHO_MSG} " WITH_LIBDKIM_INSTALL=yes Install libdkim library"
@${ECHO_MSG}
@sleep 5
post-extract:
@${CP} ${WRKSRC}/dkim-filter/autorespond.csh ${WRKSRC}
.include "${.CURDIR}/Makefile.features"
post-patch:
@${REINPLACE_CMD} -e 's|-pthread|${PTHREAD_LIBS}|' \
-e 's|-D_THREAD_SAFE|${PTHREAD_CFLAGS}|' \
-e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
-e "s|\`-O'|\`${CFLAGS}'|g" \
${WRKSRC}/devtools/OS/FreeBSD
@${SED} ${SITE_SUB} -e '\|^dnl |d' -e '/^dnl$$/d' \
${SITE} > ${WCONF}/site.config.m4
pre-configure:
.if defined(WITH_VERIFY_DOMAINKEYS) && !defined(WITHOUT_VERIFY_DOMAINKEYS)
${LN} -s ${LIBDK_PATH}/libdk ${WRKSRC}/
${CP} ${LIBDK_PATH}/rfc4870.txt ${WRKSRC}/
.endif
post-install:
.if !defined(WITH_DEBUG)
@${STRIP_CMD} ${PREFIX}/libexec/dkim-filter
.endif
@${MKDIR} ${PREFIX}/etc/mail
${INSTALL_DATA} ${WRKSRC}/dkim-filter/dkim-filter.conf.sample ${PREFIX}/etc/mail/
.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 ${MAN8}
@${RM} -f ${MANPREFIX}/man/cat8/${i} ${MANPREFIX}/man/cat8/${i}.gz
${INSTALL_MAN} ${WRKSRC}/*/${i} ${MANPREFIX}/man/man8/
.endfor
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
.for f in ${PORTDOCS}
${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}
.endfor
${INSTALL_DATA} ${WRKSRC}/dkim-filter/README ${DOCSDIR}/README.dkim-filter
${INSTALL_DATA} ${WRKSRC}/libdkim/README ${DOCSDIR}/README.libdkim
${MKDIR} ${DOCSDIR}/libdkim
.for f in ${LIBDOCS}
${INSTALL_DATA} ${WRKSRC}/libdkim/docs/`${BASENAME} ${f}` ${DOCSDIR}/libdkim/
.endfor
.endif
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>
|