1b7789f97e40152f96ba2edbe539324c181ea0a5
[pkgsrc.git] / mail / dspam / options.mk
1 # $NetBSD: options.mk,v 1.24 2009/08/17 19:09:13 sno Exp $
2
3 .if defined(DSPAM_DELIVERY_AGENT) && !empty(DSPAM_DELIVERY_AGENT:Mcustom)
4 DSPAM_DELIVERY_AGENT:=  ${DSPAM_DELIVERY_AGENT_ARGS}
5 .endif
6
7 PKG_OPTIONS_VAR=        PKG_OPTIONS.dspam
8 PKG_SUPPORTED_OPTIONS=  largescale homedir long-usernames graphs domainscale
9 PKG_SUPPORTED_OPTIONS+= clamav syslog debug dspam-verbose-debug
10
11 PKG_OPTIONS_LEGACY_OPTS+=       verbose-debug:dspam-verbose-debug
12 PKG_OPTIONS_LEGACY_OPTS+=       virtualusers:dspam-virtualusers
13 PKG_OPTIONS_LEGACY_OPTS+=       preferences-extension:dspam-preferences-extension
14
15 ###
16 ### DSPAM_DELIVERY_AGENT is the tool called to to deliver messages.
17 ###     It can either be "procmail", "maildrop" or the path to a
18 ###     command (and arguments) used for local mail delivery.  Set this
19 ###     to the path to the sendmail binary to reinject mail back into
20 ###     the MTA instead of doing local delivery.
21 ### Possible: procmail, maildrop or custom (e.g, /usr/sbin/sendmail)
22 ### Default: procmail
23 ###
24 DSPAM_DELIVERY_AGENT?=          procmail
25 BUILD_DEFS+=            DSPAM_DELIVERY_AGENT
26 .if !empty(DSPAM_DELIVERY_AGENT:Mprocmail)
27 DSPAM_DELIVERY_AGENT_BIN?=      ${LOCALBASE}/bin/procmail
28 BUILD_DEPENDS+=         procmail-[0-9]*:../../mail/procmail
29 CONFIGURE_ARGS+=        --with-delivery-agent=${DSPAM_DELIVERY_AGENT_BIN:Q}
30 .elif !empty(DSPAM_DELIVERY_AGENT:Mmaildrop)
31 DSPAM_DELIVERY_AGENT_BIN?=      ${LOCALBASE}/bin/maildrop
32 BUILD_DEPENDS+=         maildrop-[0-9]*:../../mail/maildrop
33 CONFIGURE_ARGS+=        --with-delivery-agent=${DSPAM_DELIVERY_AGENT_BIN:Q}
34 .elif !empty(DSPAM_DELIVERY_AGENT)
35 DSPAM_DELIVERY_AGENT_BIN?=      ${DSPAM_DELIVERY_AGENT}
36 CONFIGURE_ARGS+=        --with-delivery-agent=${DSPAM_DELIVERY_AGENT_BIN:Q}
37 .else
38 PKG_FAIL_REASON+=       "${PKGBASE}: unknown delivery agent \`${DSPAM_DELIVERY_AGENT}'"
39 .endif
40
41 PLIST_VARS+=            hash mysql pgsql sqlite
42
43 ###
44 ### This is the backend database used to store the DSPAM signatures as
45 ### well as other state information.  The recommended storage driver is
46 ### "mysql", even for small installations.
47 ### Possible: mysql, pgsql, sqlite, sqlite3 or hash
48 ### Default: hash
49 ###
50 DSPAM_STORAGE_DRIVER?=  hash
51 BUILD_DEFS+=            DSPAM_STORAGE_DRIVER
52 .if empty(DSPAM_STORAGE_DRIVER:Mmysql) && empty(DSPAM_STORAGE_DRIVER:Mpgsql)
53 PKG_OPTIONS:=           ${PKG_OPTIONS:Ndspam-virtualusers}
54 PKG_OPTIONS:=           ${PKG_OPTIONS:Ndspam-preferences-extension}
55 PKG_OPTIONS:=           ${PKG_OPTIONS:Nldap}
56 .endif
57 .if !empty(DSPAM_STORAGE_DRIVER:Mhash)
58 CONFIGURE_ARGS+=        --with-storage-driver=hash_drv
59 PLIST.hash=             yes
60 .elif !empty(DSPAM_STORAGE_DRIVER:Mmysql)
61 .  include "../../mk/mysql.buildlink3.mk"
62 CONFIGURE_ARGS+=        --enable-mysql4-initialization
63 CONFIGURE_ARGS+=        --with-storage-driver=mysql_drv
64 CONFIGURE_ARGS+=        \
65         --with-mysql-includes=${BUILDLINK_PREFIX.mysql-client}/include/mysql \
66         --with-mysql-libraries=${BUILDLINK_PREFIX.mysql-client}/lib
67 PLIST.mysql=            yes
68 .elif !empty(DSPAM_STORAGE_DRIVER:Mpgsql)
69 .  include "../../mk/pgsql.buildlink3.mk"
70 CONFIGURE_ARGS+=        --with-storage-driver=pgsql_drv
71 CONFIGURE_ARGS+=        \
72         --with-pgsql-includes=${PGSQL_PREFIX}/include/postgresql        \
73         --with-pgsql-libraries=${PGSQL_PREFIX}/lib
74 PLIST.pgsql=            yes
75 .elif !empty(DSPAM_STORAGE_DRIVER:Msqlite)
76 .  include "../../databases/sqlite/buildlink3.mk"
77 CONFIGURE_ARGS+=        --with-storage-driver=sqlite_drv
78 PLIST.sqlite=           yes
79 .elif !empty(DSPAM_STORAGE_DRIVER:Msqlite3)
80 .  include "../../databases/sqlite3/buildlink3.mk"
81 CONFIGURE_ARGS+=        --with-storage-driver=sqlite3_drv
82 PLIST.sqlite=           yes
83 .else
84 PKG_FAIL_REASON+=       "${PKGBASE}: unknown storage driver \\'${DSPAM_STORAGE_DRIVER}\\'"
85 .endif
86
87 # daemon mode only supports MySQL, PostgreSQL or hash
88 .if !empty(DSPAM_STORAGE_DRIVER:Mmysql) || \
89     !empty(DSPAM_STORAGE_DRIVER:Mpgsql) || \
90     !empty(DSPAM_STORAGE_DRIVER:Mhash)
91 .  if empty(MACHINE_PLATFORM:MNetBSD-1.*)
92 CONFIGURE_ARGS+=        --enable-daemon
93 .  endif
94 .endif
95
96 ###
97 ### The following are only available for mysql and pgsql backends.
98 ###
99 .if !empty(DSPAM_STORAGE_DRIVER:Mmysql) || !empty(DSPAM_STORAGE_DRIVER:Mpgsql)
100 PKG_SUPPORTED_OPTIONS+= dspam-preferences-extension dspam-virtualusers ldap
101 .endif
102
103 .include "../../mk/bsd.options.mk"
104
105 ###
106 ### Used to store user preferences in the backend instead of flat files
107 ### (built-in method).
108 ###
109 .if !empty(PKG_OPTIONS:Mdspam-preferences-extension)
110 CONFIGURE_ARGS+=        --enable-preferences-extension
111 .endif
112
113 ###
114 ### Tells DSPAM to create virtual user ids.  Use this if your users are
115 ### not system users.
116 ###
117 .if !empty(PKG_OPTIONS:Mdspam-virtualusers)
118 CONFIGURE_ARGS+=        --enable-virtual-users
119 .endif
120
121 ###
122 ### Enable LDAP support via libldap
123 ###
124 .if !empty(PKG_OPTIONS:Mldap)
125 CONFIGURE_ARGS+=        --enable-ldap
126 .endif
127
128 ###
129 ### Use of home directory dot file for opt-in/opt-out
130 ###
131 .if !empty(PKG_OPTIONS:Mhomedir)
132 CONFIGURE_ARGS+=        --enable-homedir
133 .endif
134
135 ###
136 ### Enable DSPAM's graph.cgi to produce graphs of spam statistics.
137 ###
138 .if !empty(PKG_OPTIONS:Mgraphs)
139 DEPENDS+=               p5-GD-Graph3d-[0-9]*:../../graphics/p5-GD-Graph3d
140 .endif
141
142 ###
143 ### Switch for large-scale implementation.  User data will be stored as
144 ### $DSPAM_HOME/data/u/s/user instead of $DSPAM_HOME/data/user
145 ###
146 .if !empty(PKG_OPTIONS:Mlargescale)
147 CONFIGURE_ARGS+=        --enable-large-scale
148 .endif
149
150 ###
151 ### Support long usernames.
152 ###
153 .if !empty(PKG_OPTIONS:Mlong-usernames)
154 CONFIGURE_ARGS+=        --enable-long-usernames
155 .endif
156
157 ###
158 ### Support for a domain scale implementation.
159 ###
160 .if !empty(PKG_OPTIONS:Mdomainscale)
161 CONFIGURE_ARGS+=        --enable-domain-scale
162 .endif
163
164 ###
165 ### These are the flags used when invoking ps(1) to list all processes.
166 ###
167 BUILD_DEFS+=            DSPAM_PSFLAGS
168 .if ${OPSYS} == "Linux" || ${OPSYS} == "SunOS"
169 DSPAM_PSFLAGS?=         -deaf
170 .else
171 DSPAM_PSFLAGS?=         aux
172 .endif
173
174 ###
175 ### Enables support for Clam Antivirus. DSPAM can interface directly with
176 ### clamd to perform virus scanning and can be configured to react in
177 ### different ways to viruses.
178 ###
179 .if !empty(PKG_OPTIONS:Mclamav)
180 CONFIGURE_ARGS+=        --enable-clamav
181 .include "../../mail/clamav/buildlink3.mk"
182 .endif
183
184 ###
185 ### Enable syslog support, otherwise
186 ### set flat logfile pathname for logging
187 ###
188 .if !empty(PKG_OPTIONS:Msyslog)
189 CONFIGURE_ARGS+=        --enable-syslog
190 .else
191 CONFIGURE_ARGS+=        --disable-syslog
192 CONFIGURE_ARGS+=        --with-logfile=${DSPAM_LOGFILE}
193 .endif
194
195 ###
196 ### Enable debugging support for DSPAM.
197 ### Don't enable this unless something needs testing!
198 ###
199 .if !empty(PKG_OPTIONS:Mdebug)
200 CONFIGURE_ARGS+=        --enable-debug
201 .endif
202
203 ###
204 ### Cause DSPAM produce verbose debug output and write them into
205 ### LOGDIR/dspam.debug file. Implies '--enable-debug'.
206 ### Never enable this for production builds !
207 ###
208 .if !empty(PKG_OPTIONS:Mdspam-verbose-debug)
209 CONFIGURE_ARGS+=        --enable-verbose-debug
210 .endif