1 ###############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2023 IPFire Team <info@ipfire.org> #
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. #
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. #
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/>. #
19 ###############################################################################
21 ###############################################################################
23 ###############################################################################
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)
36 CXXFLAGS+= -Wno-error=format-truncation
38 ifeq "$(BUILD_ARCH)" "riscv64"
42 ###############################################################################
44 ###############################################################################
46 objects = $(DL_FILE) \
47 squid-langpack-$(LANGPACK).tar.gz
49 $(DL_FILE) = $(URL_IPFIRE)/$(DL_FILE)
50 squid-langpack-$(LANGPACK).tar.gz = $(URL_IPFIRE)/squid-langpack-$(LANGPACK).tar.gz
52 $(DL_FILE)_BLAKE2 = c9d1ae9464e68beabdf7ae1641a70d6c614bc4d4f4bae3fc5946c2bf61510634992cbd5abe63f071104edb2fa487a6c5c7fb8fbf8f06ac723a6522ec9ade8b68
53 squid-langpack-$(LANGPACK).tar.gz_BLAKE2 = 169a05d16770f56e515fd633658e8bcd9464fb01ccba76256b119932c833af7bc22e3e8d3a7d5fde37638546f15822a4d1548a78af13be9f4e3b8989758250b6
57 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
59 download :$(patsubst %,$(DIR_DL)/%,$(objects))
61 b2 : $(subst %,%_BLAKE2,$(objects))
63 ###############################################################################
64 # Downloading, checking, b2sum
65 ###############################################################################
67 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
70 $(patsubst %,$(DIR_DL)/%,$(objects)) :
73 $(subst %,%_BLAKE2,$(objects)) :
76 ###############################################################################
77 # Installation Details
78 ###############################################################################
80 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
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
85 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/squid/01_squid-gcc11.patch
87 cd $(DIR_APP) && autoreconf -vfi
88 cd $(DIR_APP)/libltdl && autoreconf -vfi
90 cd $(DIR_APP) && CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" \
91 LDFLAGS="$(LDFLAGS)" ./configure \
93 --sysconfdir=/etc/squid \
94 --datadir=/usr/lib/squid \
95 --mandir=/usr/share/man \
96 --libexecdir=/usr/lib/squid \
97 --localstatedir=/var \
104 --disable-arch-native \
105 --disable-strict-error-checking \
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 \
116 --enable-auth-basic \
117 --enable-auth-digest \
118 --enable-auth-negotiate \
120 --enable-log-daemon-helpers \
121 --enable-url-rewrite-helpers \
122 --enable-build-info \
124 --enable-async-io=16 \
126 --enable-internal-dns \
129 --enable-cache-digests \
130 --enable-forw-via-db \
132 --enable-kill-parent-hack \
133 --enable-icap-client \
138 --without-netfilter-conntrack
140 cd $(DIR_APP) && make $(MAKETUNING)
141 cd $(DIR_APP) && make install
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
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
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
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
164 cp -f $(DIR_SRC)/config/updxlrator/updxlrator-lib.pl /var/ipfire/updatexlrator/updxlrator-lib.pl
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
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
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
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
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