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