]> git.pld-linux.org Git - packages/squid.git/blob - squid.spec
- adding init usage to squid.init 'squid -z'
[packages/squid.git] / squid.spec
1 Summary:        SQUID Internet Object Cache
2 Summary(pl):    Uniwersalny proxy-cache server
3 Name:           squid
4 Version:        2.4.STABLE2
5 Release:        2
6 Epoch:          6
7 License:        GPL
8 Group:          Networking/Daemons
9 Group(de):      Netzwerkwesen/Server
10 Group(pl):      Sieciowe/Serwery
11 Source0:        http://www.squid-cache.org/Versions/v2/2.4/%{name}-%{version}-src.tar.gz
12 Source1:        %{name}-1.1.19-faq.tar.gz
13 Source2:        %{name}.init
14 Source3:        %{name}.sysconfig
15 Source4:        http://cache.is.co.za/%{name}-docs.tar.gz
16 Source5:        %{name}.conf.patch
17 Source6:        %{name}.logrotate
18 Patch0:         %{name}-perl.patch
19 Patch1:         %{name}-linux.patch
20 Patch2:         %{name}-fhs.patch
21 Patch3:         %{name}-location.patch
22 Patch4:         %{name}-domainmatch.patch
23 # Bug fixes from Squid home page.
24 # Patch10:
25 Prereq:         rc-scripts >= 0.2.0
26 Prereq:         /sbin/chkconfig
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %define         _libexecdir     %{_libdir}/%{name}
30 %define         _sysconfdir     /etc/%{name}
31
32 %description
33 Squid is a high-performance proxy caching server for web clients,
34 supporting FTP, gopher, and HTTP data objects. Unlike traditional
35 caching software, Squid handles all requests in a single,
36 non-blocking, I/O-driven process. Squid keeps meta data and especially
37 hot objects cached in RAM, caches DNS lookups, supports non-blocking
38 DNS lookups, and implements negative caching of failed requests. If
39 you are tight on memory, check out the NOVM version of this package.
40 Squid supports SSL, extensive access controls, and full request
41 logging. By using the lightweight Internet Cache Protocol, Squid
42 caches can be arranged in a hierarchy or mesh for additional bandwidth
43 savings. Squid consists of a main server program squid, a Domain Name
44 System lookup program dnsserver, a program for retrieving FTP data
45 ftpget, and some management and client tools. When squid starts up, it
46 spawns a configurable number of dnsserver processes, each of which can
47 perform a single, blocking Domain Name System (DNS) lookup. This
48 reduces the amount of time the cache waits for DNS lookups. Squid is
49 derived from the ARPA-funded Harvest project.
50
51 %description -l pl
52 Squid jest wysoce wydajnym serwerem proxy-cache dla przegl±darek WWW,
53 klientów FTP i gopher. Squid przechowuje najczê¶ciej pobierane dane w
54 pamiêci RAM i zapamiêtuje odwo³ania do DNS. Squid oferuje wsparcie dla
55 SSL, rozbudowan± kontrolê dostêpu oraz pe³ne rejestrowanie pobieranych
56 danych. Dziêki u¿yciu protoko³u ICP (Internet Cache Protocol), serwer
57 squid mo¿na ³±czyæ w hierarchiê, zwiêkszaj±c ich efektywno¶æ. Pakiet
58 squid obejmuje: g³ówny program serwera squid, program dostarczaj±cy
59 informacji z DNS dnsserver, program odbieraj±cy dane FTP ftpget, oraz
60 pomocnicze programy do zarz±dzania. Squid wywodzi siê ze
61 sponsorowanego przez ARPA projektu Harvest.
62
63 %package cachemgr
64 Summary:        CGI script for Squid management
65 Summary(pl):    Skrypt CGI do zarz±dzania Squidem przez WWW
66 Group:          Networking/Admin
67 Group(de):      Netzwerkwesen/Administration
68 Group(pl):      Sieciowe/Administracyjne
69 Requires:       %{name} = %{version}
70 Requires:       httpd
71
72 %description cachemgr
73 Cachemgr.cgi is a CGI script that allows administrator to chceck
74 various informations about Squid via WWW.
75
76 %description -l pl cachemgr
77 Cachemgr.cgi jest skryptem CGI, który pozwala administratorowi
78 zapoznaæ siê z informacjami o pracy Squid'a poprzez WWW.
79
80 %prep
81 %setup -q -a 1 -a 4
82
83 # Bug fixes from Squid home page.
84 # None at the moment, but will be here soon... ;)
85
86 %patch0 -p1 
87 %patch1 -p1 
88 %patch2 -p1
89 %patch3 -p1
90 %patch4 -p1
91
92 %build
93 autoconf
94 %configure \
95         --localstatedir=/var \
96         --enable-icmp \
97         --enable-useragent-log \
98         --enable-snmp \
99         --enable-arp-acl \
100         --enable-err-language=English \
101         --enable-htcp \
102         --enable-carp \
103         --enable-storeio="aufs,coss,diskd,null,ufs" \
104         --enable-removal-policies="lru heap" \
105         --disable-ipf-transparent \
106         --enable-delay-pools \
107         --with-pthreads \
108         --enable-cache-digests
109 # old dns-checker:
110 #       --disable-internal-dns \
111 # for 2.4 kernel:
112 #       --enable-linux-netfilter\
113
114 mv -f squid/* doc
115 %{__make} 
116
117 %install
118 rm -rf $RPM_BUILD_ROOT
119
120 install -d \
121         $RPM_BUILD_ROOT/home/httpd/cgi-bin \
122         $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d} \
123         $RPM_BUILD_ROOT{%{_sbindir},%{_bindir},%{_libexecdir}/contrib} \
124         $RPM_BUILD_ROOT%{_mandir}/man1 \
125         $RPM_BUILD_ROOT%{_datadir}/squid \
126         $RPM_BUILD_ROOT/var/{cache,log{,/archiv}}/squid
127
128 %{__make} install \
129         prefix=$RPM_BUILD_ROOT%{_prefix} \
130         sysconfdir=$RPM_BUILD_ROOT/etc/squid \
131         bindir=$RPM_BUILD_ROOT%{_bindir} \
132         libdir=$RPM_BUILD_ROOT%{_libdir} \
133         libexecdir=$RPM_BUILD_ROOT%{_bindir} \
134         localstatedir=$RPM_BUILD_ROOT/var \
135         datadir=$RPM_BUILD_ROOT%{_datadir}
136
137 # We don't use %{__make} install-pinger, because it tries to set it suid root.
138 install src/pinger $RPM_BUILD_ROOT%{_bindir}
139
140 mv -f contrib/*.pl $RPM_BUILD_ROOT%{_libexecdir}/contrib
141
142 mv -f $RPM_BUILD_ROOT%{_bindir}/cachemgr.cgi $RPM_BUILD_ROOT/home/httpd/cgi-bin
143 mv -f $RPM_BUILD_ROOT%{_bindir}/squid   $RPM_BUILD_ROOT%{_sbindir}/
144 mv -f $RPM_BUILD_ROOT/etc/squid/icons   $RPM_BUILD_ROOT%{_datadir}/squid
145
146 cd errors
147 for LNG in *; do
148         if [ -d $LNG ]; then
149                 mv -f $LNG $RPM_BUILD_ROOT%{_datadir}/squid/errors.$LNG
150         fi
151 done
152 cd ..
153
154 cd $RPM_BUILD_ROOT/etc/squid
155 cp squid.conf{,.default}
156 patch -p0 < %{SOURCE5}
157 cd -
158
159 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/squid
160 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/squid
161 install %{SOURCE6} $RPM_BUILD_ROOT/etc/logrotate.d/squid
162
163 install scripts/*.pl $RPM_BUILD_ROOT%{_libexecdir}
164
165 touch $RPM_BUILD_ROOT/var/log/squid/{access,cache,store}.log
166
167 # These two files start squid. They are replaced by /etc/rc.d/init.d script.
168 rm -f $RPM_BUILD_ROOT%{_bindir}/R*
169
170 gzip -9nf CONTRIBUTORS COPYRIGHT CREDITS README ChangeLog QUICKSTART \
171         TODO
172
173 %pre
174 grep -q squid /etc/group || (
175     /usr/sbin/groupadd -g 91 -r -f squid 1>&2 || :
176 )
177 grep -q squid /etc/passwd || (
178     /usr/sbin/useradd -M -o -r -u 91 -s /bin/false \
179         -g squid -c "SQUID http caching daemon" -d /var/cache/squid squid 1>&2 || :
180 )
181
182 %post
183 # If there is already link, don't do anything.
184 if [ ! -e %{_datadir}/squid/errors ]; then 
185
186 # Try to create link to Polish, and then any directory but English.
187 if [ -d %{_datadir}/squid/errors.Polish ]; then
188         ln -sf %{_datadir}/squid/errors{.Polish,}
189         exit
190 else
191         find %{_datadir}/squid/errors/ -type d -name 'errors.*'| while read NAME; do
192                 if [ $NAME != "English" ]; then
193                         ln -fs $NAME %{_datadir}/squid/errors
194                         exit
195                 fi
196         done
197 fi
198
199 # Create symlink to English if everything else fails.
200 ln -sf %{_datadir}/squid/errors{.English,}
201
202 fi
203
204 if [ "$1" = "1" ]; then
205         /sbin/chkconfig --add squid
206         echo "Run \"/etc/rc.d/init.d/squid start\" to start squid." >&2
207 else
208         if [ -f /var/lock/subsys/squid ]; then
209                 /etc/rc.d/init.d/squid restart >&2
210         fi
211 fi
212
213 %preun
214 if [ "$1" = "0" ]; then
215         if [ -f /var/lock/subsys/squid ]; then
216                 /etc/rc.d/init.d/squid stop >&2
217         fi
218         /sbin/chkconfig --del squid
219         rm -f %{_datadir}/squid/errors
220 fi
221
222 %clean
223 rm -rf $RPM_BUILD_ROOT
224
225 %files
226 %defattr(644,root,root,755)
227 %doc faq *.gz doc/*
228
229 %attr(755,root,root) %{_bindir}/client
230 %attr(755,root,root) %{_bindir}/diskd
231 # It's obsolete while internal-dns is enabled
232 #%attr(755,root,root) %{_bindir}/dnsserver
233 # YES, it has to be suid root, it sends ICMP packets.
234 %attr(4754,root,squid) %{_bindir}/pinger
235 %attr(755,root,root) %{_bindir}/unlinkd
236 %attr(755,root,root) %{_sbindir}/*
237
238 %attr(755,root,root) %dir %{_sysconfdir}
239
240 %attr(754,root,root) /etc/rc.d/init.d/squid
241 %attr(640,root,root) /etc/logrotate.d/squid
242 %attr(640,root,squid) %config(noreplace) /etc/sysconfig/squid
243 %attr(640,root,squid) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/squid.conf
244 %attr(640,root,squid) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mime.conf
245 %attr(640,root,root) %{_sysconfdir}/mime.conf.default
246 %attr(640,root,root) %{_sysconfdir}/squid.conf.default
247
248 %{_datadir}/squid/icons
249 %{_datadir}/squid/mib.txt
250 %lang(bg) %{_datadir}/squid/errors.Bulgarian
251 %lang(cs) %{_datadir}/squid/errors.Czech
252 %lang(da) %{_datadir}/squid/errors.Danish
253 %lang(nl) %{_datadir}/squid/errors.Dutch
254 %{_datadir}/squid/errors.English
255 %lang(et) %{_datadir}/squid/errors.Estonian
256 %lang(fi) %{_datadir}/squid/errors.Finnish
257 %lang(fr) %{_datadir}/squid/errors.French
258 %lang(de) %{_datadir}/squid/errors.German
259 %lang(hu) %{_datadir}/squid/errors.Hungarian
260 %lang(it) %{_datadir}/squid/errors.Italian
261 %lang(ja) %{_datadir}/squid/errors.Japanese
262 %lang(ko) %{_datadir}/squid/errors.Korean
263 %lang(pl) %{_datadir}/squid/errors.Polish
264 %lang(pt) %{_datadir}/squid/errors.Portuguese
265 %lang(ro) %{_datadir}/squid/errors.Romanian
266 %lang(ru) %{_datadir}/squid/errors.Russian-1251
267 %lang(ru) %{_datadir}/squid/errors.Russian-koi8-r
268 %lang(zh) %{_datadir}/squid/errors.Simplify_Chinese
269 %lang(sk) %{_datadir}/squid/errors.Slovak
270 %lang(es) %{_datadir}/squid/errors.Spanish
271 %lang(sv) %{_datadir}/squid/errors.Swedish
272 %lang(zh) %{_datadir}/squid/errors.Traditional_Chinese
273 %lang(tr) %{_datadir}/squid/errors.Turkish
274
275 %attr(750,root,root) %{_libexecdir}
276
277 %attr(770,root,squid) %dir /var/log/archiv/squid
278 %attr(770,root,squid) %dir /var/log/squid
279 %attr(660,root,squid) %ghost /var/log/squid/*
280
281 %attr(770,root,squid) %dir /var/cache/squid
282
283 %files cachemgr
284 %defattr(644,root,root,755)
285 %attr(755,root,root) /home/httpd/cgi-bin/*
This page took 0.079834 seconds and 4 git commands to generate.