Port squid to -ng
[openwrt/svn-archive/archive.git] / net / squid / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8 #
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=squid
12 PKG_VERSION:=2.5.STABLE13
13 PKG_RELEASE:=1
14 PKG_MD5SUM:=3e64468e123be1246d17486dab6bee87
15
16 PKG_SOURCE_URL:=http://www.squid-cache.org/Versions/v2/2.5/
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
19 PKG_CAT:=bzcat
20 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/squid
25 SECTION:=net
26 CATEGORY:=Network
27 DEPENDS:=+libopenssl
28 TITLE:=full-featured Web proxy cache
29 DESCRIPTION:=Squid is a high-performance proxy caching server for web clients,\\\
30 supporting FTP, gopher, and HTTP data objects. Unlike traditional\\\
31 caching software, Squid handles all requests in a single,\\\
32 non-blocking, I/O-driven process.\\\
33 URL:=http://www.squid-cache.org
34 MENU:=1
35 endef
36
37 define Package/squid-mod-basic-auth-getpwnam
38 SECTION:=net
39 CATEGORY:=Network
40 DEPENDS:=squid
41 TITLE:=getpwnam basic authentication helper
42 endef
43
44 define Package/squid-mod-basic-auth-ncsa
45 SECTION:=net
46 CATEGORY:=Network
47 DEPENDS:=squid
48 TITLE:=NCSA basic authentication helper
49 endef
50
51 define Package/squid-mod-basic-auth-smb
52 SECTION:=net
53 CATEGORY:=Network
54 DEPENDS:=squid
55 TITLE:=Samba basic authentication helper
56 endef
57
58 define Package/squid-mod-basic-auth-winbind
59 SECTION:=net
60 CATEGORY:=Network
61 DEPENDS:=squid
62 TITLE:=Winbind basic authentication helper
63 endef
64
65 define Package/squid-mod-digest-auth-password
66 SECTION:=net
67 CATEGORY:=Network
68 DEPENDS:=squid
69 TITLE:=Password digest authentication helper
70 endef
71
72 define Package/squid-mod-external-acl-ip-user
73 SECTION:=net
74 CATEGORY:=Network
75 DEPENDS:=squid
76 TITLE:=IP user external ACL helper
77 endef
78
79 define Package/squid-mod-external-acl-unix-group
80 SECTION:=net
81 CATEGORY:=Network
82 DEPENDS:=squid
83 TITLE:=Unix group external ACL helper
84 endef
85
86 define Package/squid-mod-external-acl-winbind-group
87 SECTION:=net
88 CATEGORY:=Network
89 DEPENDS:=squid
90 TITLE:=Winbind group external ACL helper
91 endef
92
93 define Package/squid-mod-ntlm-auth-fakeauth
94 SECTION:=net
95 CATEGORY:=Network
96 DEPENDS:=squid
97 TITLE:=Fakeauth NTLM authentication helper
98 endef
99
100 define Package/squid-mod-ntlm-auth-smb-auth
101 SECTION:=net
102 CATEGORY:=Network
103 DEPENDS:=squid
104 TITLE:=Samba NTLM authentication helper
105 endef
106
107 define Package/squid-mod-ntlm-auth-winbind-auth
108 SECTION:=net
109 CATEGORY:=Network
110 DEPENDS:=squid
111 TITLE:=Winbind NTLM authentication helper
112 endef
113
114 define Build/Configure
115 (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
116 $(TARGET_CONFIGURE_OPTS) \
117 CFLAGS="$(TARGET_CFLAGS)" \
118 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
119 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
120 ac_cv_sizeof_void_p=4 \
121 ac_cv_sizeof_short=2 \
122 ac_cv_sizeof_int=4 \
123 ac_cv_sizeof_long=4 \
124 ac_cv_sizeof_long_long=8 \
125 ac_cv_sizeof___int64=0 \
126 ac_cv_sizeof_int16_t=2 \
127 ac_cv_sizeof_uint16_t=2 \
128 ac_cv_sizeof_u_int16_t=2 \
129 ac_cv_sizeof_int32_t=4 \
130 ac_cv_sizeof_uint32_t=4 \
131 ac_cv_sizeof_u_int32_t=4 \
132 ac_cv_sizeof_int64_t=8 \
133 ac_cv_sizeof_uint64_t=8 \
134 ac_cv_sizeof_u_int64_t=8 \
135 ac_cv_func_setresuid=no \
136 ac_cv_func_va_copy=no \
137 ac_cv_func___va_copy=no \
138 ./configure \
139 --target=$(GNU_TARGET_NAME) \
140 --host=$(GNU_TARGET_NAME) \
141 --build=$(GNU_HOST_NAME) \
142 --program-prefix="" \
143 --program-suffix="" \
144 --prefix=/usr \
145 --exec-prefix=/usr \
146 --bindir=/usr/bin \
147 --datadir=/usr/share/squid \
148 --includedir=/usr/include \
149 --infodir=/usr/share/info \
150 --libdir=/usr/lib \
151 --libexecdir=/usr/lib/squid \
152 --localstatedir=/var \
153 --mandir=/usr/share/man \
154 --sbindir=/usr/sbin \
155 --sysconfdir=/etc/squid \
156 $(DISABLE_LARGEFILE) \
157 --enable-shared \
158 --enable-static \
159 --with-gnu-ld \
160 --enable-x-accelerator-vary \
161 --with-pthreads \
162 --with-dl \
163 --enable-icmp \
164 --enable-kill-parent-hack \
165 --enable-arp-acl \
166 --enable-ssl \
167 --enable-htcp \
168 --enable-err-languages=English \
169 --enable-default-err-language=English \
170 --enable-linux-netfilter \
171 --enable-icmp \
172 --enable-external-acl-helpers="" \
173 --enable-underscores \
174 --enable-cache-digests \
175 --enable-referer-log \
176 --enable-delay-pools \
177 --enable-useragent-log \
178 --with-openssl=$(STAGING_DIR)/usr \
179 --enable-auth="basic digest ntlm" \
180 --enable-basic-auth-helpers="getpwnam NCSA SMB winbind" \
181 --enable-ntlm-auth-helpers="fakeauth SMB winbind" \
182 --enable-digest-auth-helpers="password" \
183 --enable-external-acl-helpers="ip_user unix_group winbind_group" \
184 );
185 endef
186
187 define Build/Compile
188 rm -rf $(PKG_INSTALL_DIR)
189 mkdir -p $(PKG_INSTALL_DIR)
190 $(MAKE) -C $(PKG_BUILD_DIR) \
191 DESTDIR=$(PKG_INSTALL_DIR) \
192 all install
193 endef
194
195 define Package/squid/install
196 install -d -m0755 $(1)/etc/squid
197 $(CP) $(PKG_INSTALL_DIR)/etc/squid/mime.conf $(1)/etc/squid/
198 $(CP) $(PKG_INSTALL_DIR)/etc/squid/squid.conf $(1)/etc/squid/
199 install -d -m0755 $(1)/usr/share/squid
200 $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/* $(1)/usr/share/squid/
201 install -d -m0755 $(1)/usr/sbin
202 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/squid $(1)/usr/sbin/
203 endef
204
205 define BuildPlugin
206 define Package/$(1)/install
207 install -d -m0755 $$(1)/usr/lib/squid
208 $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/$(2) $$(1)/usr/lib/squid/
209 endef
210
211 $$(eval $$(call BuildPackage,$(1)))
212 endef
213
214 $(eval $(call BuildPackage,squid))
215 $(eval $(call BuildPlugin,squid-mod-basic-auth-getpwnam,getpwname_auth))
216 $(eval $(call BuildPlugin,squid-mod-basic-auth-ncsa,ncsa_auth))
217 $(eval $(call BuildPlugin,squid-mod-basic-auth-smb,smb_auth))
218 $(eval $(call BuildPlugin,squid-mod-basic-auth-winbind,wb_auth))
219 $(eval $(call BuildPlugin,squid-mod-digest-auth-password,digest_pw_auth))
220 $(eval $(call BuildPlugin,squid-mod-external-acl-ip-user,ip_user_check))
221 $(eval $(call BuildPlugin,squid-mod-external-acl-unix-group,squid_unix_group))
222 $(eval $(call BuildPlugin,squid-mod-external-acl-winbind-group,wb_group))
223 $(eval $(call BuildPlugin,squid-mod-ntlm-auth-fakeauth,fakeauth_auth))
224 $(eval $(call BuildPlugin,squid-mod-ntlm-auth-smb-auth,ntlm_auth))
225 $(eval $(call BuildPlugin,squid-mod-ntlm-auth-winbind-auth,wb_ntlmauth))
226