# Enable Sources (Recommended in https://docs.diladele.com/administrator_guide_stable/install/debian10/requirements.html)

sudo nano /etc/apt/sources.list
# Add to the document
deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi

# Increasing the Swap File (Recommended in https://docs.diladele.com/administrator_guide_stable/install/debian10/requirements.html)

sudo dphys-swapfile swapoff
sudo nano /etc/dphys-swapfile
# Change CONF_SWAPSIZE=100 for 4096
sudo dphys-swapfile setup
sudo dphys-swapfile swapon
sudo reboot

# Install build tools
sudo apt install devscripts build-essential fakeroot sudo debhelper dh-autoreconf dh-apparmor cdbs ed net-tools

# Install additional header packages for squid4
sudo apt install libcppunit-dev libsasl2-dev libxml2-dev libkrb5-dev libdb-dev libnetfilter-conntrack-dev libexpat1-dev libcap2-dev libldap2-dev libpam0g-dev libgnutls28-dev libssl-dev libdbi-perl libecap3 libecap3-dev libsystemd-dev

# Install build dependences for squid
sudo apt-get -y build-dep squid

cd
mkdir squid4
cd squid4/
wget http://www.squid-cache.org/Versions/v4/squid-4.14.tar.gz
tar -xzvf squid-4.14.tar.gz
cd squid-4.14

#This configuration was used on some random page to compile squid3
./configure --prefix=/usr --localstatedir=/var --libexecdir=${prefix}/lib/squid --datadir=${prefix}/share/squid --sysconfdir=/etc/squid --with-default-user=proxy --with-logdir=/var/log --with-pidfile=/var/run/squid.pid --with-openssl --enable-icmp --enable-ssl --enable-ssl-crtd

make all
sudo make install
squid -v