Pullup ticket #2800.
[pkgsrc.git] / www / squid / options.mk
1 # $NetBSD: options.mk,v 1.14 2008/09/12 14:59:52 taca Exp $
2
3 PKG_OPTIONS_VAR=        PKG_OPTIONS.squid
4 PKG_SUPPORTED_OPTIONS=  snmp ssl \
5                 squid-backend-aufs squid-backend-null \
6                 squid-backend-ufs squid-carp squid-unlinkd \
7                 squid-ldap-helper squid-pam-helper
8
9 PKG_OPTIONS_LEGACY_OPTS=        aufs:squid-backend-aufs \
10         coss:squid-backend-coss diskd:squid-backend-diskd \
11         null:squid-backend-null ufs:squid-backend-ufs \
12         linux-netfilter:squid-netfilter ipf-transparent:squid-ipf \
13         pf-transparent:squid-pf unlinkd:squid-unlinkd \
14         arp-acl:squid-arp-acl pam-helper:squid-pam-helper carp:squid-carp
15
16 PLIST_VARS+=    coss diskd snmp unlinkd
17 PLIST_VARS+=    ba_LDAP ba_MSNT ba_NCSA ba_PAM ba_YP ba_getpwnam
18 PLIST_VARS+=    da_ldap da_password
19 PLIST_VARS+=    na_SMB na_fakeauth
20 PLIST_VARS+=    eacl_ip_user eacl_ldap_group eacl_unix_group
21
22 #
23 # most of options are enabled by default except aufs.  aufs backend isn't
24 # tested well.
25 PKG_SUGGESTED_OPTIONS=  squid-carp snmp ssl squid-pam-helper squid-unlinkd
26
27 .include "../../mk/bsd.prefs.mk"
28
29 #
30 # Squid 3.0's COSS support is not stable now.
31 #
32 .if !empty(PKGNAME:Msquid-2.[0-9]*.[0-9]*)
33 PKG_SUPPORTED_OPTIONS+= squid-backend-coss 
34 PKG_SUGGESTED_OPTIONS+= squid-backend-coss
35 .endif
36
37 .if !empty(OPSYS:MLinux)
38 PKG_SUPPORTED_OPTIONS+= squid-netfilter
39 .endif
40
41 # some release of NetBSD lacks <ipl.h> header of IP Filter 4.x
42 .if ${OPSYS} != "NetBSD" || ${OS_VERSION:M[01].*} || exists(/usr/include/netinet/ipl.h)
43 PKG_SUPPORTED_OPTIONS+= squid-ipf
44 .endif
45
46 .if ${OPSYS} == "FreeBSD" || ${OPSYS} == "NetBSD" || ${OPSYS} == "OpenBSD" || ${OPSYS} == "DragonFly"
47 PKG_SUPPORTED_OPTIONS+= squid-pf
48 .endif
49
50 .if (${OPSYS} == "FreeBSD" || ${OPSYS} == "NetBSD") && \
51         !empty(PKG_SUPPORTED_OPTIONS:Msquid-ipf)
52 PKG_SUGGESTED_OPTIONS+= squid-ipf
53 .endif
54
55 .if ${OPSYS} == "OpenBSD"
56 PKG_SUGGESTED_OPTIONS+= squid-pf
57 .endif
58
59 # Darwin dosen't support System V IPC support.
60 .if empty(OPSYS:MDarwin)
61 PKG_SUPPORTED_OPTIONS+= squid-backend-diskd
62 PKG_SUGGESTED_OPTIONS+= squid-backend-diskd
63 PLIST.diskd=            yes
64 .endif
65
66 # limited platform support squid-arp-acl
67 .if !empty(OPSYS:MFreeBSD) || !empty(OPSYS:MNetBSD) || !empty(OPSYS:MOpenBSD) || !empty(OPSYS:MLinux) || !empty(OPSYS:MSunOS)
68 PKG_SUPPORTED_OPTIONS+= squid-arp-acl
69 .endif
70
71 .include "../../mk/bsd.options.mk"
72
73 SQUID_BACKENDS?=                ufs null
74 SQUID_BASIC_AUTH_HELPERS?=      getpwnam MSNT NCSA YP
75 SQUID_DIGEST_AUTH_HELPERS?=     password
76 SQUID_NTLM_AUTH_HELPERS?=       fakeauth SMB
77 SQUID_EXTERNAL_ACL_HELPERS?=    ip_user unix_group
78
79 #
80 # squid's code has preference as:
81 #       squid-ipf > squid-pf > squid-netfilter
82 # So, options.mk introduce preference as:
83 #       squid-netfilter > squid-pf > squid-ipf
84 #
85 .if !empty(PKG_OPTIONS:Msquid-netfilter)
86 CONFIGURE_ARGS+=        --enable-linux-netfilter
87 .elif !empty(PKG_OPTIONS:Msquid-pf)
88 CONFIGURE_ARGS+=        --enable-pf-transparent
89 .elif !empty(PKG_OPTIONS:Msquid-ipf)
90 CONFIGURE_ARGS+=        --enable-ipf-transparent
91 .endif
92
93 .if !empty(PKG_OPTIONS:Msquid-arp-acl)
94 CONFIGURE_ARGS+=        --enable-arp-acl
95 .endif
96
97 .if !empty(PKG_OPTIONS:Msquid-carp)
98 CONFIGURE_ARGS+=        --enable-carp
99 .endif
100
101 .if !empty(PKG_OPTIONS:Msquid-ldap-helper)
102 .include "../../databases/openldap-client/buildlink3.mk"
103 SQUID_BASIC_AUTH_HELPERS+=      LDAP
104 SQUID_DIGEST_AUTH_HELPERS+=     ldap
105 SQUID_EXTERNAL_ACL_HELPERS+=    ldap_group
106 .endif
107
108 .if !empty(PKG_OPTIONS:Msquid-pam-helper)
109 .  include "../../mk/pam.buildlink3.mk"
110 SQUID_BASIC_AUTH_HELPERS+=      PAM
111 .endif
112
113 .if !empty(PKG_OPTIONS:Msnmp)
114 CONFIGURE_ARGS+=        --enable-snmp
115 PLIST.snmp=             yes
116 .endif
117
118 .if !empty(PKG_OPTIONS:Mssl)
119 CONFIGURE_ARGS+=        --enable-ssl --with-openssl=${SSLBASE:Q}
120 .include "../../security/openssl/buildlink3.mk"
121 .endif
122
123 .if !empty(PKG_OPTIONS:Msquid-backend-aufs)
124 SQUID_BACKENDS+=        aufs
125 PTHREAD_AUTO_VARS=      yes
126 .include "../../mk/pthread.buildlink3.mk"
127 .endif
128
129 .if !empty(PKG_OPTIONS:Msquid-backend-coss)
130 .if empty(PKG_OPTIONS:Msquid-backend-aufs)
131 SQUID_BACKENDS+=        aufs
132 PTHREAD_AUTO_VARS=      yes
133 .include "../../mk/pthread.buildlink3.mk"
134 .endif
135 SQUID_BACKENDS+=        coss
136 PLIST.coss=             yes
137 .endif
138
139 .if !empty(PKG_OPTIONS:Msquid-backend-diskd)
140 SQUID_BACKENDS+=        diskd
141 PLIST.diskd=            yes
142 .endif
143
144 .if empty(PKG_OPTIONS:Msquid-unlinkd)
145 CONFIGURE_ARGS+=        --disable-unlinkd
146 .else
147 PLIST.unlinkd=          yes
148 .endif
149
150 .if !empty(SQUID_BASIC_AUTH_HELPERS)
151 CONFIGURE_ARGS+= --enable-basic-auth-helpers=${SQUID_BASIC_AUTH_HELPERS:Q}
152 .for i in ${SQUID_BASIC_AUTH_HELPERS}
153 PLIST.ba_${i}=          yes
154 .endfor
155 .endif
156
157 .if !empty(SQUID_DIGEST_AUTH_HELPERS)
158 CONFIGURE_ARGS+= --enable-digest-auth-helpers=${SQUID_DIGEST_AUTH_HELPERS:Q}
159 .for i in ${SQUID_DIGEST_AUTH_HELPERS}
160 PLIST.da_${i}=          yes
161 .endfor
162 .endif
163
164 .if !empty(SQUID_NTLM_AUTH_HELPERS)
165 CONFIGURE_ARGS+= --enable-ntlm-auth-helpers=${SQUID_NTLM_AUTH_HELPERS:Q}
166 .for i in ${SQUID_NTLM_AUTH_HELPERS}
167 PLIST.na_${i}=          yes
168 .endfor
169 .endif
170
171 .if !empty(SQUID_EXTERNAL_ACL_HELPERS)
172 CONFIGURE_ARGS+= --enable-external-acl-helpers=${SQUID_EXTERNAL_ACL_HELPERS:Q}
173 .for i in ${SQUID_EXTERNAL_ACL_HELPERS}
174 PLIST.eacl_${i}=        yes
175 .endfor
176 .endif