Merge pull request #12849 from TDT-AG/pr/20200717-docker-ce
[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.12
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:=f42a03c8b3dc020722c88bf1a87da8cb0c087b2f66b41d8256c77ee1b527e317
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_BUILD_PARALLEL:=1
25 PKG_INSTALL:=1
26 PKG_FIXUP:=autoreconf
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) \
73 BUILDCXXFLAGS=$(if $(HOST_CXXFLAGS),$(HOST_CXXFLAGS),-O2) \
74 --config-cache \
75 --datadir=/usr/share/squid \
76 --libexecdir=/usr/lib/squid \
77 --sysconfdir=/etc/squid \
78 --enable-shared \
79 --disable-static \
80 --enable-delay-pools \
81 --enable-kill-parent-hack \
82 --enable-ssl \
83 --enable-cache-digests \
84 --enable-linux-netfilter \
85 --disable-unlinkd \
86 --enable-x-accelerator-vary \
87 --disable-translation \
88 --disable-auto-locale \
89 --with-dl \
90 --with-pthreads \
91 --enable-epoll \
92 --with-maxfd=2048 \
93 --disable-ecap \
94 --disable-external-acl-helpers \
95 --disable-arch-native \
96 --with-krb5-config=no \
97 --without-mit-krb5 \
98 --without-netfilter-conntrack \
99 --disable-ident-lookups \
100 $(if $(CONFIG_SQUID_auth-basic),--enable,--disable)-auth-basic \
101 $(if $(CONFIG_SQUID_auth-digest),--enable,--disable)-auth-digest \
102 $(if $(CONFIG_SQUID_auth-ntlm),--enable,--disable)-auth-ntlm \
103 $(if $(CONFIG_SQUID_auth-negotiate),--enable,--disable)-auth-negotiate \
104 $(if $(CONFIG_SQUID_enable-ipv6),--enable,--disable)-dlmalloc \
105 $(if $(CONFIG_SQUID_enable-ipv6),--enable,--disable)-ipv6 \
106 $(if $(CONFIG_SQUID_enable-ssl-crtd),--enable-ssl-crtd) \
107 $(if $(CONFIG_SQUID_use-gnutls),--with,--without)-gnutls \
108 $(if $(CONFIG_SQUID_use-gnutls),--without-openssl) \
109 $(if $(CONFIG_SQUID_use-gnutls),,--with-openssl="$(STAGING_DIR)/usr") \
110 $(if $(CONFIG_SQUID_enable-icmp),--enable,--disable)-icmp \
111 $(if $(CONFIG_SQUID_enable-icap-client),--enable,--disable)-icap-client \
112 $(if $(CONFIG_SQUID_enable-snmp),--enable,--disable)-snmp \
113 $(if $(CONFIG_SQUID_with-libcap),--with,--without)-libcap \
114 $(if $(CONFIG_SQUID_with-nettle),--with,--without)-nettle \
115 $(if $(CONFIG_SQUID_with-expat),--with,--without)-expat \
116 $(if $(CONFIG_SQUID_with-libxml2),--with,--without)-libxml2
117
118 CONFIGURE_VARS += \
119 ac_cv_header_linux_netfilter_ipv4_h=yes \
120 ac_cv_epoll_works=yes
121
122 TARGET_CFLAGS += -Wno-error
123 TARGET_LDFLAGS += -latomic
124
125 define Build/Compile
126 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/lib all
127 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
128 DESTDIR="$(PKG_INSTALL_DIR)" \
129 install
130 endef
131
132 define Package/squid/install
133 $(INSTALL_DIR) $(1)/usr/sbin
134 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/squid $(1)/usr/sbin/
135
136 $(INSTALL_DIR) $(1)/usr/lib/squid
137 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/squid/* $(1)/usr/lib/squid/
138
139 $(INSTALL_DIR) $(1)/etc/config
140 $(INSTALL_CONF) ./files/squid.config $(1)/etc/config/squid
141
142 $(INSTALL_DIR) $(1)/etc/squid
143 $(CP) $(PKG_INSTALL_DIR)/etc/squid/* $(1)/etc/squid/
144 $(INSTALL_CONF) ./files/squid.conf $(1)/etc/squid/
145
146 $(INSTALL_DIR) $(1)/etc/init.d/
147 $(INSTALL_BIN) ./files/squid.init $(1)/etc/init.d/squid
148
149 $(INSTALL_DIR) $(1)/usr/share/squid/icons/
150 $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/icons/* $(1)/usr/share/squid/icons/
151 $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/mib.txt $(1)/usr/share/squid/
152
153 $(INSTALL_DIR) $(1)/usr/share/squid/errors/templates/
154 $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/errors/templates/* $(1)/usr/share/squid/errors/templates/
155 endef
156
157 define Package/squid-mod-cachemgr/install
158 $(INSTALL_DIR) $(1)/www/cgi-bin/
159 $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/cachemgr.cgi $(1)/www/cgi-bin/
160 endef
161
162 $(eval $(call BuildPackage,squid))
163 $(eval $(call BuildPackage,squid-mod-cachemgr))