]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blame - squid/squid.nm
squid: Drop /var/run
[people/stevee/ipfire-3.x.git] / squid / squid.nm
CommitLineData
4f9dda45 1###############################################################################
802ea3af
MT
2# IPFire.org - An Open Source Firewall Solution #
3# Copyright (C) - IPFire Development Team <info@ipfire.org> #
4f9dda45
BS
4###############################################################################
5
802ea3af 6name = squid
92f2d78e
SS
7major_ver = 5
8minor_ver = 7
9version = %{major_ver}.%{minor_ver}
8bb9c712 10release = 2
4f9dda45 11
802ea3af 12groups = Networking/Daemons
92f2d78e 13url = https://www.squid-cache.org/
802ea3af 14license = GPLv2+
92f2d78e 15summary = The Squid proxy caching server
4f9dda45 16
802ea3af
MT
17description
18 Squid is a high-performance proxy caching server for Web clients,
19 supporting FTP, gopher, and HTTP data objects. Unlike traditional
20 caching software, Squid handles all requests in a single,
21 non-blocking, I/O-driven process. Squid keeps meta data and especially
22 hot objects cached in RAM, caches DNS lookups, supports non-blocking
23 DNS lookups, and implements negative caching of failed requests.
24end
4f9dda45 25
d6112748 26source_dl = http://www.squid-cache.org/Versions/v%{major_ver}/
321c867a 27
802ea3af
MT
28build
29 requires
30 gcc-c++
f8840db4 31 libxcrypt-devel
802ea3af
MT
32 libxml2-devel
33 openssl-devel
34 openldap-devel
35 samba-devel
802ea3af
MT
36 pam-devel
37 libcap-devel
fcf279c0 38 shadow-utils
92f2d78e 39 systemd-devel
802ea3af 40 end
4f9dda45 41
165d2feb 42 CFLAGS += -Wno-error
4f9dda45 43
802ea3af
MT
44 configure_options += \
45 --datadir=/usr/lib/squid \
46 --libexecdir=/usr/lib/squid \
47 --localstatedir=/var \
48 --sysconfdir=/etc/squid \
fcf279c0 49 --with-logdir=/var/log/squid \
802ea3af
MT
50 --enable-storeio="aufs,diskd,ufs" \
51 --enable-removal-policies="heap,lru" \
52 --enable-icmp \
53 --enable-delay-pools \
54 --disable-esi \
d7b41604 55 --enable-icap-client \
802ea3af
MT
56 --enable-useragent-log \
57 --enable-referrer-log \
d7b41604
CS
58 --enable-wccp \
59 --enable-wccpv2 \
802ea3af
MT
60 --enable-kill-parent-hack \
61 --enable-snmp \
62 --enable-arp-acl \
802ea3af 63 --enable-htcp \
92f2d78e 64 --disable-ssl \
802ea3af
MT
65 --enable-forw-via-db \
66 --disable-cache-digests \
67 --enable-poll \
68 --enable-select \
69 --disable-kqueue \
70 --enable-epoll \
71 --enable-http-violations \
72 --enable-linux-netfilter \
73 --disable-ident-lookups \
74 --enable-internal-dns \
92f2d78e 75 --enable-auth \
802ea3af
MT
76 --enable-basic-auth-helpers="LDAP,MSNT,multi-domain-NTLM,PAM,NCSA,SMB,squid_radius_auth" \
77 --enable-ntlm-auth-helpers="smb_lm,no_check,fakeauth" \
78 --enable-ntlm-fail-open \
79 --with-filedescriptors=16384 \
80 --enable-unlinkd \
81 --with-pthreads \
82 --with-aio \
83 --with-dl \
84 --with-large-files
4f9dda45 85
fcf279c0
CS
86 prepare_cmds
87 %{create_user}
88 end
89
802ea3af
MT
90 install_cmds
91 rm -vf %{BUILDROOT}/etc/squid/errors
f464ef1e 92
802ea3af
MT
93 mkdir -pv %{BUILDROOT}/var/log/cache %{BUILDROOT}/var/log/squid
94 touch %{BUILDROOT}/var/log/squid/access.log
fcf279c0 95 touch %{BUILDROOT}/var/log/squid/cache.log
802ea3af 96 mkdir -pv %{BUILDROOT}/var/cache/squid
4f9dda45 97
fcf279c0
CS
98 echo "visible_hostname %{DISTRO_NAME}" >> %{BUILDROOT}/etc/squid/squid.conf
99 echo "cache_effective_user squid" >> %{BUILDROOT}/etc/squid/squid.conf
100 echo "cache_effective_group squid" >> %{BUILDROOT}/etc/squid/squid.conf
1f9bc2f0 101
fcf279c0
CS
102 chown -Rv squid:squid %{BUILDROOT}/var/log/squid %{BUILDROOT}/var/log/cache %{BUILDROOT}/var/cache/squid
103 chmod 600 %{BUILDROOT}/var/cache/squid
217da106
CS
104 mkdir -pv %{BUILDROOT}/etc/sysconfig
105 cp -vf %{DIR_SOURCE}/squid.sysconfig %{BUILDROOT}/etc/sysconfig/squid
106 cp -vf %{DIR_SOURCE}/cache_swap.sh %{BUILDROOT}/usr/lib/squid/
107 chmod 755 %{BUILDROOT}/usr/lib/squid/cache_swap.sh
108 chown -Rv squid:squid %{BUILDROOT}/usr/lib/squid/cache_swap.sh
8bb9c712
SS
109
110 # Drop /var/run
111 rm -rvf %{BUILDROOT}%{localstatedir}/run
802ea3af
MT
112 end
113end
4f9dda45 114
fcf279c0
CS
115create_user
116 getent group squid >/dev/null || /usr/sbin/groupadd -r squid
117 getent passwd squid >/dev/null || /usr/sbin/useradd -r -g squid \
118 -d /var/cache/squid -s /sbin/nologin squid
119end
120
802ea3af
MT
121packages
122 package %{name}
7d9b1d61
SS
123 prerequires
124 shadow-utils
125 systemd-units
126 end
217da106
CS
127
128 configfiles
129 /etc/squid.conf
130 /etc/sysconfig/squid
131 end
fcf279c0
CS
132
133 script prein
134 %{create_user}
135 end
217da106
CS
136
137 script postin
138 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
139 end
140
141 script preun
142 /bin/systemctl --no-reload disable squid.service >/dev/null 2>&1 || :
143 /bin/systemctl stop squid.service >/dev/null 2>&1 || :
144 end
145
146 script postun
147 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
148 end
149
150 script postup
151 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
152 /bin/systemctl try-restart squid.service >/dev/null 2>&1 || :
153 end
154
fb8afaf0 155 filter_requires = perl.Auth.*
802ea3af 156 end
1f9bc2f0
MT
157
158 package %{name}-debuginfo
159 template DEBUGINFO
160 end
802ea3af 161end