[package] update squid to 2.7STABLE9, thanks to Tomasz Mon
[packages.git] / net / squid / Makefile
1 #
2 # Copyright (C) 2006-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=squid
11 PKG_VERSION:=2.7.STABLE9
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://www.squid-cache.org/Versions/v2/2.7/
16 PKG_MD5SUM:=3c6642c85470b1079207d43bba25a819
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/squid/Default
21   SECTION:=net
22   CATEGORY:=Network
23   URL:=http://www.squid-cache.org/
24 endef
25
26 define Package/squid
27   $(call Package/squid/Default)
28   MENU:=1
29   DEPENDS:=+libopenssl +libpthread @LINUX_2_6
30   TITLE:=full-featured Web proxy cache
31 endef
32
33 define Package/squid/description
34         Squid is a high-performance proxy caching server for web clients,
35         supporting FTP, gopher, and HTTP data objects. Unlike traditional
36         caching software, Squid handles all requests in a single,
37         non-blocking, I/O-driven process.
38 endef
39
40 define Package/squid/conffiles
41 /etc/squid/mime.conf
42 /etc/squid/squid.conf
43 endef
44
45 define Package/squid-mod-cachemgr
46   $(call Package/squid/Default)
47   DEPENDS:=squid
48   TITLE:=Web based proxy manager and reporting tool
49 endef
50
51 define Package/squid-mod-basic-auth-getpwnam
52   $(call Package/squid/Default)
53   DEPENDS:=squid
54   TITLE:=getpwnam basic authentication helper
55 endef
56
57 define Package/squid-mod-basic-auth-ncsa
58   $(call Package/squid/Default)
59   DEPENDS:=squid
60   TITLE:=NCSA basic authentication helper
61 endef
62
63 define Package/squid-mod-basic-auth-smb
64   $(call Package/squid/Default)
65   DEPENDS:=squid
66   TITLE:=Samba basic authentication helper
67 endef
68
69 define Package/squid-mod-digest-auth-password
70   $(call Package/squid/Default)
71   DEPENDS:=squid
72   TITLE:=Password digest authentication helper
73 endef
74
75 define Package/squid-mod-external-acl-ip-user
76   $(call Package/squid/Default)
77   DEPENDS:=squid
78   TITLE:=IP user external ACL helper
79 endef
80
81 define Package/squid-mod-external-acl-unix-group
82   $(call Package/squid/Default)
83   DEPENDS:=squid
84   TITLE:=Unix group external ACL helper
85 endef
86
87 define Package/squid-mod-ntlm-auth-fakeauth
88   $(call Package/squid/Default)
89   DEPENDS:=squid
90   TITLE:=Fakeauth NTLM authentication helper
91 endef
92
93 define Package/squid-mod-ntlm-auth-smb-auth
94   $(call Package/squid/Default)
95   DEPENDS:=squid
96   TITLE:=Samba NTLM authentication helper
97 endef
98
99 CONFIGURE_ARGS += \
100         --datadir=/usr/share/squid \
101         --libexecdir=/usr/lib/squid \
102         --sysconfdir=/etc/squid \
103         --enable-shared \
104         --enable-static \
105         --enable-x-accelerator-vary \
106         --with-pthreads \
107         --with-dl \
108         --enable-icmp \
109         --enable-kill-parent-hack \
110         --enable-arp-acl \
111         --enable-ssl \
112         --enable-htcp \
113         --enable-err-languages=English \
114         --enable-default-err-language=English \
115         --enable-linux-netfilter \
116         --enable-icmp \
117         --enable-external-acl-helpers="" \
118         --enable-underscores \
119         --enable-cache-digests \
120         --enable-referer-log \
121         --enable-delay-pools \
122         --enable-useragent-log \
123         --with-openssl=$(STAGING_DIR)/usr \
124         --enable-auth="basic digest ntlm" \
125         --enable-basic-auth-helpers="getpwnam NCSA SMB" \
126         --enable-ntlm-auth-helpers="fakeauth SMB" \
127         --enable-digest-auth-helpers="password" \
128         --enable-external-acl-helpers="ip_user unix_group" \
129         --enable-epoll \
130         --with-maxfd=4096
131
132 CONFIGURE_VARS += \
133         ac_cv_header_linux_netfilter_ipv4_h=yes \
134         ac_cv_epoll_works=yes \
135
136 define Build/Compile
137         # pass INCLUDES to compile host sources against our OpenSSL, not the host one
138         $(MAKE) -C $(PKG_BUILD_DIR)/lib \
139                 all
140         $(MAKE) -C $(PKG_BUILD_DIR) \
141                 DESTDIR="$(PKG_INSTALL_DIR)" \
142                 install
143 endef
144
145 define BuildPlugin
146   define Package/$(1)/install
147         $(INSTALL_DIR) $$(1)/usr/lib/squid
148         $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/$(2) $$(1)/usr/lib/squid/
149   endef
150
151   $$(eval $$(call BuildPackage,$(1)))
152 endef
153
154 define Package/squid/install
155         $(INSTALL_DIR) $(1)/etc/squid
156         $(CP) $(PKG_INSTALL_DIR)/etc/squid/mime.conf $(1)/etc/squid/
157         $(CP) $(PKG_INSTALL_DIR)/etc/squid/squid.conf $(1)/etc/squid/
158         $(INSTALL_DIR) $(1)/usr/share/squid
159         $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/* $(1)/usr/share/squid/
160         $(INSTALL_DIR) $(1)/usr/sbin
161         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/squid $(1)/usr/sbin/
162         $(INSTALL_DIR) $(1)/usr/lib/squid
163         $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/{unlinkd,pinger,logfile-daemon} $(1)/usr/lib/squid/
164 endef
165
166 define Package/squid-mod-cachemgr/install
167         $(INSTALL_DIR) $(1)/www/cgi-bin/
168         $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/cachemgr.cgi $(1)/www/cgi-bin/
169 endef
170
171 $(eval $(call RequireHeader,/usr/include/openssl/ssl.h, \
172         $(PKG_NAME) requires the openssl development (named like libssl-dev, \
173         depending of your package manager) package be installed on the host-system. \
174 ))
175
176 $(eval $(call BuildPackage,squid))
177 $(eval $(call BuildPackage,squid-mod-cachemgr))
178 $(eval $(call BuildPlugin,squid-mod-basic-auth-getpwnam,getpwname_auth))
179 $(eval $(call BuildPlugin,squid-mod-basic-auth-ncsa,ncsa_auth))
180 $(eval $(call BuildPlugin,squid-mod-basic-auth-smb,smb_auth))
181 $(eval $(call BuildPlugin,squid-mod-digest-auth-password,digest_pw_auth))
182 $(eval $(call BuildPlugin,squid-mod-external-acl-ip-user,ip_user_check))
183 $(eval $(call BuildPlugin,squid-mod-external-acl-unix-group,squid_unix_group))
184 $(eval $(call BuildPlugin,squid-mod-ntlm-auth-fakeauth,fakeauth_auth))
185 $(eval $(call BuildPlugin,squid-mod-ntlm-auth-smb-auth,ntlm_auth))
186