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