]> git.ipfire.org Git - ipfire-3.x.git/blob - squid/squid.nm
Merge remote-tracking branch 'stevee/compat-xz'
[ipfire-3.x.git] / squid / squid.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = squid
7 major_ver = 3.1
8 version = %{major_ver}.19
9 release = 2
10
11 maintainer = Christian Schmidt <christian.schmidt@ipfire.org>
12 groups = Networking/Daemons
13 url = http://www.squid-cache.org/
14 license = GPLv2+
15 summary = The Squid proxy caching server.
16
17 description
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.
24 end
25
26 source_dl = http://www.squid-cache.org/Versions/v3/%{major_ver}/
27
28 build
29 requires
30 gcc-c++
31 libxml2-devel
32 openssl-devel
33 openldap-devel
34 samba-devel
35 pam-devel
36 libcap-devel
37 /usr/bin/smbclient
38 shadow-utils
39 end
40
41 CFLAGS += -Wno-error
42
43 configure_options += \
44 --datadir=/usr/lib/squid \
45 --libexecdir=/usr/lib/squid \
46 --localstatedir=/var \
47 --sysconfdir=/etc/squid \
48 --with-logdir=/var/log/squid \
49 --enable-storeio="aufs,diskd,ufs" \
50 --enable-removal-policies="heap,lru" \
51 --enable-icmp \
52 --enable-delay-pools \
53 --disable-esi \
54 --enable-icap-client \
55 --enable-useragent-log \
56 --enable-referrer-log \
57 --enable-wccp \
58 --enable-wccpv2 \
59 --enable-kill-parent-hack \
60 --enable-snmp \
61 --enable-arp-acl \
62 --enable-ipf-transparent \
63 --enable-htcp \
64 --enable-ssl \
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 \
75 --enable-auth=basic,ntlm \
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
85
86 prepare_cmds
87 %{create_user}
88 end
89
90 install_cmds
91 rm -vf %{BUILDROOT}/etc/squid/errors
92
93 mkdir -pv %{BUILDROOT}/var/log/cache %{BUILDROOT}/var/log/squid
94 touch %{BUILDROOT}/var/log/squid/access.log
95 touch %{BUILDROOT}/var/log/squid/cache.log
96 mkdir -pv %{BUILDROOT}/var/cache/squid
97
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
101
102 chown -Rv squid:squid %{BUILDROOT}/var/log/squid %{BUILDROOT}/var/log/cache %{BUILDROOT}/var/cache/squid
103 chmod 600 %{BUILDROOT}/var/cache/squid
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
109 end
110 end
111
112 create_user
113 getent group squid >/dev/null || /usr/sbin/groupadd -r squid
114 getent passwd squid >/dev/null || /usr/sbin/useradd -r -g squid \
115 -d /var/cache/squid -s /sbin/nologin squid
116 end
117
118 packages
119 package %{name}
120 prerequires
121 shadow-utils
122 systemd-units
123 end
124
125 configfiles
126 /etc/squid.conf
127 /etc/sysconfig/squid
128 end
129
130 script prein
131 %{create_user}
132 end
133
134 script postin
135 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
136 end
137
138 script preun
139 /bin/systemctl --no-reload disable squid.service >/dev/null 2>&1 || :
140 /bin/systemctl stop squid.service >/dev/null 2>&1 || :
141 end
142
143 script postun
144 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
145 end
146
147 script postup
148 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
149 /bin/systemctl try-restart squid.service >/dev/null 2>&1 || :
150 end
151
152 requires = /usr/bin/smbclient
153
154 filter_requires = perl.Auth.*
155 end
156
157 package %{name}-debuginfo
158 template DEBUGINFO
159 end
160 end