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