add common functions for the new config file format
[openwrt.git] / openwrt / package / squid / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=squid
6 PKG_VERSION:=2.5.STABLE13
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=3e64468e123be1246d17486dab6bee87
9
10 PKG_SOURCE_URL:=http://www.squid-cache.org/Versions/v2/2.5/
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
12 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
13 PKG_CAT:=bzcat
14 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
15
16 AUTH_MODULES:=basic digest ntlm
17 ifneq ($(BR2_PACKAGE_SQUID_MOD_BASIC_AUTH_GETPWNAM),)
18 BASIC_AUTH_HELPERS+= getpwnam
19 endif
20 ifneq ($(BR2_PACKAGE_SQUID_MOD_BASIC_AUTH_NCSA),)
21 BASIC_AUTH_HELPERS+= NCSA
22 endif
23 ifneq ($(BR2_PACKAGE_SQUID_MOD_BASIC_AUTH_SMB),)
24 BASIC_AUTH_HELPERS+= SMB
25 endif
26 ifneq ($(BR2_PACKAGE_SQUID_MOD_BASIC_AUTH_WINBIND),)
27 BASIC_AUTH_HELPERS+= winbind
28 endif
29
30 ifneq ($(BR2_PACKAGE_SQUID_MOD_DIGEST_AUTH_PASSWORD),)
31 DIGEST_AUTH_HELPERS:=password
32 endif
33
34 ifneq ($(BR2_PACKAGE_SQUID_MOD_EXTERNAL_ACL_IP_USER),)
35 EXTERNAL_ACL_HELPERS+= ip_user
36 endif
37 ifneq ($(BR2_PACKAGE_SQUID_MOD_EXTERNAL_ACL_UNIX_GROUP),)
38 EXTERNAL_ACL_HELPERS+= unix_group
39 endif
40 ifneq ($(BR2_PACKAGE_SQUID_MOD_EXTERNAL_ACL_WINBIND_GROUP),)
41 EXTERNAL_ACL_HELPERS+= winbind_group
42 endif
43
44 ifneq ($(BR2_PACKAGE_SQUID_MOD_NTLM_AUTH_FAKEAUTH),)
45 NTLM_AUTH_HELPERS+= fakeauth
46 endif
47 ifneq ($(BR2_PACKAGE_SQUID_MOD_NTLM_AUTH_SMB_AUTH),)
48 NTLM_AUTH_HELPERS+= SMB
49 endif
50 ifneq ($(BR2_PACKAGE_SQUID_MOD_NTLM_AUTH_WINBIND_AUTH),)
51 NTLM_AUTH_HELPERS+= winbind
52 endif
53
54 include $(TOPDIR)/package/rules.mk
55
56 define PKG_mod_template
57
58 $$(IPKG_$(1)):
59 install -d -m0755 $$(IDIR_$(1))/usr/lib/squid
60 if [ -e $(PKG_INSTALL_DIR)/usr/lib/squid/$(2) ]; then \
61 $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/$(2) $$(IDIR_$(1))/usr/lib/squid/ ; \
62 fi
63 $(RSTRIP) $$(IDIR_$(1))
64 $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
65
66 endef
67
68
69 $(eval $(call PKG_template,SQUID,$(PKG_NAME),$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
70 $(eval $(call PKG_template,SQUID_MOD_BASIC_AUTH_GETPWNAM,$(PKG_NAME)-mod-basic-auth-getpwnam,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
71 $(eval $(call PKG_template,SQUID_MOD_BASIC_AUTH_NCSA,$(PKG_NAME)-mod-basic-auth-ncsa,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
72 $(eval $(call PKG_template,SQUID_MOD_BASIC_AUTH_SMB,$(PKG_NAME)-mod-basic-auth-smb,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
73 $(eval $(call PKG_template,SQUID_MOD_BASIC_AUTH_WINBIND,$(PKG_NAME)-mod-basic-auth-winbind,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
74 $(eval $(call PKG_template,SQUID_MOD_DIGEST_AUTH_PASSWORD,$(PKG_NAME)-mod-digest-auth-password,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
75 $(eval $(call PKG_template,SQUID_MOD_EXTERNAL_ACL_IP_USER,$(PKG_NAME)-mod-external-acl-ip-user,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
76 $(eval $(call PKG_template,SQUID_MOD_EXTERNAL_ACL_UNIX_GROUP,$(PKG_NAME)-mod-external-acl-unix-group,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
77 $(eval $(call PKG_template,SQUID_MOD_EXTERNAL_ACL_WINBIND_GROUP,$(PKG_NAME)-mod-external-acl-winbind-group,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
78 $(eval $(call PKG_template,SQUID_MOD_NTLM_AUTH_FAKEAUTH,$(PKG_NAME)-mod-ntlm-auth-fakeauth,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
79 $(eval $(call PKG_template,SQUID_MOD_NTLM_AUTH_SMB_AUTH,$(PKG_NAME)-mod-ntlm-auth-smb-auth,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
80 $(eval $(call PKG_template,SQUID_MOD_NTLM_AUTH_WINBIND_AUTH,$(PKG_NAME)-mod-ntlm-auth-winbind-auth,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
81
82 $(eval $(call PKG_mod_template,SQUID_MOD_BASIC_AUTH_GETPWNAM,getpwname_auth))
83 $(eval $(call PKG_mod_template,SQUID_MOD_BASIC_AUTH_LDAP,ldap))
84 $(eval $(call PKG_mod_template,SQUID_MOD_BASIC_AUTH_NCSA,ncsa_auth))
85 $(eval $(call PKG_mod_template,SQUID_MOD_BASIC_AUTH_SMB,smb_auth))
86 $(eval $(call PKG_mod_template,SQUID_MOD_BASIC_AUTH_WINBIND,wb_auth))
87 $(eval $(call PKG_mod_template,SQUID_MOD_DIGEST_AUTH_PASSWORD,digest_pw_auth))
88 $(eval $(call PKG_mod_template,SQUID_MOD_EXTERNAL_ACL_IP_USER,ip_user_check))
89 $(eval $(call PKG_mod_template,SQUID_MOD_EXTERNAL_ACL_LDAP_GROUP,ldap_auth))
90 $(eval $(call PKG_mod_template,SQUID_MOD_EXTERNAL_ACL_UNIX_GROUP,squid_unix_group))
91 $(eval $(call PKG_mod_template,SQUID_MOD_EXTERNAL_ACL_WINBIND_GROUP,wb_group))
92 $(eval $(call PKG_mod_template,SQUID_MOD_NTLM_AUTH_FAKEAUTH,fakeauth_auth))
93 $(eval $(call PKG_mod_template,SQUID_MOD_NTLM_AUTH_SMB_AUTH,ntlm_auth))
94 $(eval $(call PKG_mod_template,SQUID_MOD_NTLM_AUTH_WINBIND_AUTH,wb_ntlmauth))
95
96 $(PKG_BUILD_DIR)/.configured:
97 (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
98 $(TARGET_CONFIGURE_OPTS) \
99 CFLAGS="$(TARGET_CFLAGS)" \
100 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
101 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
102 ac_cv_sizeof_void_p=4 \
103 ac_cv_sizeof_short=2 \
104 ac_cv_sizeof_int=4 \
105 ac_cv_sizeof_long=4 \
106 ac_cv_sizeof_long_long=8 \
107 ac_cv_sizeof___int64=0 \
108 ac_cv_sizeof_int16_t=2 \
109 ac_cv_sizeof_uint16_t=2 \
110 ac_cv_sizeof_u_int16_t=2 \
111 ac_cv_sizeof_int32_t=4 \
112 ac_cv_sizeof_uint32_t=4 \
113 ac_cv_sizeof_u_int32_t=4 \
114 ac_cv_sizeof_int64_t=8 \
115 ac_cv_sizeof_uint64_t=8 \
116 ac_cv_sizeof_u_int64_t=8 \
117 ac_cv_func_setresuid=no \
118 ac_cv_func_va_copy=no \
119 ac_cv_func___va_copy=no \
120 ./configure \
121 --target=$(GNU_TARGET_NAME) \
122 --host=$(GNU_TARGET_NAME) \
123 --build=$(GNU_HOST_NAME) \
124 --program-prefix="" \
125 --program-suffix="" \
126 --prefix=/usr \
127 --exec-prefix=/usr \
128 --bindir=/usr/bin \
129 --datadir=/usr/share/squid \
130 --includedir=/usr/include \
131 --infodir=/usr/share/info \
132 --libdir=/usr/lib \
133 --libexecdir=/usr/lib/squid \
134 --localstatedir=/var \
135 --mandir=/usr/share/man \
136 --sbindir=/usr/sbin \
137 --sysconfdir=/etc/squid \
138 $(DISABLE_LARGEFILE) \
139 --enable-shared \
140 --enable-static \
141 --with-gnu-ld \
142 --enable-x-accelerator-vary \
143 --with-pthreads \
144 --with-dl \
145 --enable-icmp \
146 --enable-kill-parent-hack \
147 --enable-arp-acl \
148 --enable-ssl \
149 --enable-htcp \
150 --enable-err-languages=English \
151 --enable-default-err-language=English \
152 --enable-linux-netfilter \
153 --enable-icmp \
154 --enable-external-acl-helpers="" \
155 --enable-underscores \
156 --enable-cache-digests \
157 --enable-referer-log \
158 --enable-delay-pools \
159 --enable-useragent-log \
160 --with-openssl=$(STAGING_DIR)/usr \
161 --enable-auth="$(AUTH_MODULES)" \
162 --enable-basic-auth-helpers="$(BASIC_AUTH_HELPERS)" \
163 --enable-ntlm-auth-helpers="$(NTLM_AUTH_HELPERS)" \
164 --enable-digest-auth-helpers="$(DIGEST_AUTH_HELPERS)" \
165 --enable-external-acl-helpers="$(EXTERNAL_ACL_HELPERS)" \
166 );
167 touch $@
168
169 $(PKG_BUILD_DIR)/.built:
170 rm -rf $(PKG_INSTALL_DIR)
171 mkdir -p $(PKG_INSTALL_DIR)
172 $(MAKE) -C $(PKG_BUILD_DIR) \
173 DESTDIR=$(PKG_INSTALL_DIR) \
174 all install
175 touch $@
176
177 $(IPKG_SQUID):
178 install -d -m0755 $(IDIR_SQUID)/etc/squid
179 $(CP) $(PKG_INSTALL_DIR)/etc/squid/mime.conf $(IDIR_SQUID)/etc/squid/
180 $(CP) $(PKG_INSTALL_DIR)/etc/squid/squid.conf $(IDIR_SQUID)/etc/squid/
181 install -d -m0755 $(IDIR_SQUID)/usr/share/squid
182 $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/* $(IDIR_SQUID)/usr/share/squid/
183 install -d -m0755 $(IDIR_SQUID)/usr/sbin
184 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/squid $(IDIR_SQUID)/usr/sbin/
185 $(RSTRIP) $(IDIR_SQUID)
186 $(IPKG_BUILD) $(IDIR_SQUID) $(PACKAGE_DIR)
This page took 0.061929 seconds and 5 git commands to generate.