]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - lfs/squid
suricata: Change midstream policy to "pass-flow"
[people/pmueller/ipfire-2.x.git] / lfs / squid
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2023 IPFire Team <info@ipfire.org> #
5 # #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
10 # #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
15 # #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
18 # #
19 ###############################################################################
20
21 ###############################################################################
22 # Definitions
23 ###############################################################################
24
25 include Config
26
27 VER = 5.8
28 LANGPACK = 20230225
29
30 THISAPP = squid-$(VER)
31 DL_FILE = $(THISAPP).tar.xz
32 DL_FROM = $(URL_IPFIRE)
33 DIR_APP = $(DIR_SRC)/$(THISAPP)
34 TARGET = $(DIR_INFO)/$(THISAPP)
35
36 CXXFLAGS+= -Wno-error=format-truncation
37
38 ifeq "$(BUILD_ARCH)" "riscv64"
39 LDFLAGS += -latomic
40 endif
41
42 ###############################################################################
43 # Top-level Rules
44 ###############################################################################
45
46 objects = $(DL_FILE) \
47 squid-langpack-$(LANGPACK).tar.gz
48
49 $(DL_FILE) = $(URL_IPFIRE)/$(DL_FILE)
50 squid-langpack-$(LANGPACK).tar.gz = $(URL_IPFIRE)/squid-langpack-$(LANGPACK).tar.gz
51
52 $(DL_FILE)_BLAKE2 = c9d1ae9464e68beabdf7ae1641a70d6c614bc4d4f4bae3fc5946c2bf61510634992cbd5abe63f071104edb2fa487a6c5c7fb8fbf8f06ac723a6522ec9ade8b68
53 squid-langpack-$(LANGPACK).tar.gz_BLAKE2 = 169a05d16770f56e515fd633658e8bcd9464fb01ccba76256b119932c833af7bc22e3e8d3a7d5fde37638546f15822a4d1548a78af13be9f4e3b8989758250b6
54
55 install : $(TARGET)
56
57 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
58
59 download :$(patsubst %,$(DIR_DL)/%,$(objects))
60
61 b2 : $(subst %,%_BLAKE2,$(objects))
62
63 ###############################################################################
64 # Downloading, checking, b2sum
65 ###############################################################################
66
67 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
68 @$(CHECK)
69
70 $(patsubst %,$(DIR_DL)/%,$(objects)) :
71 @$(LOAD)
72
73 $(subst %,%_BLAKE2,$(objects)) :
74 @$(B2SUM)
75
76 ###############################################################################
77 # Installation Details
78 ###############################################################################
79
80 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
81 @$(PREBUILD)
82 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar xaf $(DIR_DL)/$(DL_FILE)
83 cd $(DIR_APP)/errors && tar zxf $(DIR_DL)/squid-langpack-$(LANGPACK).tar.gz
84
85 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/squid/01_squid-gcc11.patch
86
87 cd $(DIR_APP) && autoreconf -vfi
88 cd $(DIR_APP)/libltdl && autoreconf -vfi
89
90 cd $(DIR_APP) && CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" \
91 LDFLAGS="$(LDFLAGS)" ./configure \
92 --prefix=/usr \
93 --sysconfdir=/etc/squid \
94 --datadir=/usr/lib/squid \
95 --mandir=/usr/share/man \
96 --libexecdir=/usr/lib/squid \
97 --localstatedir=/var \
98 --disable-ssl \
99 --disable-icmp \
100 --disable-wccp \
101 --disable-wccpv2 \
102 --disable-kqueue \
103 --disable-esi \
104 --disable-arch-native \
105 --disable-strict-error-checking \
106 --enable-poll \
107 --enable-ident-lookups \
108 --enable-storeio=aufs,diskd,ufs \
109 --enable-underscores \
110 --enable-http-violations \
111 --enable-removal-policies=heap,lru \
112 --enable-delay-pools \
113 --enable-linux-netfilter \
114 --enable-snmp \
115 --enable-auth \
116 --enable-auth-basic \
117 --enable-auth-digest \
118 --enable-auth-negotiate \
119 --enable-auth-ntlm \
120 --enable-log-daemon-helpers \
121 --enable-url-rewrite-helpers \
122 --enable-build-info \
123 --enable-eui \
124 --enable-async-io=16 \
125 --enable-unlinkd \
126 --enable-internal-dns \
127 --enable-epoll \
128 --enable-select \
129 --enable-cache-digests \
130 --enable-forw-via-db \
131 --enable-htcp \
132 --enable-kill-parent-hack \
133 --enable-icap-client \
134 --enable-zph-qos \
135 --with-dl \
136 --with-large-files \
137 --without-gnutls \
138 --without-netfilter-conntrack
139
140 cd $(DIR_APP) && make $(MAKETUNING)
141 cd $(DIR_APP) && make install
142
143 rm -f /etc/squid/squid.conf
144 ln -sf /var/ipfire/proxy/squid.conf /etc/squid/squid.conf
145 rm -f /etc/squid/cachemgr.conf
146 ln -sf /var/ipfire/proxy/cachemgr.conf /etc/squid/cachemgr.conf
147 rm -f /etc/squid/errors
148 ln -sf /usr/lib/squid/errors/en /etc/squid/errors
149
150 -mkdir -p /var/log/cache /var/log/squid /var/log/updatexlrator
151 touch /var/log/squid/access.log
152 chown -R squid:squid /var/log/squid /var/log/cache /var/log/updatexlrator
153
154 cp /usr/lib/squid/cachemgr.cgi /srv/web/ipfire/cgi-bin/cachemgr.cgi
155 chown root:root /srv/web/ipfire/cgi-bin/cachemgr.cgi
156
157 cp -f $(DIR_SRC)/config/updxlrator/updxlrator /usr/sbin/updxlrator
158 cp -f $(DIR_SRC)/config/updxlrator/checkup /var/ipfire/updatexlrator/bin/checkup
159 cp -f $(DIR_SRC)/config/updxlrator/download /var/ipfire/updatexlrator/bin/download
160 cp -f $(DIR_SRC)/config/updxlrator/convert /var/ipfire/updatexlrator/bin/convert
161 cp -f $(DIR_SRC)/config/updxlrator/lscache /var/ipfire/updatexlrator/bin/lscache
162 cp -f $(DIR_SRC)/config/updxlrator/checkdeaddl /var/ipfire/updatexlrator/bin/checkdeaddl
163
164 cp -f $(DIR_SRC)/config/updxlrator/updxlrator-lib.pl /var/ipfire/updatexlrator/updxlrator-lib.pl
165
166 chmod 755 /usr/sbin/updxlrator /var/ipfire/updatexlrator/bin/checkup \
167 /var/ipfire/updatexlrator/bin/download \
168 /var/ipfire/updatexlrator/bin/convert \
169 /var/ipfire/updatexlrator/bin/lscache \
170 /var/ipfire/updatexlrator/bin/checkdeaddl
171
172 ln -fs /bin/false /var/ipfire/updatexlrator/autocheck/cron.daily
173 ln -fs /bin/false /var/ipfire/updatexlrator/autocheck/cron.monthly
174 ln -fs /bin/false /var/ipfire/updatexlrator/autocheck/cron.weekly
175
176 chown -R nobody:nobody /var/ipfire/updatexlrator
177 chown -R root:root /var/ipfire/updatexlrator/bin
178 chown root:root /var/ipfire/updatexlrator/updxlrator-lib.pl
179 chown nobody.squid /var/updatecache
180 chown nobody.squid /var/updatecache/download
181 chown nobody.squid /var/updatecache/metadata
182 chmod 775 /var/updatecache
183 chmod 775 /var/updatecache/download
184 chmod 775 /var/updatecache/metadata
185 chmod 755 /var/log/updatexlrator
186 chmod 755 /srv/web/ipfire/html/images/updbooster
187
188 chown squid:squid /var/log/squid
189 ln -sf /usr/lib/squid /usr/lib/squid/auth
190 cp -f $(DIR_SRC)/config/proxy/proxy.pac /srv/web/ipfire/html/proxy.pac
191 chown nobody.nobody /srv/web/ipfire/html/proxy.pac
192 ln -sf /srv/web/ipfire/html/proxy.pac /srv/web/ipfire/html/wpad.dat
193
194 # Copy stylesheets for the errorpages
195 cp -f $(DIR_SRC)/config/proxy/errorpage-ipfire.css /var/ipfire/proxy/
196 cp -f /etc/squid/errorpage.css /var/ipfire/proxy/errorpage-squid.css
197
198 @rm -rf $(DIR_APP)
199 @$(POSTBUILD)