560f35ff817d4da22f6ad3b099eb008fbc68f87f
[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:=6.8
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=http://www2.pl.squid-cache.org/Versions/v6/ \
16 http://www.squid-cache.org/Versions/v6/
17 PKG_HASH:=11cc5650b51809d99483ccfae24744a2e51cd16199f5ff0c917e84fce695870f
18
19 PKG_MAINTAINER:=Marko Ratkaj <markoratkaj@gmail.com>
20 PKG_LICENSE:=GPL-2.0-or-later
21 PKG_CPE_ID:=cpe:/a:squid-cache:squid
22
23 PKG_FIXUP:=autoreconf
24 PKG_INSTALL:=1
25 PKG_BUILD_PARALLEL:=1
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/squid/Default
30 SECTION:=net
31 CATEGORY:=Network
32 SUBMENU:=Web Servers/Proxies
33 URL:=https://www.squid-cache.org/
34 endef
35
36 define Package/squid
37 $(call Package/squid/Default)
38 MENU:=1
39 DEPENDS:=+libpthread +librt +libltdl +libstdcpp +libatomic +USE_GLIBC:libbsd
40 DEPENDS+= +SQUID_use-gnutls:libgnutls +SQUID_use-openssl:libopenssl
41 DEPENDS+= +SQUID_with-libcap:libcap
42 DEPENDS+= +SQUID_with-nettle:libnettle
43 DEPENDS+= +SQUID_with-expat:libexpat
44 DEPENDS+= +SQUID_with-libxml2:libxml2
45 USERID:=squid=137:squid=137
46 TITLE:=full-featured Web proxy cache
47 endef
48
49 define Package/squid/description
50 Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more.
51 It reduces bandwidth and improves response times by caching and reusing
52 frequently-requested web pages.
53 endef
54
55 define Package/squid/config
56 source "$(SOURCE)/Config.in"
57 endef
58
59 define Package/squid/conffiles
60 /etc/config/squid
61 /etc/squid/squid.conf
62 endef
63
64 define Package/squid-mod-cachemgr
65 $(call Package/squid/Default)
66 DEPENDS:=squid
67 TITLE:=Web based proxy manager and reporting tool
68 endef
69
70 CONFIGURE_ARGS += \
71 BUILDCXX=$(HOSTCXX_NOCACHE) \
72 --datadir=/usr/share/squid \
73 --libexecdir=/usr/lib/squid \
74 --sysconfdir=/etc/squid \
75 --disable-static \
76 --enable-delay-pools \
77 --enable-cache-digests \
78 --enable-linux-netfilter \
79 --disable-unlinkd \
80 --enable-x-accelerator-vary \
81 --disable-auto-locale \
82 --enable-epoll \
83 --with-filedescriptors=2048 \
84 --disable-external-acl-helpers \
85 --disable-arch-native \
86 --without-mit-krb5 \
87 --without-heimdal-krb5 \
88 --without-netfilter-conntrack \
89 --disable-ident-lookups \
90 $(if $(CONFIG_SQUID_auth-basic),--enable,--disable)-auth-basic \
91 $(if $(CONFIG_SQUID_auth-digest),--enable,--disable)-auth-digest \
92 $(if $(CONFIG_SQUID_auth-ntlm),--enable,--disable)-auth-ntlm \
93 $(if $(CONFIG_SQUID_auth-negotiate),--enable,--disable)-auth-negotiate \
94 $(if $(CONFIG_SQUID_enable-ipv6),--enable,--disable)-ipv6 \
95 $(if $(CONFIG_SQUID_enable-ssl-crtd),--enable-ssl-crtd) \
96 $(if $(CONFIG_SQUID_use-gnutls),--with,--without)-gnutls \
97 $(if $(CONFIG_SQUID_use-gnutls),--without-openssl) \
98 $(if $(CONFIG_SQUID_use-gnutls),,--with-openssl="$(STAGING_DIR)/usr") \
99 $(if $(CONFIG_SQUID_enable-icmp),--enable,--disable)-icmp \
100 $(if $(CONFIG_SQUID_enable-icap-client),--enable,--disable)-icap-client \
101 $(if $(CONFIG_SQUID_enable-snmp),--enable,--disable)-snmp \
102 $(if $(CONFIG_SQUID_with-libcap),--with,--without)-cap \
103 $(if $(CONFIG_SQUID_with-nettle),--with,--without)-nettle \
104 $(if $(CONFIG_SQUID_with-expat),--with,--without)-expat \
105 $(if $(CONFIG_SQUID_with-libxml2),--with,--without)-xml2
106
107 CONFIGURE_VARS += \
108 ac_cv_header_linux_netfilter_ipv4_h=yes \
109 ac_cv_epoll_works=yes
110
111 TARGET_CFLAGS += -Wno-error
112 TARGET_LDFLAGS += -latomic
113
114 define Package/squid/install
115 $(INSTALL_DIR) $(1)/usr/sbin
116 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/squid $(1)/usr/sbin/
117
118 $(INSTALL_DIR) $(1)/usr/lib/squid
119 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/squid/* $(1)/usr/lib/squid/
120
121 $(INSTALL_DIR) $(1)/etc/config
122 $(INSTALL_CONF) ./files/squid.config $(1)/etc/config/squid
123
124 $(INSTALL_DIR) $(1)/etc/squid
125 $(CP) $(PKG_INSTALL_DIR)/etc/squid/* $(1)/etc/squid/
126 $(INSTALL_CONF) ./files/squid.conf $(1)/etc/squid/
127
128 $(INSTALL_DIR) $(1)/etc/init.d/
129 $(INSTALL_BIN) ./files/squid.init $(1)/etc/init.d/squid
130
131 $(INSTALL_DIR) $(1)/usr/share/squid/icons/
132 $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/icons/* $(1)/usr/share/squid/icons/
133 $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/mib.txt $(1)/usr/share/squid/
134
135 $(INSTALL_DIR) $(1)/usr/share/squid/errors/templates/
136 $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/errors/templates/* $(1)/usr/share/squid/errors/templates/
137 endef
138
139 define Package/squid-mod-cachemgr/install
140 $(INSTALL_DIR) $(1)/www/cgi-bin/
141 $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/cachemgr.cgi $(1)/www/cgi-bin/
142 endef
143
144 $(eval $(call BuildPackage,squid))
145 $(eval $(call BuildPackage,squid-mod-cachemgr))