aboutsummaryrefslogtreecommitdiffstats
path: root/mail/qmail-vida/Makefile
blob: 9bf00a2505cbc8717259b3a00479380e5427704f (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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
# New ports collection makefile for:    qmail-vida
# Date created:             22 Aug 2005
# Whom:                 FURUTATE,Mikihiko<futurebsd@infoseek.to>
#
# $FreeBSD$
#

PORTNAME=   qmail-vida
PORTVERSION=    0.53
CATEGORIES= mail
MASTER_SITES+=  ${MASTER_SITE_SOURCEFORGE_JP:S/$/:vida/}    \
        ${MASTER_SITE_QMAIL:S/$/:qmail/}    \
        http://cr.yp.to/checkpwd/:checkpassword \
        http://cr.yp.to/ucspi-tcp/:tcpserver
MASTER_SITE_SUBDIR=${PORTNAME}/2100/:vida

MAINTAINER= futurebsd@infoseek.to
COMMENT=    SMTP_AUTH/APOP support for qmail

DISTFILES=  ${DISTNAME}.tar.gz:vida \
        ${DISTNAME_QMAIL}.tar.gz:qmail      \
        ${DISTNAME_CHECKPASSWORD}.tar.gz:checkpassword  \
        ${DISTNAME_TCPSERVER}.tar.gz:tcpserver
DIST_SUBDIR=    qmail-vida
PATCH_WRKSRC=   ${WRKSRC_QMAIL}

CONFLICTS=  qmail-[0-9]* qmail-mysql-[0-9]* qmail-ldap-[0-9]* \
        qmail-smtp_auth+tls-[0-9]* qmail-spamcontrol-[0-9]* \
        qmail-tls-[0-9]* checkpassword-[0-9]* ucspi-tcp-[0-9]* \
        daemontools-[0-9]*

DISTNAME_QMAIL=         qmail-1.03
DISTNAME_CHECKPASSWORD=     checkpassword-0.90
DISTNAME_TCPSERVER=     ucspi-tcp-0.88

WRKSRC_QMAIL=       ${WRKDIR}/${DISTNAME_QMAIL}
WRKSRC_CHECKPASSWORD=   ${WRKDIR}/${DISTNAME_CHECKPASSWORD}
WRKSRC_TCPSERVER=   ${WRKDIR}/${DISTNAME_TCPSERVER}

WRKSRC=     ${WRKDIR}/${PORTNAME}-${PORTVERSION}
PKGINSTALL?=    ${WRKDIR}/pkg-install
CSH?=       /bin/csh
PREFIX?=    /var/qmail
PORTDOCS=   *

NO_PACKAGE= "djb\'s packaging license does not allow non-standard qmail binary distributions"

QMAIL_VERSION?=     1.03

ALL_TARGET_QMAIL=   default dot-qmail.5 qmail-control.5 qmail-getpw.8 \
            qmail-limits.7 qmail-newmrh.8 qmail-newu.8 qmail-pw2u.8 \
            qmail-send.8 qmail-start.8 qmail-users.5

ALL_TARGET_CHECKPASSWORD=   it
ALL_TARGET_TCPSERVER=       prog install instcheck

SCRIPTS_ENV=    BINOWN="${BINOWN}" BINGRP="${BINGRP}" BINMODE="${BINMODE}" \
        MANMODE="${MANMODE}" CFLAGS="${CFLAGS}"

PLIST_SUB+= README_AUTH="@comment "
PLIST_SUB+= LDAP="@comment " NOT_LDAP=""
PLIST_SUB+= SMTP_AUTH_TLS="@comment "
PLIST_SUB+= SPAMCONTROL="@comment "
PLIST_SUB+= TLS="@comment "

SUB_FILES+= pkg-message${PKGMESSAGE_SUFFIX} mailer.conf.sample \
        bootfiles.sed enable-qmail
SUB_LIST+=  ECHO_CMD=${ECHO_CMD}
PKGINSTALL?=    ${WRKDIR}/pkg-install
PKGMESSAGE?=    ${WRKDIR}/pkg-message${PKGMESSAGE_SUFFIX}

DOCFILES+=  ${WRKSRC_QMAIL}/BLURB ${WRKSRC_QMAIL}/BLURB2 ${WRKSRC_QMAIL}/BLURB3 \
        ${WRKSRC_QMAIL}/BLURB4 ${WRKSRC_QMAIL}/INTERNALS ${WRKSRC_QMAIL}/SECURITY \
        ${WRKSRC_QMAIL}/THOUGHTS ${FILESDIR}/PORT_NOTES \
        ${FILESDIR}/PORT_NOTES_FreeBSD_40-RELEASE \
        ${WRKDIR}/mailer.conf.sample \
        ${WRKSRC_QMAIL}/FAQ ${WRKSRC_QMAIL}/UPGRADE ${WRKSRC_QMAIL}/SENDMAIL \
        ${WRKSRC_QMAIL}/INSTALL ${WRKSRC_QMAIL}/INSTALL.alias \
        ${WRKSRC_QMAIL}/INSTALL.ctl ${WRKSRC_QMAIL}/INSTALL.ids \
        ${WRKSRC_QMAIL}/INSTALL.maildir ${WRKSRC_QMAIL}/INSTALL.mbox \
        ${WRKSRC_QMAIL}/INSTALL.vsm ${WRKSRC_QMAIL}/TEST.deliver \
        ${WRKSRC_QMAIL}/TEST.receive ${WRKSRC_QMAIL}/REMOVE.sendmail \
        ${WRKSRC_QMAIL}/REMOVE.binmail ${WRKSRC_QMAIL}/PIC.local2alias \
        ${WRKSRC_QMAIL}/PIC.local2ext ${WRKSRC_QMAIL}/PIC.local2local \
        ${WRKSRC_QMAIL}/PIC.local2rem ${WRKSRC_QMAIL}/PIC.local2virt \
        ${WRKSRC_QMAIL}/PIC.nullclient ${WRKSRC_QMAIL}/PIC.relaybad \
        ${WRKSRC_QMAIL}/PIC.relaygood ${WRKSRC_QMAIL}/PIC.rem2local

CONFIGUREPROGS= ${WRKSRC_QMAIL}/install ${WRKSRC_QMAIL}/dnsfq ${WRKSRC_QMAIL}/hostname \
        ${WRKSRC_QMAIL}/dnsip ${WRKSRC_QMAIL}/ipmeprint ${WRKSRC_QMAIL}/dnsptr
CONFIGUREFILES= ${WRKSRC_QMAIL}/config ${WRKSRC_QMAIL}/config-fast
BOOTFILES=  home home+df proc proc+df binm1 binm1+df \
        binm2 binm2+df binm3 binm3+df maildir maildir+vida

TCPSERVER_DB_DIR=   ${PREFIX}/cdb/tcp.smtp.cdb
.if (${PREFIX} != ${LOCALBASE})
DOCSDIR=    ${PREFIX}/doc
.endif

NO_MTREE=   yes
USE_REINPLACE=  yes

OPTIONS+=   QMAILQUEUE_PATCH "run a QMAILQUEUE program" off
OPTIONS+=   BIG_CONCURRENCY_PATCH "use a concurrency greater than 240" off
OPTIONS+=   OUTGOINGIP_PATCH "set the IP address to send messages" off
OPTIONS+=   LOCALTIME_PATCH "emit dates in the local timezone" off
OPTIONS+=   MAILDIRQUOTA_PATCH "Maildir++ support" off
OPTIONS+=   BLOCKEXEC_PATCH "block many windows viruses/worms" off
OPTIONS+=   DISCBOUNCES_PATCH "discard double-bounces" off
OPTIONS+=   RELAY_REJECT_PATCH "generated by so-called anti-spammers" off
OPTIONS+=   RCDLINK "create rc.d/qmail.sh" on
OPTIONS+=   TCPSERVER_MAN "install tcpserver man pages" on

.include <bsd.port.pre.mk>

MAN1_QMAIL= forward.1 condredirect.1 bouncesaying.1 except.1 maildirmake.1 \
    maildir2mbox.1 maildirwatch.1 mailsubj.1 qreceipt.1 qbiff.1 preline.1 \
    tcp-env.1
MAN5_QMAIL= addresses.5 envelopes.5 maildir.5 mbox.5 dot-qmail.5 qmail-control.5 \
    qmail-header.5 qmail-log.5 qmail-users.5 tcp-environ.5
MAN7_QMAIL= forgeries.7 qmail-limits.7 qmail.7
MAN8_QMAIL= qmail-local.8 qmail-lspawn.8 qmail-getpw.8 qmail-remote.8 \
    qmail-rspawn.8 qmail-clean.8 qmail-send.8 qmail-start.8 splogger.8 \
    qmail-queue.8 qmail-inject.8 qmail-showctl.8 qmail-newmrh.8 \
    qmail-newu.8 qmail-pw2u.8 qmail-qread.8 qmail-qstat.8 qmail-tcpok.8 \
    qmail-tcpto.8 qmail-pop3d.8 qmail-popup.8 qmail-qmqpc.8 qmail-qmqpd.8 \
    qmail-qmtpd.8 qmail-smtpd.8 qmail-command.8
.for i in 1 5 7 8
MAN${i}+=${MAN${i}_QMAIL}
.endfor

PATCH_SITES+=   ${MASTER_SITE_QMAIL}
PATCH_SITES+=   http://www.ckdhr.com/ckd/:dns
PATCH_SITES+=   ${MASTER_SITE_LOCAL:S/$/:dns/}
PATCHFILES+=    qmail-103.patch:dns
PATCH_SITE_SUBDIR+= lioux/:dns
PATCH_DIST_STRIP+=  -p1

.if defined(WITH_QMAILQUEUE_PATCH)
PATCHFILES+=    qmailqueue-patch
.endif
.if defined(WITH_BIG_CONCURRENCY_PATCH)
PATCHFILES+=    big-concurrency.patch
WITH_BIG_CONCURRENCY_PATCH_CONCURRENCY_LIMIT?=  509
.endif
.if defined(WITH_OUTGOINGIP_PATCH)
PATCHFILES+=    outgoingip.patch
.endif
.if defined(WITH_LOCALTIME_PATCH)
PATCH_SITES+=   http://www.alib.jp/files/:localtime
PATCHFILES+=    qmail-date-localtime.patch:localtime
.endif
.if defined(WITH_MAILDIRQUOTA_PATCH)
PATCH_SITES+=   http://www.alexdupre.com/qmail/:quota
PATCHFILES+=    qmail-maildir++.patch:quota
.endif
.if defined(WITH_BLOCKEXEC_PATCH) && !defined(BARRIER_BLOCKEXEC_PATCH)
PATCH_SITES+=   http://www.alexdupre.com/qmail/:blockexec
PATCHFILES+=    qmail-block-executables.patch:blockexec
.endif
.if defined(WITH_DISCBOUNCES_PATCH) && !defined(BARRIER_DISCBOUNCES_PATCH)
PATCH_SITES+=   http://www.alexdupre.com/qmail/:doublebounce
PATCHFILES+=    qmail-discard-double-bounces.patch:doublebounce
.endif
.if defined(WITH_RELAY_REJECT_PATCH)
PATCHFILES+=    qmail-smtpd-relay-reject
.endif
.if defined(WITH_RCDLINK)
PLIST_SUB+= RCDLINK=""
RCDLINK=
.else
PLIST_SUB+= RCDLINK="@comment "
RCDLINK=    \#
.endif

.if defined(WITH_TCPSERVER_MAN)
MASTER_SITES+=  http://smarden.org/pape/djb/manpages/:1
DISTFILES+= ${DISTNAME_TCPSERVER}-man.tar.gz:1
MAN1_TCPSERVER=addcr.1 argv0.1 date@.1 delcr.1 finger@.1 fixcrio.1 \
        http@.1 mconnect.1 rblsmtpd.1 recordio.1 tcpcat.1 \
        tcpclient.1 tcprules.1 tcprulescheck.1 tcpserver.1 who@.1
MAN1+=${MAN1_TCPSERVER}
.endif

pre-everything::
.if !defined(BARRIER_BIG_CONCURRENCY_PATCH)
    @${ECHO_MSG} ""
    @${ECHO_MSG} "You may use the following build options:"
    @${ECHO_MSG} ""
    @${ECHO_MSG} "WITH_BIG_CONCURRENCY_PATCH_CONCURRENCY_LIMIT=NUMBER"
    @${ECHO_MSG} "              (default NUMBER=${WITH_BIG_CONCURRENCY_PATCH_CONCURRENCY_LIMIT})"
    @${ECHO_MSG} "              set this to a value reasonable for"
    @${ECHO_MSG} "              your system if you use the patch"
    @${ECHO_MSG} ""
.endif

pre-patch:
    cd ${WRKSRC} && make patch

post-patch:
    @${REINPLACE_CMD} 's!/var/qmail!${PREFIX}!; \
               s!/usr/local/!${LOCALBASE}/!' \
        ${WRKSRC_QMAIL}/Makefile
    @${REINPLACE_CMD} 's!nofiles!qnofiles!g' \
        ${WRKSRC_QMAIL}/conf-groups
    @${REINPLACE_CMD} '/"man"/d; /man\/man/d; /man\/cat/d; \
               /"doc"/d; /"boot","/d' \
        ${WRKSRC_QMAIL}/hier.c
    cd ${WRKSRC} && make copy

do-configure:
    @${SED} -e 's,%%RCDLINK%%,${RCDLINK},g; s,%%LOCALBASE%%,${LOCALBASE},g' \
        ${FILESDIR}/pkg-install.in > ${WRKDIR}/pkg-install
    @${SETENV} PKG_PREFIX="${PREFIX}" ${CSH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
    @${ECHO_CMD} "${CC} ${CFLAGS}" > ${WRKSRC_QMAIL}/conf-cc
    @${ECHO_CMD} ${PREFIX} > ${WRKSRC_QMAIL}/conf-qmail
.if defined(WITH_BIG_CONCURRENCY_PATCH) && defined(WITH_BIG_CONCURRENCY_PATCH_CONCURRENCY_LIMIT)
    @if [ ${WITH_BIG_CONCURRENCY_PATCH_CONCURRENCY_LIMIT} -gt 0 ]; then \
        ${ECHO_CMD} "${WITH_BIG_CONCURRENCY_PATCH_CONCURRENCY_LIMIT}" \
            > ${WRKSRC_QMAIL}/conf-spawn ; \
    fi
.endif
    @${ECHO_CMD} 'qnofiles' > ${WRKSRC_CHECKPASSWORD}/conf-groups
    @${ECHO_CMD} 'cc -s -lcrypt' > ${WRKSRC_CHECKPASSWORD}/conf-ld
    @${ECHO_CMD} ${PREFIX} >${WRKSRC_CHECKPASSWORD}/conf-home
    @${ECHO_CMD} "${CC} ${CFLAGS}" > ${WRKSRC}/src/vida/conf-cc
    @${ECHO_CMD} ${PREFIX} > ${WRKSRC}/src/vida/conf-home
    @${ECHO_CMD} ${PREFIX} > ${WRKSRC}/src/vida/conf-qmailhome

post-configure:
    @${ECHO_CMD} ${PREFIX} > ${WRKSRC_TCPSERVER}/conf-home
    @${ECHO_CMD} ${CC} ${CFLAGS} > ${WRKSRC_TCPSERVER}/conf-cc
    @${ECHO_CMD} ${CC} -s > ${WRKSRC_TCPSERVER}/conf-ld

do-build:
    @${ECHO_CMD} "=>Building" ${DISTNAME_QMAIL}
.for target in ${ALL_TARGET_QMAIL}
    @cd ${WRKSRC_QMAIL} && make ${target}
.endfor
    @${ECHO_CMD} "=>Building" ${DISTNAME_CHECKPASSWORD}
.for target in ${ALL_TARGET_CHECKPASSWORD}
    @cd ${WRKSRC_CHECKPASSWORD} && make ${target}
.endfor
    @${ECHO_CMD} "=>Building" ${DISTNAME_TCPSERVER}
.for target in ${ALL_TARGET_TCPSERVER}
    @cd ${WRKSRC_TCPSERVER} && make ${target}
.endfor

do-install:
.for i in ${BOOTFILES}
    @if  [ -f ${WRKSRC_QMAIL}/${i}.sh ] ; then \
        ${SED} -f ${WRKDIR}/bootfiles.sed ${WRKSRC_QMAIL}/$i.sh > ${WRKDIR}/${i} ; \
    elif [ -f ${FILESDIR}/${i}.in ] ; then \
        ${SED} -e 's,%%PREFIX%%,${PREFIX},g ; s,%%TCPSERVERDB%%,${TCPSERVER_DB_DIR},g ; s,%%ECHO_CMD%%,${ECHO_CMD},g' ${FILESDIR}/$i.in > ${WRKDIR}/${i} ; \
    elif [ -f ${FILESDIR}/${i} ] ; then \
        ${SED} -f ${WRKDIR}/bootfiles.sed ${FILESDIR}/$i > ${WRKDIR}/${i} ; \
    fi
.endfor
    @${MKDIR} ${PREFIX}/configure
    @cd ${WRKSRC_QMAIL} ; ./install
    ${INSTALL_PROGRAM} ${CONFIGUREPROGS} ${PREFIX}/configure
    ${INSTALL_SCRIPT} ${CONFIGUREFILES} ${PREFIX}/configure
.for i in ${BOOTFILES}
    ${INSTALL_SCRIPT} ${WRKDIR}/${i:T} ${PREFIX}/boot
.endfor
.for i in 1 5 7 8
    @${MKDIR} ${PREFIX}/man/man$i
.for j in ${MAN${i}_QMAIL}
    ${INSTALL_MAN} ${WRKSRC_QMAIL}/$j ${PREFIX}/man/man${i}
.endfor
.endfor
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR}
    ${INSTALL_DATA} ${DOCFILES} ${DOCSDIR}
.  if defined(PACKAGE_BUILDING)
    @${ECHO_CMD} "FreeBSD Binary package qmail installation" \
        > ${DOCSDIR}/SYSDEPS
.  else
    @cd ${WRKSRC_QMAIL} && ${CAT} `${CAT} SYSDEPS` \
        > ${DOCSDIR}/SYSDEPS
.  endif
.endif
    @${MKDIR} ${PREFIX}/scripts
    ${INSTALL_SCRIPT} ${FILESDIR}/mkaliasdir ${PREFIX}/scripts
    ${INSTALL_SCRIPT} ${WRKDIR}/enable-qmail ${PREFIX}/scripts
.for script in ${SCRIPTS}
    ${INSTALL_SCRIPT} ${WRKDIR}/scripts/${script} ${PREFIX}/scripts
.endfor
    @${SETENV} PKG_PREFIX="${PREFIX}" ${CSH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
    @${ECHO_CMD}
    @${CAT} ${PKGMESSAGE}
    @${ECHO_CMD}
    @cd ${WRKSRC_CHECKPASSWORD} && make setup
.for file_name in addcr argv0 delcr fixcrio mconnect-io rblsmtpd recordio tcpclient tcprules tcprulescheck tcpserver
    @${INSTALL_PROGRAM} ${WRKSRC_TCPSERVER}/${file_name} ${PREFIX}/bin
.endfor
.for file_name in date@ finger@ http@ mconnect who@ tcpcat
    @${INSTALL_SCRIPT} ${WRKSRC_TCPSERVER}/${file_name} ${PREFIX}/bin
.endfor

.if defined(WITH_TCPSERVER_MAN)
.for j in ${MAN1_TCPSERVER}
    ${INSTALL_MAN} ${WRKSRC_TCPSERVER}-man/${j} ${PREFIX}/man/man1/
.endfor
.endif
    cd ${WRKSRC}/src/vida && make setup
    cd ${WRKSRC} && make install-doc

post-install:
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR}/checkpassword
. for f in CHANGES FILES README SYSDEPS TARGETS TODO VERSION
    ${INSTALL_DATA} ${WRKSRC_CHECKPASSWORD}/$f ${DOCSDIR}/checkpassword
. endfor
.endif
    cd ${WRKSRC}/src/vida && make check

.include <bsd.port.post.mk>