Merge pull request #6851 from neheb/patch-4
[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.3
12 PKG_RELEASE:=1
13
14 PKG_LICENSE:=GPL-2.0
15 PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
16
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
18 PKG_SOURCE_URL:=http://www3.us.squid-cache.org/Versions/v4/ \
19 http://www2.pl.squid-cache.org/Versions/v4/ \
20 http://www.squid-cache.org/Versions/v4/
21 PKG_HASH:=322612ef0544828f6c673a25124b32364fb41ef5e2847e21c89480b5546a4c7c
22
23 PKG_BUILD_PARALLEL:=1
24 PKG_INSTALL:=1
25 PKG_FIXUP:=autoreconf
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:=http://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/squid/squid.conf
61 endef
62
63 define Package/squid-mod-cachemgr
64 $(call Package/squid/Default)
65 DEPENDS:=squid
66 TITLE:=Web based proxy manager and reporting tool
67 endef
68
69 CONFIGURE_ARGS += \
70 BUILDCXX=$(HOSTCXX) \
71 BUILDCXXFLAGS=$(if $(HOST_CXXFLAGS),$(HOST_CXXFLAGS),-O2) \
72 --config-cache \
73 --datadir=/usr/share/squid \
74 --libexecdir=/usr/lib/squid \
75 --sysconfdir=/etc/squid \
76 --enable-shared \
77 --disable-static \
78 --enable-delay-pools \
79 --enable-kill-parent-hack \
80 --enable-ssl \
81 --enable-cache-digests \
82 --enable-linux-netfilter \
83 --disable-unlinkd \
84 --enable-x-accelerator-vary \
85 --disable-translation \
86 --disable-auto-locale \
87 --with-dl \
88 --with-pthreads \
89 --enable-epoll \
90 --with-maxfd=2048 \
91 --disable-ecap \
92 --disable-external-acl-helpers \
93 --disable-arch-native \
94 --with-krb5-config=no \
95 --without-mit-krb5 \
96 --without-netfilter-conntrack \
97 --disable-ident-lookups \
98 $(if $(CONFIG_SQUID_auth-basic),--enable,--disable)-auth-basic \
99 $(if $(CONFIG_SQUID_auth-digest),--enable,--disable)-auth-digest \
100 $(if $(CONFIG_SQUID_auth-ntlm),--enable,--disable)-auth-ntlm \
101 $(if $(CONFIG_SQUID_auth-negotiate),--enable,--disable)-auth-negotiate \
102 $(if $(CONFIG_SQUID_enable-ipv6),--enable,--disable)-dlmalloc \
103 $(if $(CONFIG_SQUID_enable-ipv6),--enable,--disable)-ipv6 \
104 $(if $(CONFIG_SQUID_enable-ssl-crtd),--enable-ssl-crtd) \
105 $(if $(CONFIG_SQUID_use-gnutls),--with,--without)-gnutls \
106 $(if $(CONFIG_SQUID_use-gnutls),--without-openssl) \
107 $(if $(CONFIG_SQUID_use-gnutls),,--with-openssl="$(STAGING_DIR)/usr") \
108 $(if $(CONFIG_SQUID_enable-icmp),--enable,--disable)-icmp \
109 $(if $(CONFIG_SQUID_enable-icap-client),--enable,--disable)-icap-client \
110 $(if $(CONFIG_SQUID_enable-snmp),--enable,--disable)-snmp \
111 $(if $(CONFIG_SQUID_with-libcap),--with,--without)-libcap \
112 $(if $(CONFIG_SQUID_with-nettle),--with,--without)-nettle \
113 $(if $(CONFIG_SQUID_with-expat),--with,--without)-expat \
114 $(if $(CONFIG_SQUID_with-libxml2),--with,--without)-libxml2
115
116 CONFIGURE_VARS += \
117 ac_cv_header_linux_netfilter_ipv4_h=yes \
118 ac_cv_epoll_works=yes
119
120 define Build/Compile
121 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/lib all
122 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
123 DESTDIR="$(PKG_INSTALL_DIR)" \
124 install
125 endef
126
127 define Package/squid/install
128 $(INSTALL_DIR) $(1)/usr/sbin
129 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/squid $(1)/usr/sbin/
130
131 $(INSTALL_DIR) $(1)/usr/lib/squid
132 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/squid/* $(1)/usr/lib/squid/
133
134 $(INSTALL_DIR) $(1)/etc/config
135 $(INSTALL_CONF) ./files/squid.config $(1)/etc/config/squid
136
137 $(INSTALL_DIR) $(1)/etc/squid
138 $(CP) $(PKG_INSTALL_DIR)/etc/squid/* $(1)/etc/squid/
139 $(INSTALL_CONF) ./files/squid.conf $(1)/etc/squid/
140
141 $(INSTALL_DIR) $(1)/etc/init.d/
142 $(INSTALL_BIN) ./files/squid.init $(1)/etc/init.d/squid
143
144 $(INSTALL_DIR) $(1)/usr/share/squid/icons/
145 $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/icons/* $(1)/usr/share/squid/icons/
146 $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/mib.txt $(1)/usr/share/squid/
147
148 $(INSTALL_DIR) $(1)/usr/share/squid/errors/templates/
149 $(CP) $(PKG_INSTALL_DIR)/usr/share/squid/errors/templates/* $(1)/usr/share/squid/errors/templates/
150 endef
151
152 define Package/squid-mod-cachemgr/install
153 $(INSTALL_DIR) $(1)/www/cgi-bin/
154 $(CP) $(PKG_INSTALL_DIR)/usr/lib/squid/cachemgr.cgi $(1)/www/cgi-bin/
155 endef
156
157 $(eval $(call BuildPackage,squid))
158 $(eval $(call BuildPackage,squid-mod-cachemgr))