Add a requireheader for squid, should fix it (#2205)
[packages.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 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/conffiles
44 /etc/squid/mime.conf
45 /etc/squid/squid.conf
46 endef
47
48 define Package/squid-mod-cachemgr
49   $(call Package/squid/Default)
50   DEPENDS:=squid
51   TITLE:=Web based proxy manager and reporting tool
52 endef
53
54 define Package/squid-mod-basic-auth-getpwnam
55   $(call Package/squid/Default)
56   DEPENDS:=squid
57   TITLE:=getpwnam basic authentication helper
58 endef
59
60 define Package/squid-mod-basic-auth-ncsa
61   $(call Package/squid/Default)
62   DEPENDS:=squid
63   TITLE:=NCSA basic authentication helper
64 endef
65
66 define Package/squid-mod-basic-auth-smb
67   $(call Package/squid/Default)
68   DEPENDS:=squid
69   TITLE:=Samba basic authentication helper
70 endef
71
72 define Package/squid-mod-digest-auth-password
73   $(call Package/squid/Default)
74   DEPENDS:=squid
75   TITLE:=Password digest authentication helper
76 endef
77
78 define Package/squid-mod-external-acl-ip-user
79   $(call Package/squid/Default)
80   DEPENDS:=squid
81   TITLE:=IP user external ACL helper
82 endef
83
84 define Package/squid-mod-external-acl-unix-group
85   $(call Package/squid/Default)
86   DEPENDS:=squid
87   TITLE:=Unix group external ACL helper
88 endef
89
90 define Package/squid-mod-ntlm-auth-fakeauth
91   $(call Package/squid/Default)
92   DEPENDS:=squid
93   TITLE:=Fakeauth NTLM authentication helper
94 endef
95
96 define Package/squid-mod-ntlm-auth-smb-auth
97   $(call Package/squid/Default)
98   DEPENDS:=squid
99   TITLE:=Samba NTLM authentication helper
100 endef
101
102 define Build/Configure
103         $(call Build/Configure/Default, \
104                 --datadir=/usr/share/squid \
105                 --libexecdir=/usr/lib/squid \
106                 --sysconfdir=/etc/squid \
107                 --enable-shared \
108                 --enable-static \
109                 --enable-x-accelerator-vary \
110                 --with-pthreads \
111                 --with-dl \
112                 --enable-icmp \
113                 --enable-kill-parent-hack \
114                 --enable-arp-acl \
115                 --enable-ssl \
116                 --enable-htcp \
117                 --enable-err-languages=English \
118                 --enable-default-err-language=English \
119                 --enable-linux-netfilter \
120                 --enable-icmp \
121                 --enable-external-acl-helpers="" \
122                 --enable-underscores \
123                 --enable-cache-digests \
124                 --enable-referer-log \
125                 --enable-delay-pools \
126                 --enable-useragent-log \
127                 --with-openssl=$(STAGING_DIR)/usr \
128                 --enable-auth="basic digest ntlm" \
129                 --enable-basic-auth-helpers="getpwnam NCSA SMB" \
130                 --enable-ntlm-auth-helpers="fakeauth SMB" \
131                 --enable-digest-auth-helpers="password" \
132                 --enable-external-acl-helpers="ip_user unix_group" \
133                 --enable-epoll \
134                 --with-maxfd=4096 \
135         )
136 endef
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                 INCLUDES="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
142                 all
143         $(MAKE) -C $(PKG_BUILD_DIR) \
144                 DESTDIR="$(PKG_INSTALL_DIR)" \
145                 all install
146 endef
147
148 define BuildPlugin
149   define Package/$(1)/install
150         $(INSTALL_DIR) $$(1)/usr/lib/squid
151         $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/$(2) $$(1)/usr/lib/squid/
152   endef
153
154   $$(eval $$(call BuildPackage,$(1)))
155 endef
156
157 define Package/squid/install
158         $(INSTALL_DIR) $(1)/etc/squid
159         $(CP) $(PKG_INSTALL_DIR)/etc/squid/mime.conf $(1)/etc/squid/
160         $(CP) $(PKG_INSTALL_DIR)/etc/squid/squid.conf $(1)/etc/squid/
161         $(INSTALL_DIR) $(1)/usr/share/squid
162         $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/* $(1)/usr/share/squid/
163         $(INSTALL_DIR) $(1)/usr/sbin
164         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/squid $(1)/usr/sbin/
165         $(INSTALL_DIR) $(1)/usr/lib/squid
166         $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/{unlinkd,pinger} $(1)/usr/lib/squid/
167 endef
168
169 define Package/squid-mod-cachemgr/install
170         $(INSTALL_DIR) $(1)/www/cgi-bin/
171         $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/cachemgr.cgi $(1)/www/cgi-bin/
172 endef
173
174 $(eval $(call BuildPackage,squid))
175 $(eval $(call BuildPackage,squid-mod-cachemgr))
176 $(eval $(call BuildPlugin,squid-mod-basic-auth-getpwnam,getpwname_auth))
177 $(eval $(call BuildPlugin,squid-mod-basic-auth-ncsa,ncsa_auth))
178 $(eval $(call BuildPlugin,squid-mod-basic-auth-smb,smb_auth))
179 $(eval $(call BuildPlugin,squid-mod-digest-auth-password,digest_pw_auth))
180 $(eval $(call BuildPlugin,squid-mod-external-acl-ip-user,ip_user_check))
181 $(eval $(call BuildPlugin,squid-mod-external-acl-unix-group,squid_unix_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
185 $(eval $(call RequireHeader,/usr/include/openssl/ssl.h, \
186         $(PKG_NAME) requires the openssl development (named like libssl-dev, \
187         depending of your package manager) package be installed on the host-system. \
188 ))