blob: 27737a997cf684f74924ae43dc2bc0ad435c318d (
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
|
# New ports collection makefile for: maia
# Date created: 03 Jan 2008
# Whom: Janky Jay <ek@purplehat.org>
#
# $FreeBSD$
#
# Based on amavisd-new ports makefile.
PORTNAME= maia
PORTVERSION= 1.0.2a
PORTREVISION= 3
CATEGORIES= security
MASTER_SITES= http://www.purplehat.org/downloads/maia/
MAINTAINER= ek@purplehat.org
COMMENT= A web-based management system based on amavisd-new and SpamAssassin
RUN_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/Unix/Syslog.pm:${PORTSDIR}/sysutils/p5-Unix-Syslog \
${SITE_PERL}/MIME/Parser.pm:${PORTSDIR}/mail/p5-MIME-Tools \
${SITE_PERL}/Convert/TNEF.pm:${PORTSDIR}/converters/p5-Convert-TNEF \
p5-Convert-UUlib>=1.08,1:${PORTSDIR}/converters/p5-Convert-UUlib \
${SITE_PERL}/Archive/Zip.pm:${PORTSDIR}/archivers/p5-Archive-Zip \
${SITE_PERL}/IO/Wrap.pm:${PORTSDIR}/devel/p5-IO-stringy \
${SITE_PERL}/IO/Socket/INET6.pm:${PORTSDIR}/net/p5-IO-Socket-INET6 \
${SITE_PERL}/${PERL_ARCH}/Data/UUID.pm:${PORTSDIR}/devel/p5-Data-UUID \
${SITE_PERL}/${PERL_ARCH}/Template.pm:${PORTSDIR}/www/p5-Template-Toolkit \
p5-Net-Server>=0.93:${PORTSDIR}/net/p5-Net-Server
USE_PERL5_RUN= 5.8.2+
NO_BUILD= yes
DOCS= LICENSE README amavisd.conf.dist maia-mysql.sql maia-pgsql.sql maia.conf.dist
MAIAUSER?= vscan
MAIAGROUP?= vscan
MAIADIR?= /var/amavisd
MAIAQUARANTINE?= /var/amavisd/virusmails
OPTIONS= BDB "Use BerkeleyDB" on \
MYSQL "Use MySQL" on \
PGSQL "Use PgSQL" off \
SPAMASSASSIN "Use SpamAssassin" on \
ALTERMIME "Use AlterMime" off \
CRYPT "Encryption support" on \
IPCOUNTRY "SpamAssassin IP Country plugin" on \
DOMAINKEYS "SpamAssassin DomainKey plugin" on \
SPFQUERY "SpamAssassin SPF Query plugin" on \
FILE "Use newer file(1) utility from ports" on \
RAR "RAR support with archivers/rar" off \
UNRAR "RAR support with archivers/unrar" on \
ARJ "ARJ support with archivers/arj" on \
UNARJ "ARJ support with archivers/unarj" off \
LHA "LHA support with archivers/lha" on \
ARC "ARC support with archivers/arc" on \
NOMARCH "ARC support with archivers/nomarch" off \
CAB "CAB support with archivers/cabextract" on \
RPM "RPM support with archivers/rpm2cpio" on \
ZOO "ZOO support with archivers/zoo" on \
UNZOO "ZOO support with archivers/unzoo" off \
LZOP "LZOP support with archivers/lzop" on \
FREEZE "FREEZE support with archivers/freeze" on \
P7ZIP "P7ZIP support with archivers/p7zip" on \
TNEF "Add external tnef decoder converters/tnef" off
SUB_FILES= pkg-install pkg-deinstall pkg-message
SUB_LIST+= MAIAUSER=${MAIAUSER} \
MAIAGROUP=${MAIAGROUP} \
MAIADIR=${MAIADIR} \
MAIAQUARANTINE=${MAIAQUARANTINE}
.include <bsd.port.pre.mk>
.if ${PERL_LEVEL} < 500903
RUN_DEPENDS+= p5-IO-Compress>=2.017:${PORTSDIR}/archivers/p5-IO-Compress
.endif
USE_RC_SUBR+= maia.sh
.if defined(WITH_BDB)
RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/BerkeleyDB.pm:${PORTSDIR}/databases/p5-BerkeleyDB
.endif
.if defined(WITH_MYSQL)
RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/DBD/mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql
.endif
.if defined(WITH_PGSQL)
RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/DBD/Pg.pm:${PORTSDIR}/databases/p5-DBD-Pg
.endif
.if defined(WITH_SPAMASSASSIN)
RUN_DEPENDS+= ${SITE_PERL}/Mail/SpamAssassin.pm:${PORTSDIR}/mail/p5-Mail-SpamAssassin
.endif
.if defined(WITH_ALTERMIME)
RUN_DEPENDS+= ${LOCALBASE}/bin/altermime:${PORTSDIR}/mail/altermime
.endif
.if defined(WITH_CRYPT)
RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/Crypt/Blowfish.pm:${PORTSDIR}/security/p5-Crypt-Blowfish \
${SITE_PERL}/${PERL_ARCH}/Crypt/OpenSSL/RSA.pm:${PORTSDIR}/security/p5-Crypt-OpenSSL-RSA \
${SITE_PERL}/Crypt/CBC.pm:${PORTSDIR}/security/p5-Crypt-CBC
.endif
.if defined(WITH_IPCOUNTRY)
RUN_DEPENDS+= ${SITE_PERL}/IP/Country.pm:${PORTSDIR}/net/p5-IP-Country
.endif
.if defined(WITH_DOMAINKEYS)
RUN_DEPENDS+= ${SITE_PERL}/Mail/DomainKeys.pm:${PORTSDIR}/mail/p5-Mail-DomainKeys
.endif
.if defined(WITH_SPFQUERY)
RUN_DEPENDS+= ${SITE_PERL}/Mail/SPF/Query.pm:${PORTSDIR}/mail/p5-Mail-SPF-Query
.endif
.if defined(WITH_FILE)
# security fix, file > 4.21 needed
RUN_DEPENDS+= file>=4.21:${PORTSDIR}/sysutils/file
.endif
# archviers/rar is a 32-bit binary port, we don't want the install to fail
# at that port, therefore we will block instantly here if the platform does
# not suit rar.
.if defined(WITH_RAR)
IA32_BINARY_PORT= yes
RUN_DEPENDS+= ${LOCALBASE}/bin/rar:${PORTSDIR}/archivers/rar
.endif
.if defined(WITH_UNRAR)
RUN_DEPENDS+= ${LOCALBASE}/bin/unrar:${PORTSDIR}/archivers/unrar
.endif
.if defined(WITH_ARJ)
RUN_DEPENDS+= ${LOCALBASE}/bin/arj:${PORTSDIR}/archivers/arj
.endif
.if defined(WITH_UNARJ)
RUN_DEPENDS+= ${LOCALBASE}/bin/unarj:${PORTSDIR}/archivers/unarj
.endif
.if defined(WITH_LHA)
RUN_DEPENDS+= ${LOCALBASE}/bin/lha:${PORTSDIR}/archivers/lha
.endif
.if defined(WITH_ARC)
RUN_DEPENDS+= ${LOCALBASE}/bin/arc:${PORTSDIR}/archivers/arc
.endif
.if defined(WITH_NOMARCH)
RUN_DEPENDS+= ${LOCALBASE}/bin/nomarch:${PORTSDIR}/archivers/nomarch
.endif
.if defined(WITH_CAB)
RUN_DEPENDS+= ${LOCALBASE}/bin/cabextract:${PORTSDIR}/archivers/cabextract
.endif
.if defined(WITH_RPM)
RUN_DEPENDS+= ${LOCALBASE}/bin/rpm2cpio.pl:${PORTSDIR}/archivers/rpm2cpio
.endif
.if defined(WITH_ZOO)
# DOS condition in 2.10.1_2
RUN_DEPENDS+= zoo>=2.10.1_2:${PORTSDIR}/archivers/zoo
.endif
.if defined(WITH_UNZOO)
RUN_DEPENDS+= unzoo>=4.4_1:${PORTSDIR}/archivers/unzoo
.endif
.if defined(WITH_LZOP)
RUN_DEPENDS+= ${LOCALBASE}/bin/lzop:${PORTSDIR}/archivers/lzop
.endif
.if defined(WITH_FREEZE)
RUN_DEPENDS+= ${LOCALBASE}/bin/unfreeze:${PORTSDIR}/archivers/freeze
.endif
.if defined(WITH_P7ZIP)
RUN_DEPENDS+= ${LOCALBASE}/bin/7zr:${PORTSDIR}/archivers/p7zip
.endif
.if defined(WITH_TNEF)
RUN_DEPENDS+= ${LOCALBASE}/bin/tnef:${PORTSDIR}/converters/tnef
.endif
post-patch:
.for f in amavisd.conf.dist amavisd-maia
@${REINPLACE_CMD} "s@'zoo'\]@['zoo','unzoo'] ]@" ${WRKSRC}/${f}
.endfor
.for i in amavisd.conf.dist amavisd-maia
@${REINPLACE_CMD} -e "s|$daemon_user = \'amavis\';|$daemon_user = \'${MAIAUSER}\';|" \
-e "s|$daemon_group = \'amavis\';|$daemon_group = \'${MAIAGROUP}\';|" \
-e 's|$$log_level = 0;|$$log_level = 1;|' \
-e 's|/etc/amavisd.conf|${PREFIX}/etc/amavisd.conf|' \
-e "s|/var/virusmails|${MAIAQUARANTINE}|" ${WRKSRC}/${i}
.endfor
.for f in amavisd-maia amavisd.conf.dist maia.conf.dist scripts/send-quarantine-digests.pl \
scripts/process-quarantine.pl scripts/load-sa-rules.pl
@${REINPLACE_CMD} "s|/var/amavisd|${MAIADIR}|" ${WRKSRC}/${f}
.endfor
.for i in maia.conf.dist scripts/expire-quarantine-cache.pl scripts/stats-snapshot.pl \
scripts/maiadbtool.pl scripts/configtest.pl scripts/send-quarantine-reminders.pl \
scripts/send-quarantine-digests.pl scripts/process-quarantine.pl \
scripts/load-sa-rules.pl scripts/process-quarantine-sub.pl
@${REINPLACE_CMD} "s|/etc/maia.conf|${PREFIX}/etc/maia.conf|" ${WRKSRC}/${i}
.endfor
pre-install:
${FIND} ${WRKSRC} -name '*.bak' -delete
@${SH} ${PKGINSTALL} ${DISTNAME} PRE-INSTALL
do-install:
@${INSTALL} -d ${WWWDIR}
cd ${WRKSRC}/php && ${FIND} . | ${CPIO} --quiet -pdm -L ${WWWDIR}
cd ${WRKSRC}/scripts && ${FIND} . | ${CPIO} --quiet -pdm -L ${MAIADIR}/maia/scripts
cd ${WRKSRC}/templates && ${FIND} . | ${CPIO} --quiet -pdm -L ${MAIADIR}/maia/templates
.for i in amavisd-maia
${INSTALL_SCRIPT} ${WRKSRC}/${i} ${PREFIX}/sbin
.endfor
${INSTALL_SCRIPT} -m 640 ${WRKSRC}/amavisd.conf.dist ${PREFIX}/etc/amavisd.conf.dist
${INSTALL_SCRIPT} -m 640 ${WRKSRC}/maia.conf.dist ${PREFIX}/etc/maia.conf.dist
#
# This can contain sensitive information, e.g. SQL passwords, so it should be handled
# with care.
#
.if !exists(${PREFIX}/www/${PORTNAME}/config.php)
${INSTALL} -o ${WWWOWN} -g ${WWWGRP} -m 640 ${WRKSRC}/php/config.php.dist \
${PREFIX}/www/${PORTNAME}/config.php
.endif
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
.for i in ${DOCS}
${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
.endfor
.endif
post-install:
@if [ ! -f ${PREFIX}/etc/amavisd.conf ]; then \
${CP} -p ${PREFIX}/etc/amavisd.conf.dist ${PREFIX}/etc/amavisd.conf ; fi
@if [ ! -f ${PREFIX}/etc/maia.conf ]; then \
${CP} -p ${PREFIX}/etc/maia.conf.dist ${PREFIX}/etc/maia.conf ; fi
@${CHOWN} -R ${WWWOWN}:${WWWGRP} ${WWWDIR}
@${CHOWN} -R ${MAIAUSER}:${MAIAGROUP} ${MAIADIR}/
@${ECHO_CMD} '@exec ${CHOWN} -R ${WWWOWN}:${WWWGRP} ${WWWDIR}' >> ${TMPPLIST}
@${ECHO_CMD} '@exec ${CHOWN} -R ${MAIAUSER}:${MAIAGROUP} ${MAIADIR}' >> ${TMPPLIST}
${LN} -s ${PREFIX}/share/smarty ${PREFIX}/www/${PORTNAME}/libs/Smarty
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>
|