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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
|
# New ports collection makefile for: dspam-devel
# Date created: 24 Jun 2004
# Whom: Ion-Mihai "IOnut" Tetcu <itetcu@people.tecnik93.com>
#
# $FreeBSD$
#
# Note to commiters: If don't commit a maintainer patch and as a result PKGNAME
# or user variables (WITH*) changes please add an entry in ${FILESDIR}/UPDATING and
# modify _UPD_LINE_NO=(no_of_added_lines-1) in this Makefile
# else the port will be broken. Thanks.
PORTNAME= dspam-devel
PORTVERSION= ${PORTVER_MAJ}${SNAP_DATE}
CATEGORIES= mail
MASTER_SITES= http://people.tecnik93.com/~itetcu/FreeBSD/ports/${PORTNAME}/sources/
MAINTAINER= itetcu@people.tecnik93.com
COMMENT= Bayesian spam filter - development version
PORTVER_MAJ= 3.6.1
#SNAP_DATE= .20051016.2141
.ifdef(SNAP_DATE)
WRKSRC= ${WRKDIR}/dspam-cvs-devel${SNAP_DATE}
.else
WRKSRC= ${WRKDIR}/dspam-${PORTVER_MAJ}
.endif
## maintainer only
.ifdef(MAINT)
MASTER_SITES= http://dspam.nuclearelephant.com/sources/
DISTFILES= dspam-${PORTVER_MAJ}.tar.gz
NO_CHECKSUM= yes
. ifdef(SNAP_DATE)
DISTFILES= snapshot-devel.tar.gz
#FETCH_BEFORE_ARGS= -v -o ${DISTDIR}/${PORTNAME}-${PORTVERSION}.tar.gz
. endif
FETCH_BEFORE_ARGS= -v -o ${DISTDIR}/${PORTNAME}-${PORTVERSION}.tar.gz
.endif
## debug / log / admin options
OPTIONS= DEBUG "Enable debugging logging" on
OPTIONS+= VERBOSE_DEBUG "Enable debug in LOGDIR/dspam.debug" off
OPTIONS+= BNR_DEBUG "Enable debug for BNR" off
OPTIONS+= PREF_EXT "Preferences in database not in files" off
OPTIONS+= DAEMON "Daemonize dspam; speak LMTP or DLMTP" on
## algorithm options
OPTIONS+= NEURAL_NET "Enable neural networking" off
OPTIONS+= CLAMAV "Enable clamav support" on
OPTIONS+= CLAMAV_DEVEL "Enable clamav support" off
## run-time configure options
OPTIONS+= USER_HOMEDIR "Store user data in ~/.dspam" off
OPTIONS+= TRUSTED_USERS "Disable trusted user security" off
## back-end
OPTIONS+= MYSQL40 "Use MySQL 4.0.x as back-end" off
OPTIONS+= MYSQL41 "Use MySQL 4.1.x as back-end" on
OPTIONS+= MYSQL50 "Use MySQL 5.0.x as back-end" off
OPTIONS+= MYSQL_COMPRESS "Compress dspam <--> MySQL" off
OPTIONS+= POSTGRESQL "Use PostgreSQL as back-end" on
OPTIONS+= ORACLE "Use Oracle as back-end (BROKEN)" off
OPTIONS+= BDB4 "Use BDB4 as back-end (not recomanded)" off
OPTIONS+= SQLITE2 "Use SQLite v2.x as back-end" off
OPTIONS+= SQLITE3 "Use SQLite v3.x as back-end" on
OPTIONS+= HASH "Use hash driver" on
OPTIONS+= VIRT_USERS "Enable virtual users (needs SQL back-end)" off
OPTIONS+= LDAP "Enable recipient verification via LDAP" off
OPTIONS+= LONG_USERNAMES "Usernames longer that OS supports" off
OPTIONS+= LARGE_SCALE "File structure for large scale" off
OPTIONS+= DOMAIN_SCALE "File structure for multiple domains" off
## MTA and LDA
OPTIONS+= CYRUS21_LDA "Use Cyrus's 2.1 deliver as LDA" off
OPTIONS+= CYRUS22_LDA "Use Cyrus's 2.2 deliver as LDA" off
OPTIONS+= EXIM_LDA "Use Exim as local delivery agent" off
OPTIONS+= MAILDROP_LDA "Use Maildrop as local delivery agent" off
OPTIONS+= PROCMAIL_LDA "Use Procmail as local delivery agent" off
OPTIONS+= SENDMAIL_LDA "Use Sendmail as local delivery agent" off
OPTIONS+= SENDMAIL "Play nice with sendmail server" off
OPTIONS+= POSTFIX_MBC "Dspam as mailbox_command in Postfix" off
OPTIONS+= QMAIL "Play nice with Qmail mail server" off
OPTIONS+= CGI "Install CGI (pulls in apache)" off
OPTIONS+= TRAIN_SCRIPT "Install trainning script (needs perl)" off
USE_AUTOTOOLS= libtool:15
USE_REINPLACE= yes
INSTALLS_SHLIB= yes
GNU_CONFIGURE= yes
#CONFIGURE_ENV= LDFLAGS="-L${LOCALBASE}/lib"
CONFIGURE_ENV= CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}" \
CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib" \
LIBS="-L${LOCALBASE}/lib ${PTHREAD_LIBS}"
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
.ifdef(GDBS)
CFLAGS+= -g -DDEBUG
STRIP=
.endif
PKGMESSAGE= ${WRKSRC}/src/README.FreeBSD
_UPD_LINE_NO= 23
CONFLICTS= dspam-[0-9]*
SIGNATURE_LIFE?= 15
_VAR_DIR= /var
LOG_DIR?= ${_VAR_DIR}/log/dspam
DSPAM_MODE?= 4510
DSPAM_OWNER?= root
DSPAM_GROUP?= mail
DSPAM_HOME?= ${_VAR_DIR}/db/dspam
DSPAM_HOME_OWNER?= ${DSPAM_OWNER}
DSPAM_HOME_GROUP?= ${DSPAM_GROUP}
DSPAM_HOME_MODE?= 0770
.include <bsd.port.pre.mk>
CONFIGURE_ARGS+= --with-logdir=${LOG_DIR}
PLIST_SUB+= LOG_DIR=${LOG_DIR}
CONFIGURE_ARGS+= --with-dspam-home=${DSPAM_HOME}
CONFIGURE_ARGS+= --with-dspam-home-owner=${DSPAM_HOME_OWNER}
CONFIGURE_ARGS+= --with-dspam-home-group=${DSPAM_HOME_GROUP}
CONFIGURE_ARGS+= --with-dspam-home-mode=${DSPAM_HOME_MODE}
PLIST_SUB+= DSPAM_HOME=${DSPAM_HOME}
CONFIGURE_ARGS+= --with-dspam-owner=${DSPAM_OWNER}
CONFIGURE_ARGS+= --with-dspam-group=${DSPAM_GROUP}
# we set DSPAM_MODE at the end as some LDAs whant specific mode
_SED_SCRIPT= -e 's,%%DOCSDIR%%,${DOCSDIR},g' \
-e 's,%%EXAMPLESDIR%%,${EXAMPLESDIR},g' \
-e 's,%%DSPAM_HOME%%,${DSPAM_HOME},g' \
-e 's,%%PORTNAME%%,${PORTNAME},g' \
-e 's,%%_VAR_DIR%%,${_VAR_DIR},g'
.ifdef(WITH_DEBUG)
CONFIGURE_ARGS+= --enable-debug
.endif
.ifdef(WITH_VERBOSE_DEBUG)
CONFIGURE_ARGS+= --enable-verbose-debug
.endif
.ifdef(WITH_BNR_DEBUG)
CONFIGURE_ARGS+= --enable-bnr-debug
.endif
.ifdef(WITH_PREF_EXT)
CONFIGURE_ARGS+= --enable-preferences-extension
.endif
.ifdef(WITH_DAEMON)
CONFIGURE_ARGS+= --enable-daemon
RC_SUFX= .sh
USE_RC_SUBR= ${PORTNAME}${RC_SUFX}
_SED_SCRIPT+= -e 's,%%DAEMON%%,,g'
SUB_LIST+= DSPAM_HOME=${DSPAM_HOME}
.else
_SED_SCRIPT+= -e '/%%DAEMON%%/D'
.endif
.ifdef(WITH_NEURAL_NET)
CONFIGURE_ARGS+= --enable-neural-networking
.endif
.ifdef(WITH_CLAMAV)
RUN_DEPENDS+= ${LOCALBASE}/etc/clamd.conf:${PORTSDIR}/security/clamav
.endif
.ifdef(WITH_CLAMAV_DEVEL)
RUN_DEPENDS+= ${LOCALBASE}/etc/clamd.conf:${PORTSDIR}/security/clamav-devel
.endif
.ifdef(WITH_CLAMAV) || defined(WITH_CLAMAV_DEVEL)
CONFIGURE_ARGS+= --enable-clamav
SUB_LIST+= CLAMD=clamd
.else
SUB_LIST+= CLAMD=
.endif
.ifdef(WITH_USER_HOMEDIR)
CONFIGURE_ARGS+= --enable-homedir
.endif
.ifdef(WITH_TRUSTED_USERS)
CONFIGURE_ARGS+= --disable-trusted-user-security
.endif
# we need to know if we are building statically or dynamicaly for the plist
_DBDRV_COUNT= # blank, but defined so we can check against it
#_DBDRV_ALL= pgsql_drv,ora_drv,libdb4_drv,sqlite3_drv,sqlite_drv,hash_drv,mysql_drv
# above won't work because ORACLE support is broken so
_DBDRV= pgsql_drv,libdb41_drv,sqlite3_drv,sqlite_drv,hash_drv,mysql_drv,
.if defined(WITH_POSTGRESQL)
USE_PGSQL= yes
CONFIGURE_ARGS+= --with-pgsql-includes=${LOCALBASE}/include \
--with-pgsql-libraries=${LOCALBASE}/lib
PLIST_SUB+= PGSQL=""
#PKGNAMESUFFIX= -pgsql
_DBDRV_COUNT:= ${_DBDRV_COUNT}o
.else
PLIST_SUB+= PGSQL="@comment "
_DBDRV:= ${_DBDRV:S/pgsql_drv,//}
.endif
.if defined(WITH_ORACLE)
#BUILD_DEPENDS= ${LOCALBASE}/oracle7/rdbms/lib/libnlsrtl3.a:\
# ${PORTSDIR}/databases/oracle7-client
#CONFIGURE_ARGS+= --with-oracle-home= ${LOCALBASE}/oracle7
#PKGNAMESUFFIX= -oracle
#_DBDRV_COUNT:= ${_DBDRV_COUNT}o
#.else
#_DBDRV:= ${_DBDRV:S/ora_drv,//}
.endif
.if defined(WITH_BDB4)
# change me when we have BDB_VERSOIN in bsd.databases.mk
USE_BDB= 41
CONFIGURE_ARGS+= --with-db4-includes=${LOCALBASE}/include/db41
PLIST_SUB+= DB4=""
#PKGNAMESUFFIX= -bdb41
_DBDRV_COUNT:= ${_DBDRV_COUNT}o
.else
_DBDRV:= ${_DBDRV:S/libdb41_drv,//}
PLIST_SUB+= DB4="@comment "
.endif
.if defined(WITH_SQLITE3)
USE_SQLITE= 3
_DBDRV_COUNT:= ${_DBDRV_COUNT}o
.else
_DBDRV:= ${_DBDRV:S/sqlite3_drv,//}
.endif
.if defined(WITH_SQLITE2)
USE_SQLITE= 2
_DBDRV_COUNT:= ${_DBDRV_COUNT}o
.else
_DBDRV:= ${_DBDRV:S/sqlite_drv,//}
.endif
.if defined(USE_SQLITE)
CONFIGURE_ARGS+= --with-sqlite-includes=${LOCALBASE}/include \
--with-sqlite-libraries=${LOCALBASE}/lib
PLIST_SUB+= SQLITE=""
.else
PLIST_SUB+= SQLITE="@comment "
.endif
.ifdef(WITH_HASH)
PLIST_SUB+= HASH=""
#PKGNAMESUFFIX= -css
_DBDRV_COUNT:= ${_DBDRV_COUNT}o
.else
_DBDRV:= ${_DBDRV:S/hash_drv,//}
PLIST_SUB+= HASH="@comment "
.endif
.ifdef(WITH_MYSQL40)
WANT_MYSQL_VER= 40
#PKGNAMESUFFIX= -mysql40
.elifdef(WITH_MYSQL41)
WANT_MYSQL_VER= 41
#PKGNAMESUFFIX= -mysql41
.elifdef(WITH_MYSQL50)
WANT_MYSQL_VER= 50
#PKGNAMESUFFIX= -mysql50
.endif
.if defined(WITH_MYSQL40) || defined(WITH_MYSQL41) || defined(WITH_MYSQL50)
USE_MYSQL= yes
CONFIGURE_ARGS+= --with-mysql-includes=${LOCALBASE}/include/mysql \
--with-mysql-libraries=${LOCALBASE}/lib/mysql
PLIST_SUB+= MYSQL=""
_DBDRV_COUNT:= ${_DBDRV_COUNT}o
. if defined(WITH_MYSQL_COMPRESS)
CONFIGURE_ARGS+= --enable-client-compression
. endif
SUB_LIST+= MYSQL=mysql
.else
SUB_LIST+= MYSQL=
_DBDRV:= ${_DBDRV:S/mysql_drv,//}
PLIST_SUB+= MYSQL="@comment "
.endif
# now we have all the db backends the user wants and we remove last ','
CONFIGURE_ARGS+= --with-storage-driver=${_DBDRV:S/,$//}
.if ${_DBDRV_COUNT} != "o"
PLIST_SUB+= DYNAMIC=""
.else
PLIST_SUB+= DYNAMIC="@comment "
.endif
.ifdef(WITH_VIRT_USERS)
CONFIGURE_ARGS+= --enable-virtual-users
.endif
.ifdef(WITH_LDAP)
CONFIGURE_ARGS+= --enable-ldap
USE_OPENLDAP= YES
#CPPFLAGS+= -I${LOCALBASE}/include
#LDFLAGS+= -lldap -llber
#CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
.endif
.ifdef(WITH_LONG_USERNAMES)
CONFIGURE_ARGS+= --enable-long-usernames
.endif
.ifdef(WITH_LARGE_SCALE)
CONFIGURE_ARGS+= --enable-large-scale
.endif
.ifdef(WITH_DOMAIN_SCALE)
CONFIGURE_ARGS+= --enable-domain-scale
.endif
# add one 'o' here for each new LDA
LDA_TOTAL_COUNT= ooooooo # 7
LDA_COUNT= ${LDA_TOTAL_COUNT}
.if defined(WITH_CYRUS21_LDA)
RUN_DEPENDS+= ${LOCALBASE}/cyrus/bin/deliver:${PORTSDIR}/mail/cyrus-imapd2
CONFIGURE_ARGS+= --with-delivery-agent='${LOCALBASE}/cyrus/bin/deliver'
LDA_COUNT:= ${LDA_COUNT:S/o//}
.endif
.if defined(WITH_CYRUS22_LDA)
RUN_DEPENDS+= ${LOCALBASE}/cyrus/bin/deliver:${PORTSDIR}/mail/cyrus-imapd22
CONFIGURE_ARGS+= --with-delivery-agent='${LOCALBASE}/cyrus/bin/deliver'
LDA_COUNT:= ${LDA_COUNT:S/o//}
.endif
.ifdef(WITH_EXIM_LDA)
. ifdef(WITH_MYSQL40) || (WITH_MYSQL41)
_EXIM_EXT= -mysql
. elifdef(WITH_POSTGRESQL)
_EXIM_EXT= -postgresql
. endif
RUN_DEPENDS+= exim:${PORTSDIR}/mail/exim${_EXIM_EXT}
CONFIGURE_ARGS+= --with-delivery-agent='${LOCALBASE}/sbin/exim'
LDA_COUNT:= ${LDA_COUNT:S/o//}
.endif
.ifdef(WITH_MAILDROP_LDA)
RUN_DEPENDS+= maildrop:${PORTSDIR}/mail/maildrop
CONFIGURE_ARGS+= --with-delivery-agent='${LOCALBASE}/bin/maildrop'
LDA_COUNT:= ${LDA_COUNT:S/o//}
.endif
.ifdef(WITH_PROCMAIL_LDA)
RUN_DEPENDS+= procmail:${PORTSDIR}/mail/procmail
CONFIGURE_ARGS+= --with-delivery-agent='${LOCALBASE}/bin/procmail'
LDA_COUNT:= ${LDA_COUNT:S/o//}
.endif
.ifdef(WITH_SENDMAIL_LDA) && exists(/usr/sbin/sendmail)
CONFIGURE_ARGS+= --with-delivery-agent=/usr/sbin/sendmail
LDA_COUNT:= ${LDA_COUNT:S/o//}
.else
. ifdef(WITH_SENDMAIL_LDA) && exists(${LOCALBASE}/sbin/sendmail)
CONFIGURE_ARGS+= --with-delivery-agent='${LOCALBASE}/sbin/sendmail'
LDA_COUNT:= ${LDA_COUNT:S/o//}
. endif
.endif
.ifdef(WITH_SENDMAIL)
DSPAM_MODE= 4511
.endif
.ifdef(WITH_POSTFIX_MBC)
DSPAM_MODE= 4511
.endif
.ifdef(WITH_QMAIL)
DSPAM_MODE= 4511
.endif
.ifdef(DSPAM_MODE)
CONFIGURE_ARGS+= --with-dspam-mode=${DSPAM_MODE}
.endif
.ifdef(WITH_CGI)
LIB_DEPENDS+= gd.4:${PORTSDIR}/graphics/gd
RUN_DEPENDS+= ${LOCALBASE}/sbin/apachectl:${PORTSDIR}/${APACHE_PORT}
RUN_DEPENDS+= ${SITE_PERL}/mach/GD.pm:${PORTSDIR}/graphics/p5-GD
RUN_DEPENDS+= ${SITE_PERL}/GD/Graph.pm:${PORTSDIR}/graphics/p5-GD-Graph
RUN_DEPENDS+= ${SITE_PERL}/GD/Graph3d.pm:${PORTSDIR}/graphics/p5-GD-Graph3d
RUN_DEPENDS+= ${SITE_PERL}/GD/Text.pm:${PORTSDIR}/graphics/p5-GD-TextUtil
CONFIGURE_ARGS+=--enable-logging
CONFIGURE_ARGS+=--enable-user-logging
USE_PERL5= yes
PLIST_SUB+= CGI=""
CGI_PATH?= ${PREFIX}/www/vhosts/dspam
_SED_SCRIPT+= -e 's/%%CGI%%//g'
_SED_SCRIPT+= -e 's,%%CGI_PATH%%,${CGI_PATH},g'
#SED_FILES= ${LS} ${WRKSRC}/cgi/*.pl
#SED_FILES+= ${LS} $PWRKSRC}/cgi/*.cgi
.else
PLIST_SUB+= CGI="@comment "
_SED_SCRIPT+= -e '/%%CGI%%/D'
.endif
.ifdef(WITH_TRAIN_SCRIPT)
USE_PERL5= yes
PLIST_SUB+= TRAIN_SCRIPT=""
.else
PLIST_SUB+= TRAIN_SCRIPT="@comment "
.endif
MAN1= dspam.1 dspam_clean.1 dspam_corpus.1 dspam_dump.1 dspam_merge.1 \
dspam_stats.1
MAN3= libdspam.3
MLINKS= libdspam.3 dspam_init.3
MLINKS+= libdspam.3 dspam_create.3
MLINKS+= libdspam.3 dspam_addattribute.3
MLINKS+= libdspam.3 dspam_attach.3
MLINKS+= libdspam.3 dspam_process.3
MLINKS+= libdspam.3 dspam_getsource.3
MLINKS+= libdspam.3 dspam_destroy.3
MLINKS+= libdspam.3 dspam_detach.3
_DOCS= CHANGELOG LICENSE README README.FreeBSD RELEASE.NOTES UPGRADING
_DOCSL= courier.txt exim.txt markov.txt mysql_drv.txt ora_drv.txt \
pgsql_drv.txt pop3filter.txt postfix.txt qmail.txt relay.txt \
sendmail.txt sqlite_drv.txt
.ifndef(MAINT)
pre-everything::
@${ECHO_CMD} ""
@${ECHO_CMD} "Last ${FILESDIR}/UPDATING entry:"
@${GREP} -B 1 -A ${_UPD_LINE_NO} ${PKGNAME} ${FILESDIR}/UPDATING
@${ECHO_CMD} ""
@sleep 5
.else # maintainer only
post-fetch:
. ifndef(STOP)
#. include "/root/ports/upd"
. endif
.endif
pre-extract:
@${ECHO_CMD} ""
@${ECHO_CMD} "Define vars below before make-ing if you need:"
@${ECHO_CMD} ""
@${ECHO_CMD} "SIGNATURE_LIFE=${SIGNATURE_LIFE} (default 15)"
@${ECHO_CMD} "DSPAM_OWNER=${DSPAM_OWNER} (default: root)"
@${ECHO_CMD} "DSPAM_GROUP=${DSPAM_GROUP} (default: mail)"
@${ECHO_CMD} "DSPAM_MODE=${DSPAM_MODE}"
@${ECHO_CMD} "DSPAM_HOME=${DSPAM_HOME} (default: ${_VAR_DIR}/db/dspam)"
@${ECHO_CMD} "DSPAM_HOME_OWNER=${DSPAM_HOME_OWNER}"
@${ECHO_CMD} "DSPAM_HOME_GROUP=${DSPAM_HOME_GROUP}"
@${ECHO_CMD} "DSPAM_HOME_MODE=${DSPAM_HOME_MODE} (default: 0770)"
@${ECHO_CMD} "LOG_DIR=${LOG_DIR} (default: ${_VAR_DIR}/log/dspam)"
. ifdef(WITH_CGI)
@${ECHO_CMD} "Define CGI_PATH before make-ing if you need the CGI files"
@${ECHO_CMD} "installed in other place that this installation's default"
@${ECHO_CMD} "${PREFIX}/www/vhosts/dspam"
. endif
@${ECHO_CMD} ""
@sleep 5
.for old_opt in MAILDROP PROCMAIL TRAD_BAYES ALT_BAYES SPAM_SUBJ \
USER_LOGGING SYSTEM_LOGGING WEBMAIL OPT_IN SAT PARSE_TO_HEADERS \
BROKEN_MTA BROKEN_ERR_CODES SIGNATURE_HEADERS SIGNATURE_ATACH \
HOMEDIR_DOT SIGNATURE_LIFE SQLITE QUARANTINE_AGENT WHITELIST \
POSTGRESQL73 POSTGRESQL74 GRAHAM_BAYES BURTON_BAYES RNB \
TEST_COND NO_BIAS CHI_SQUARE RPV
. if defined(WITH_${old_opt}) || defined(WITHOUT_${old_opt})
@${ECHO_CMD} ""
@${ECHO_CMD} "******************************************************************"
@${ECHO_CMD} "******************************************************************"
@${ECHO_CMD} "Either:"
@${ECHO_CMD} "an old option ${old_opt} or an old"
@${ECHO_CMD} "OPTIONS config-file ${_OPTIONS_READ} has been detected !!!"
@${ECHO_CMD} "Trying to prevent self-shooting this port's make ends here."
@${ECHO_CMD} "You shold always read ${PORTSDIR}/UPDATING before installing/updating"
@${ECHO_CMD} "any port. Please remove/adjust your pkgtools.conf, environment and"
@${ECHO_CMD} "your make command-line and/or do 'make rmconfig' as appropiate."
@${ECHO_CMD} "But before read ${FILESDIR}/UPDATING"
@${ECHO_CMD} "as a lot of things have changed.
@${ECHO_CMD} "******************************************************************"
@${ECHO_CMD} "******************************************************************"
@${ECHO_CMD} ""
@${FALSE}
. endif
.endfor
post-patch:
@${REINPLACE_CMD} -e 's|%%PORTNAME%%|${PORTNAME}|; \
s|%%PKGNAME%%|${PKGNAME}|; s|%%MAINTAINER%%|${MAINTAINER}|; \
s|%%LIBTOOLFLAGS%%|${LIBTOOLFLAGS}|g; \
s|-ldb-4.1|-ldb41|g;' ${WRKSRC}/configure
@${REINPLACE_CMD} -e 's|(libdir)/pkgconfig|(prefix)/libdata/pkgconfig|' \
${WRKSRC}/Makefile.in
@${REINPLACE_CMD} -e 's|where @a-14 > to_days(created_on);|where @a-${SIGNATURE_LIFE} > to_days(created_on);|' \
${WRKSRC}/src/tools.mysql_drv/purge.sql
@${REINPLACE_CMD} -e 's|where @a-14 > to_days(created_on);|where @a-${SIGNATURE_LIFE} > to_days(created_on);|' \
${WRKSRC}/src/tools.mysql_drv/purge-4.1.sql
@${REINPLACE_CMD} -e 's|WHERE CURRENT_DATE - created_on > 14;|WHERE CURRENT_DATE - created_on > ${SIGNATURE_LIFE};|' \
${WRKSRC}/src/tools.pgsql_drv/purge.sql
@${REINPLACE_CMD} -e 's|where SYSDATE-created_on > 14|where SYSDATE-created_on > ${SIGNATURE_LIFE};|' \
${WRKSRC}/src/tools.ora_drv/purge.sql
@${REINPLACE_CMD} -e "s|where date('now')-date(created_on) > 14;|where date('now')-date(created_on) > ${SIGNATURE_LIFE};|" \
${WRKSRC}/src/tools.sqlite_drv/purge-2.sql
@${REINPLACE_CMD} -e "s|where julianday('now')-julianday(created_on) > 14;|where julianday('now')-julianday(created_on) > ${SIGNATURE_LIFE};|" \
${WRKSRC}/src/tools.sqlite_drv/purge-3.sql
.ifdef(WITH_TRAIN_SCRIPT)
@${REINPLACE_CMD} -e "s^%%PERL%%^${PERL}^; s^%%DSPAM_PATH%%^${PREFIX}/bin^" ${WRKSRC}/scripts/train.pl
.endif
pre-configure:
@${ECHO_CMD}
.if !( ${LDA_TOTAL_COUNT:S/o//}==${LDA_COUNT} || ${LDA_TOTAL_COUNT}==${LDA_COUNT} )
@${ECHO_CMD} "You can only use one local delivery agent at once."
@${ECHO_CMD} "See ${LOCALBASE}/etc/dspam.conf for how to chage it at run time."
@${FALSE}
.endif
.if ${_DBDRV}==""
@${ECHO_CMD}
@${ECHO_CMD} "You need to enable at least one database back-end."
@${FALSE}
.endif
.if defined(WITH_NEURAL_NET) && \
!( defined(USE_MYSQL) || defined(WITH_POSTGRESQL) )
@${ECHO_CMD} "You need MySQL or POSTGRESQL to use neural networking."
@${FALSE}
.endif
.if defined(WITH_VIRT_USERS) && !(defined(USE_MYSQL) || \
defined(WITH_POSTGRESQL) || defined(WITH_ORACLE) || defined(WITH_HASH) )
@${ECHO_CMD} "You need MySQL, POSTGRESQL or ORACLE for virtual users."
@${FALSE}
.endif
.if defined(WITH_PREF_EXT) && !( defined(USE_MYSQL) || \
defined(WITH_POSTGRESQL) )
@${ECHO_CMD} "You need MySQL or Postgres for preferences extension"
@${FALSE}
.endif
.if defined(WITH_DAEMON) && !( defined(USE_MYSQL) || \
defined(WITH_POSTGRESQL) || defined(WITH_HASH) )
@${ECHO_CMD} "You need MySQL or Postgres for Daemon mode, because multithreading support is needed"
@${FALSE}
.endif
.if ( defined(WITH_MYSQL40) && defined(WITH_MYSQL50) && defined(WITH_MYSQL41) )
@${ECHO_CMD} "You can compile with only one MySQL version driver."
@${FALSE}
.endif
.if defined(WITH_LDAP) && !( defined(USE_MYSQL) || \
defined(WITH_POSTGRESQL) || defined(USE_SQLITE) )
@${ECHO_CMD} "You need MySQL, Postgres or SQLITE for LDAP."
@${FALSE}
.endif
.if defined(WITH_USER_HOMEDIR) && defined(WITH_CGI)
@${ECHO_CMD} "USER_HOMEDIR and CGI are incopatible"
@${FALSE}
.endif
.if defined(WITH_DOMAIN_SCALE) && defined(WITH_LARGE_SCALE)
@${ECHO_CMD} "DOMAIN_SCALE and LARGE_SCALE are incopatible"
@${FALSE}
.endif
post-install:
${CP} ${WRKSRC}/src/dspam.conf ${WRKSRC}/src/dspam.conf.sample
cd ${WRKSRC}/src/ && \
${INSTALL} -o ${DSPAM_OWNER} -g ${DSPAM_GROUP} -m 0640 \
dspam.conf.sample ${PREFIX}/etc
########
# stupid hack until I figure out where/how to patch
@${MKDIR} ${PREFIX}/libdata/pkgconfig
@${MV} ${PREFIX}/lib/pkgconfig/dspam.pc ${PREFIX}/libdata/pkgconfig/dspam.pc
${TEST} `ls -1 ${PREFIX}/lib/pkgconfig | wc -l` -eq 0 && \
${RM} -R ${PREFIX}/lib/pkgconfig || true
.ifdef(USE_MYSQL)
@${MKDIR} ${EXAMPLESDIR}/mysql
cd ${WRKSRC}/src/tools.mysql_drv && \
${INSTALL_DATA} mysql_objects-4.1.sql \
mysql_objects-space.sql \
mysql_objects-speed.sql \
neural.sql \
purge-4.1.sql purge.sql \
virtual_user_aliases.sql \
virtual_users.sql ${EXAMPLESDIR}/mysql
# @${INSTALL_DATA} ${FILESDIR}/2x_to_3x_db.sql ${EXAMPLESDIR}/mysql
# @${INSTALL_DATA} ${FILESDIR}/310_to_320.my.sql ${EXAMPLESDIR}/mysql
.endif
.ifdef(WITH_POSTGRESQL)
@${MKDIR} ${EXAMPLESDIR}/pgsql
@cd ${WRKSRC}/src/tools.pgsql_drv && \
${INSTALL_DATA} *.sql ${EXAMPLESDIR}/pgsql
.endif
.ifdef(USE_SQLITE)
@${MKDIR} ${EXAMPLESDIR}/sqlite
cd ${WRKSRC}/src/tools.sqlite_drv && \
${INSTALL_DATA} *.sql ${EXAMPLESDIR}/sqlite
.endif
.ifdef(WITH_ORACLE)
@${MKDIR} ${EXAMPLESDIR}/oracle
cd ${WRKSRC}/src/tools.ora_drv && \
${INSTALL_DATA} *.sql ${EXAMPLESDIR}/oracle
.endif
.ifdef(WITH_CGI)
. for I in admin.cgi admingraph.cgi configure.pl dspam.cgi graph.cgi
@${REINPLACE_CMD} -e "s,/usr/bin/perl,${PERL},g" ${WRKSRC}/webui/cgi-bin/${I}
. endfor
cd ${WRKSRC}/webui/cgi-bin && ${MV} configure.pl configure.pl.sample
cd ${WRKSRC}/webui/cgi-bin && ${MKDIR} ${CGI_PATH} && \
${INSTALL_SCRIPT} configure.pl.sample ${CGI_PATH}/ && \
${INSTALL_SCRIPT} *.cgi ${CGI_PATH} && \
${INSTALL_DATA} rgb.txt ${CGI_PATH}/
cd ${WRKSRC}/webui/htdocs && \
${INSTALL_DATA} base.css dspam-logo-small.gif ${CGI_PATH}/
cd ${WRKSRC}/webui/cgi-bin && \
${INSTALL_DATA} default.prefs ${CGI_PATH}/default.prefs.sample
cd ${WRKSRC}/webui/cgi-bin && \
${INSTALL_DATA} admins ${CGI_PATH}/admins.sample
@${MKDIR} ${CGI_PATH}/templates && cd ${WRKSRC}/webui/cgi-bin/templates && \
${INSTALL_DATA} *.html ${CGI_PATH}/templates/
.endif
.ifdef(WITH_TRAIN_SCRIPT)
cd ${WRKSRC}/scripts && \
${INSTALL_SCRIPT} train.pl ${PREFIX}/bin/dspam_train
.endif
@${SED} ${_SED_SCRIPT} ${.CURDIR}/pkg-message > ${WRKSRC}/README.FreeBSD
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
@cd ${WRKSRC} && ${INSTALL_DATA} ${_DOCS} ${DOCSDIR}
@cd ${WRKSRC}/doc && ${INSTALL_DATA} ${_DOCSL} ${DOCSDIR}
@cd ${FILESDIR} && ${INSTALL_DATA} UPDATING ${DOCSDIR}/UPDATING
.endif
@${MKDIR} -m ${DSPAM_HOME_MODE} ${DSPAM_HOME}
@${CHOWN} ${DSPAM_HOME_OWNER}:${DSPAM_HOME_GROUP} ${DSPAM_HOME}
.for _file in firstrun.txt firstspam.txt quarantinefull.txt
if ! ${TEST} -e ${WRKSRC}/txt/${_file}.sample;\
then\
cd ${WRKSRC}/txt && \
${MV} ${_file} ${_file}.sample;\
fi
cd ${WRKSRC}/txt && \
${INSTALL_DATA} ${_file}.sample ${DSPAM_HOME}
.endfor
@${MKDIR} -m ${DSPAM_HOME_MODE} ${LOG_DIR}
@${CAT} ${WRKSRC}/README.FreeBSD
@${ECHO_CMD} "If you haven't defined NOPORTDOCS you can review this"
@${ECHO_CMD} "message in ${DOCSDIR}/README.FreeBSD"
@${ECHO_CMD}
.include <bsd.port.post.mk>
|