ba9ed67f0f377bc80fb69e2a4e55edb33e88b1d0
[openwrt/svn-archive/archive.git] / net / squid / Makefile
1 #
2 # Copyright (C) 2006-2009 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.6.STABLE23
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.6/
16 PKG_MD5SUM:=71aa24580f8a538ad84037bf2ac6f078
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 INCLUDES="$(TARGET_CPPFLAGS)" \
140 all
141 $(MAKE) -C $(PKG_BUILD_DIR) \
142 DESTDIR="$(PKG_INSTALL_DIR)" \
143 install
144 endef
145
146 define BuildPlugin
147 define Package/$(1)/install
148 $(INSTALL_DIR) $$(1)/usr/lib/squid
149 $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/$(2) $$(1)/usr/lib/squid/
150 endef
151
152 $$(eval $$(call BuildPackage,$(1)))
153 endef
154
155 define Package/squid/install
156 $(INSTALL_DIR) $(1)/etc/squid
157 $(CP) $(PKG_INSTALL_DIR)/etc/squid/mime.conf $(1)/etc/squid/
158 $(CP) $(PKG_INSTALL_DIR)/etc/squid/squid.conf $(1)/etc/squid/
159 $(INSTALL_DIR) $(1)/usr/share/squid
160 $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/* $(1)/usr/share/squid/
161 $(INSTALL_DIR) $(1)/usr/sbin
162 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/squid $(1)/usr/sbin/
163 $(INSTALL_DIR) $(1)/usr/lib/squid
164 $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/{unlinkd,pinger} $(1)/usr/lib/squid/
165 endef
166
167 define Package/squid-mod-cachemgr/install
168 $(INSTALL_DIR) $(1)/www/cgi-bin/
169 $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/cachemgr.cgi $(1)/www/cgi-bin/
170 endef
171
172 $(eval $(call RequireHeader,/usr/include/openssl/ssl.h, \
173 $(PKG_NAME) requires the openssl development (named like libssl-dev, \
174 depending of your package manager) package be installed on the host-system. \
175 ))
176
177 $(eval $(call BuildPackage,squid))
178 $(eval $(call BuildPackage,squid-mod-cachemgr))
179 $(eval $(call BuildPlugin,squid-mod-basic-auth-getpwnam,getpwname_auth))
180 $(eval $(call BuildPlugin,squid-mod-basic-auth-ncsa,ncsa_auth))
181 $(eval $(call BuildPlugin,squid-mod-basic-auth-smb,smb_auth))
182 $(eval $(call BuildPlugin,squid-mod-digest-auth-password,digest_pw_auth))
183 $(eval $(call BuildPlugin,squid-mod-external-acl-ip-user,ip_user_check))
184 $(eval $(call BuildPlugin,squid-mod-external-acl-unix-group,squid_unix_group))
185 $(eval $(call BuildPlugin,squid-mod-ntlm-auth-fakeauth,fakeauth_auth))
186 $(eval $(call BuildPlugin,squid-mod-ntlm-auth-smb-auth,ntlm_auth))
187