[packages] Require* calls must now be placed before BuildPackage calls
[openwrt/svn-archive/archive.git] / net / squid / Makefile
index 8e9f4bc2570c8bad46e07a534a38f4840a6e408f..29e3fd54e587ab2b9ecd123a484b11c72224b8f8 100644 (file)
@@ -1,10 +1,9 @@
 #
-# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2006-2009 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
-# $Id$
 
 include $(TOPDIR)/rules.mk
 
@@ -15,10 +14,6 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.squid-cache.org/Versions/v2/2.6/
 PKG_MD5SUM:=eadb138d48320df8b99349121159c6bf
-PKG_CAT:=bzcat
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -31,12 +26,14 @@ endef
 define Package/squid
   $(call Package/squid/Default)
   MENU:=1
-  DEPENDS:=+libopenssl +libpthread
+  DEPENDS:=+libopenssl +libpthread @LINUX_2_6
   TITLE:=full-featured Web proxy cache
-  DESCRIPTION:=\
-       Squid is a high-performance proxy caching server for web clients, \\\
-       supporting FTP, gopher, and HTTP data objects. Unlike traditional \\\
-       caching software, Squid handles all requests in a single, \\\
+endef
+
+define Package/squid/description
+       Squid is a high-performance proxy caching server for web clients, 
+       supporting FTP, gopher, and HTTP data objects. Unlike traditional 
+       caching software, Squid handles all requests in a single, 
        non-blocking, I/O-driven process.
 endef
 
@@ -99,50 +96,50 @@ define Package/squid-mod-ntlm-auth-smb-auth
   TITLE:=Samba NTLM authentication helper
 endef
 
-define Build/Configure
-       $(call Build/Configure/Default, \
-               --datadir=/usr/share/squid \
-               --libexecdir=/usr/lib/squid \
-               --sysconfdir=/etc/squid \
-               --enable-shared \
-               --enable-static \
-               --enable-x-accelerator-vary \
-               --with-pthreads \
-               --with-dl \
-               --enable-icmp \
-               --enable-kill-parent-hack \
-               --enable-arp-acl \
-               --enable-ssl \
-               --enable-htcp \
-               --enable-err-languages=English \
-               --enable-default-err-language=English \
-               --enable-linux-netfilter \
-               --enable-icmp \
-               --enable-external-acl-helpers="" \
-               --enable-underscores \
-               --enable-cache-digests \
-               --enable-referer-log \
-               --enable-delay-pools \
-               --enable-useragent-log \
-               --with-openssl=$(STAGING_DIR)/usr \
-               --enable-auth="basic digest ntlm" \
-               --enable-basic-auth-helpers="getpwnam NCSA SMB" \
-               --enable-ntlm-auth-helpers="fakeauth SMB" \
-               --enable-digest-auth-helpers="password" \
-               --enable-external-acl-helpers="ip_user unix_group" \
-               --enable-epoll \
-               --with-maxfd=4096 \
-       )
-endef
-       
+CONFIGURE_ARGS += \
+       --datadir=/usr/share/squid \
+       --libexecdir=/usr/lib/squid \
+       --sysconfdir=/etc/squid \
+       --enable-shared \
+       --enable-static \
+       --enable-x-accelerator-vary \
+       --with-pthreads \
+       --with-dl \
+       --enable-icmp \
+       --enable-kill-parent-hack \
+       --enable-arp-acl \
+       --enable-ssl \
+       --enable-htcp \
+       --enable-err-languages=English \
+       --enable-default-err-language=English \
+       --enable-linux-netfilter \
+       --enable-icmp \
+       --enable-external-acl-helpers="" \
+       --enable-underscores \
+       --enable-cache-digests \
+       --enable-referer-log \
+       --enable-delay-pools \
+       --enable-useragent-log \
+       --with-openssl=$(STAGING_DIR)/usr \
+       --enable-auth="basic digest ntlm" \
+       --enable-basic-auth-helpers="getpwnam NCSA SMB" \
+       --enable-ntlm-auth-helpers="fakeauth SMB" \
+       --enable-digest-auth-helpers="password" \
+       --enable-external-acl-helpers="ip_user unix_group" \
+       --enable-epoll \
+       --with-maxfd=4096
+
+CONFIGURE_VARS += \
+       ac_cv_header_linux_netfilter_ipv4_h=yes \
+
 define Build/Compile
        # pass INCLUDES to compile host sources against our OpenSSL, not the host one
        $(MAKE) -C $(PKG_BUILD_DIR)/lib \
-               INCLUDES="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
+               INCLUDES="$(TARGET_CPPFLAGS)" \
                all
        $(MAKE) -C $(PKG_BUILD_DIR) \
                DESTDIR="$(PKG_INSTALL_DIR)" \
-               all install
+               install
 endef
 
 define BuildPlugin
@@ -161,7 +158,7 @@ define Package/squid/install
        $(INSTALL_DIR) $(1)/usr/share/squid
        $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/* $(1)/usr/share/squid/
        $(INSTALL_DIR) $(1)/usr/sbin
-       $(CP) $(PKG_INSTALL_DIR)/usr/sbin/squid $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/squid $(1)/usr/sbin/
        $(INSTALL_DIR) $(1)/usr/lib/squid
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/{unlinkd,pinger} $(1)/usr/lib/squid/
 endef
@@ -171,6 +168,11 @@ define Package/squid-mod-cachemgr/install
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/cachemgr.cgi $(1)/www/cgi-bin/
 endef
 
+$(eval $(call RequireHeader,/usr/include/openssl/ssl.h, \
+       $(PKG_NAME) requires the openssl development (named like libssl-dev, \
+       depending of your package manager) package be installed on the host-system. \
+))
+
 $(eval $(call BuildPackage,squid))
 $(eval $(call BuildPackage,squid-mod-cachemgr))
 $(eval $(call BuildPlugin,squid-mod-basic-auth-getpwnam,getpwname_auth))
@@ -182,7 +184,3 @@ $(eval $(call BuildPlugin,squid-mod-external-acl-unix-group,squid_unix_group))
 $(eval $(call BuildPlugin,squid-mod-ntlm-auth-fakeauth,fakeauth_auth))
 $(eval $(call BuildPlugin,squid-mod-ntlm-auth-smb-auth,ntlm_auth))
 
-$(eval $(call RequireHeader,/usr/include/openssl/ssl.h, \
-       $(PKG_NAME) requires the openssl development (named like libssl-dev, \
-       depending of your package manager) package be installed on the host-system. \
-))