ipfire-3.x/squid/squid.nm

160 lines
4.2 KiB
Plaintext

###############################################################################
# IPFire.org - An Open Source Firewall Solution #
# Copyright (C) - IPFire Development Team <info@ipfire.org> #
###############################################################################
name = squid
major_ver = 3.1
version = %{major_ver}.19
release = 2
groups = Networking/Daemons
url = http://www.squid-cache.org/
license = GPLv2+
summary = The Squid proxy caching server.
description
Squid is a high-performance proxy caching server for Web clients,
supporting FTP, gopher, and HTTP data objects. Unlike traditional
caching software, Squid handles all requests in a single,
non-blocking, I/O-driven process. Squid keeps meta data and especially
hot objects cached in RAM, caches DNS lookups, supports non-blocking
DNS lookups, and implements negative caching of failed requests.
end
source_dl = http://www.squid-cache.org/Versions/v3/%{major_ver}/
build
requires
gcc-c++
libxml2-devel
openssl-devel
openldap-devel
samba-devel
pam-devel
libcap-devel
/usr/bin/smbclient
shadow-utils
end
CFLAGS += -Wno-error
configure_options += \
--datadir=/usr/lib/squid \
--libexecdir=/usr/lib/squid \
--localstatedir=/var \
--sysconfdir=/etc/squid \
--with-logdir=/var/log/squid \
--enable-storeio="aufs,diskd,ufs" \
--enable-removal-policies="heap,lru" \
--enable-icmp \
--enable-delay-pools \
--disable-esi \
--enable-icap-client \
--enable-useragent-log \
--enable-referrer-log \
--enable-wccp \
--enable-wccpv2 \
--enable-kill-parent-hack \
--enable-snmp \
--enable-arp-acl \
--enable-ipf-transparent \
--enable-htcp \
--enable-ssl \
--enable-forw-via-db \
--disable-cache-digests \
--enable-poll \
--enable-select \
--disable-kqueue \
--enable-epoll \
--enable-http-violations \
--enable-linux-netfilter \
--disable-ident-lookups \
--enable-internal-dns \
--enable-auth=basic,ntlm \
--enable-basic-auth-helpers="LDAP,MSNT,multi-domain-NTLM,PAM,NCSA,SMB,squid_radius_auth" \
--enable-ntlm-auth-helpers="smb_lm,no_check,fakeauth" \
--enable-ntlm-fail-open \
--with-filedescriptors=16384 \
--enable-unlinkd \
--with-pthreads \
--with-aio \
--with-dl \
--with-large-files
prepare_cmds
%{create_user}
end
install_cmds
rm -vf %{BUILDROOT}/etc/squid/errors
mkdir -pv %{BUILDROOT}/var/log/cache %{BUILDROOT}/var/log/squid
touch %{BUILDROOT}/var/log/squid/access.log
touch %{BUILDROOT}/var/log/squid/cache.log
mkdir -pv %{BUILDROOT}/var/cache/squid
echo "visible_hostname %{DISTRO_NAME}" >> %{BUILDROOT}/etc/squid/squid.conf
echo "cache_effective_user squid" >> %{BUILDROOT}/etc/squid/squid.conf
echo "cache_effective_group squid" >> %{BUILDROOT}/etc/squid/squid.conf
chown -Rv squid:squid %{BUILDROOT}/var/log/squid %{BUILDROOT}/var/log/cache %{BUILDROOT}/var/cache/squid
chmod 600 %{BUILDROOT}/var/cache/squid
mkdir -pv %{BUILDROOT}/etc/sysconfig
cp -vf %{DIR_SOURCE}/squid.sysconfig %{BUILDROOT}/etc/sysconfig/squid
cp -vf %{DIR_SOURCE}/cache_swap.sh %{BUILDROOT}/usr/lib/squid/
chmod 755 %{BUILDROOT}/usr/lib/squid/cache_swap.sh
chown -Rv squid:squid %{BUILDROOT}/usr/lib/squid/cache_swap.sh
end
end
create_user
getent group squid >/dev/null || /usr/sbin/groupadd -r squid
getent passwd squid >/dev/null || /usr/sbin/useradd -r -g squid \
-d /var/cache/squid -s /sbin/nologin squid
end
packages
package %{name}
prerequires
shadow-utils
systemd-units
end
configfiles
/etc/squid.conf
/etc/sysconfig/squid
end
script prein
%{create_user}
end
script postin
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
end
script preun
/bin/systemctl --no-reload disable squid.service >/dev/null 2>&1 || :
/bin/systemctl stop squid.service >/dev/null 2>&1 || :
end
script postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
end
script postup
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
/bin/systemctl try-restart squid.service >/dev/null 2>&1 || :
end
requires = /usr/bin/smbclient
filter_requires = perl.Auth.*
end
package %{name}-debuginfo
template DEBUGINFO
end
end