Merge pull request #14308 from neheb/spi2
[feed/packages.git] / net / squid / Makefile
1 #
2 # Copyright (C) 2006-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=squid
11 PKG_VERSION:=4.13
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=http://www3.us.squid-cache.org/Versions/v4/ \
16 http://www2.pl.squid-cache.org/Versions/v4/ \
17 http://www.squid-cache.org/Versions/v4/
18 PKG_HASH:=6891a0f540e60779b4f24f1802a302f813c6f473ec7336a474ed68c3e2e53ee0
19
20 PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
21 PKG_LICENSE:=GPL-2.0-or-later
22 PKG_CPE_ID:=cpe:/a:squid-cache:squid
23
24 PKG_FIXUP:=autoreconf
25 PKG_INSTALL:=1
26 PKG_BUILD_PARALLEL:=1
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define Package/squid/Default
31 SECTION:=net
32 CATEGORY:=Network
33 SUBMENU:=Web Servers/Proxies
34 URL:=http://www.squid-cache.org/
35 endef
36
37 define Package/squid
38 $(call Package/squid/Default)
39 MENU:=1
40 DEPENDS:=+libpthread +librt +libltdl +libstdcpp +libatomic +USE_GLIBC:libbsd
41 DEPENDS+= +SQUID_use-gnutls:libgnutls +SQUID_use-openssl:libopenssl
42 DEPENDS+= +SQUID_with-libcap:libcap
43 DEPENDS+= +SQUID_with-nettle:libnettle
44 DEPENDS+= +SQUID_with-expat:libexpat
45 DEPENDS+= +SQUID_with-libxml2:libxml2
46 USERID:=squid=137:squid=137
47 TITLE:=full-featured Web proxy cache
48 endef
49
50 define Package/squid/description
51 Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more.
52 It reduces bandwidth and improves response times by caching and reusing
53 frequently-requested web pages.
54 endef
55
56 define Package/squid/config
57 source "$(SOURCE)/Config.in"
58 endef
59
60 define Package/squid/conffiles
61 /etc/config/squid
62 /etc/squid/squid.conf
63 endef
64
65 define Package/squid-mod-cachemgr
66 $(call Package/squid/Default)
67 DEPENDS:=squid
68 TITLE:=Web based proxy manager and reporting tool
69 endef
70
71 CONFIGURE_ARGS += \
72 BUILDCXX=$(HOSTCXX_NOCACHE) \
73 --config-cache \
74 --datadir=/usr/share/squid \
75 --libexecdir=/usr/lib/squid \
76 --sysconfdir=/etc/squid \
77 --enable-shared \
78 --disable-static \
79 --enable-delay-pools \
80 --enable-kill-parent-hack \
81 --enable-ssl \
82 --enable-cache-digests \
83 --enable-linux-netfilter \
84 --disable-unlinkd \
85 --enable-x-accelerator-vary \
86 --disable-translation \
87 --disable-auto-locale \
88 --with-dl \
89 --with-pthreads \
90 --enable-epoll \
91 --with-maxfd=2048 \
92 --disable-ecap \
93 --disable-external-acl-helpers \
94 --disable-arch-native \
95 --with-krb5-config=no \
96 --without-mit-krb5 \
97 --without-netfilter-conntrack \
98 --disable-ident-lookups \
99 $(if $(CONFIG_SQUID_auth-basic),--enable,--disable)-auth-basic \
100 $(if $(CONFIG_SQUID_auth-digest),--enable,--disable)-auth-digest \
101 $(if $(CONFIG_SQUID_auth-ntlm),--enable,--disable)-auth-ntlm \
102 $(if $(CONFIG_SQUID_auth-negotiate),--enable,--disable)-auth-negotiate \
103 $(if $(CONFIG_SQUID_enable-ipv6),--enable,--disable)-dlmalloc \
104 $(if $(CONFIG_SQUID_enable-ipv6),--enable,--disable)-ipv6 \
105 $(if $(CONFIG_SQUID_enable-ssl-crtd),--enable-ssl-crtd) \
106 $(if $(CONFIG_SQUID_use-gnutls),--with,--without)-gnutls \
107 $(if $(CONFIG_SQUID_use-gnutls),--without-openssl) \
108 $(if $(CONFIG_SQUID_use-gnutls),,--with-openssl="$(STAGING_DIR)/usr") \
109 $(if $(CONFIG_SQUID_enable-icmp),--enable,--disable)-icmp \
110 $(if $(CONFIG_SQUID_enable-icap-client),--enable,--disable)-icap-client \
111 $(if $(CONFIG_SQUID_enable-snmp),--enable,--disable)-snmp \
112 $(if $(CONFIG_SQUID_with-libcap),--with,--without)-libcap \
113 $(if $(CONFIG_SQUID_with-nettle),--with,--without)-nettle \
114 $(if $(CONFIG_SQUID_with-expat),--with,--without)-expat \
115 $(if $(CONFIG_SQUID_with-libxml2),--with,--without)-libxml2
116
117 CONFIGURE_VARS += \
118 ac_cv_header_linux_netfilter_ipv4_h=yes \
119 ac_cv_epoll_works=yes
120
121 TARGET_CFLAGS += -Wno-error
122 TARGET_LDFLAGS += -latomic
123
124 define Package/squid/install
125 $(INSTALL_DIR) $(1)/usr/sbin
126 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/squid $(1)/usr/sbin/
127
128 $(INSTALL_DIR) $(1)/usr/lib/squid
129 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/squid/* $(1)/usr/lib/squid/
130
131 $(INSTALL_DIR) $(1)/etc/config
132 $(INSTALL_CONF) ./files/squid.config $(1)/etc/config/squid
133
134 $(INSTALL_DIR) $(1)/etc/squid
135 $(CP) $(PKG_INSTALL_DIR)/etc/squid/* $(1)/etc/squid/
136 $(INSTALL_CONF) ./files/squid.conf $(1)/etc/squid/
137
138 $(INSTALL_DIR) $(1)/etc/init.d/
139 $(INSTALL_BIN) ./files/squid.init $(1)/etc/init.d/squid
140
141 $(INSTALL_DIR) $(1)/usr/share/squid/icons/
142 $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/icons/* $(1)/usr/share/squid/icons/
143 $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/mib.txt $(1)/usr/share/squid/
144
145 $(INSTALL_DIR) $(1)/usr/share/squid/errors/templates/
146 $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/errors/templates/* $(1)/usr/share/squid/errors/templates/
147 endef
148
149 define Package/squid-mod-cachemgr/install
150 $(INSTALL_DIR) $(1)/www/cgi-bin/
151 $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/cachemgr.cgi $(1)/www/cgi-bin/
152 endef
153
154 $(eval $(call BuildPackage,squid))
155 $(eval $(call BuildPackage,squid-mod-cachemgr))