1 # $NetBSD: options.mk,v 1.24 2009/08/17 19:09:13 sno Exp $
3 .if defined(DSPAM_DELIVERY_AGENT) && !empty(DSPAM_DELIVERY_AGENT:Mcustom)
4 DSPAM_DELIVERY_AGENT:= ${DSPAM_DELIVERY_AGENT_ARGS}
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
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
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)
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}
38 PKG_FAIL_REASON+= "${PKGBASE}: unknown delivery agent \`${DSPAM_DELIVERY_AGENT}'"
41 PLIST_VARS+= hash mysql pgsql sqlite
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
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}
57 .if !empty(DSPAM_STORAGE_DRIVER:Mhash)
58 CONFIGURE_ARGS+= --with-storage-driver=hash_drv
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
65 --with-mysql-includes=${BUILDLINK_PREFIX.mysql-client}/include/mysql \
66 --with-mysql-libraries=${BUILDLINK_PREFIX.mysql-client}/lib
68 .elif !empty(DSPAM_STORAGE_DRIVER:Mpgsql)
69 . include "../../mk/pgsql.buildlink3.mk"
70 CONFIGURE_ARGS+= --with-storage-driver=pgsql_drv
72 --with-pgsql-includes=${PGSQL_PREFIX}/include/postgresql \
73 --with-pgsql-libraries=${PGSQL_PREFIX}/lib
75 .elif !empty(DSPAM_STORAGE_DRIVER:Msqlite)
76 . include "../../databases/sqlite/buildlink3.mk"
77 CONFIGURE_ARGS+= --with-storage-driver=sqlite_drv
79 .elif !empty(DSPAM_STORAGE_DRIVER:Msqlite3)
80 . include "../../databases/sqlite3/buildlink3.mk"
81 CONFIGURE_ARGS+= --with-storage-driver=sqlite3_drv
84 PKG_FAIL_REASON+= "${PKGBASE}: unknown storage driver \\'${DSPAM_STORAGE_DRIVER}\\'"
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
97 ### The following are only available for mysql and pgsql backends.
99 .if !empty(DSPAM_STORAGE_DRIVER:Mmysql) || !empty(DSPAM_STORAGE_DRIVER:Mpgsql)
100 PKG_SUPPORTED_OPTIONS+= dspam-preferences-extension dspam-virtualusers ldap
103 .include "../../mk/bsd.options.mk"
106 ### Used to store user preferences in the backend instead of flat files
107 ### (built-in method).
109 .if !empty(PKG_OPTIONS:Mdspam-preferences-extension)
110 CONFIGURE_ARGS+= --enable-preferences-extension
114 ### Tells DSPAM to create virtual user ids. Use this if your users are
115 ### not system users.
117 .if !empty(PKG_OPTIONS:Mdspam-virtualusers)
118 CONFIGURE_ARGS+= --enable-virtual-users
122 ### Enable LDAP support via libldap
124 .if !empty(PKG_OPTIONS:Mldap)
125 CONFIGURE_ARGS+= --enable-ldap
129 ### Use of home directory dot file for opt-in/opt-out
131 .if !empty(PKG_OPTIONS:Mhomedir)
132 CONFIGURE_ARGS+= --enable-homedir
136 ### Enable DSPAM's graph.cgi to produce graphs of spam statistics.
138 .if !empty(PKG_OPTIONS:Mgraphs)
139 DEPENDS+= p5-GD-Graph3d-[0-9]*:../../graphics/p5-GD-Graph3d
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
146 .if !empty(PKG_OPTIONS:Mlargescale)
147 CONFIGURE_ARGS+= --enable-large-scale
151 ### Support long usernames.
153 .if !empty(PKG_OPTIONS:Mlong-usernames)
154 CONFIGURE_ARGS+= --enable-long-usernames
158 ### Support for a domain scale implementation.
160 .if !empty(PKG_OPTIONS:Mdomainscale)
161 CONFIGURE_ARGS+= --enable-domain-scale
165 ### These are the flags used when invoking ps(1) to list all processes.
167 BUILD_DEFS+= DSPAM_PSFLAGS
168 .if ${OPSYS} == "Linux" || ${OPSYS} == "SunOS"
169 DSPAM_PSFLAGS?= -deaf
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.
179 .if !empty(PKG_OPTIONS:Mclamav)
180 CONFIGURE_ARGS+= --enable-clamav
181 .include "../../mail/clamav/buildlink3.mk"
185 ### Enable syslog support, otherwise
186 ### set flat logfile pathname for logging
188 .if !empty(PKG_OPTIONS:Msyslog)
189 CONFIGURE_ARGS+= --enable-syslog
191 CONFIGURE_ARGS+= --disable-syslog
192 CONFIGURE_ARGS+= --with-logfile=${DSPAM_LOGFILE}
196 ### Enable debugging support for DSPAM.
197 ### Don't enable this unless something needs testing!
199 .if !empty(PKG_OPTIONS:Mdebug)
200 CONFIGURE_ARGS+= --enable-debug
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 !
208 .if !empty(PKG_OPTIONS:Mdspam-verbose-debug)
209 CONFIGURE_ARGS+= --enable-verbose-debug