1 | %define __perl_requires %{SOURCE98} |
---|
2 | |
---|
3 | Name: squid |
---|
4 | Version: 3.0.STABLE23 |
---|
5 | Release: 1%{_dist_release} |
---|
6 | Summary: The Squid proxy caching server |
---|
7 | Summary(ja): Squid ウェブプロキシキャッシュ |
---|
8 | Epoch: 7 |
---|
9 | License: GPLv2+ |
---|
10 | Group: System Environment/Daemons |
---|
11 | URL: http://www.squid-cache.org |
---|
12 | Source: http://www.squid-cache.org/Squid/Versions/v3/3.0/squid-%{version}.tar.bz2 |
---|
13 | Source1: FAQ.sgml |
---|
14 | Source2: squid.init |
---|
15 | Source3: squid.logrotate |
---|
16 | Source4: squid.sysconfig |
---|
17 | Source5: squid.pam |
---|
18 | Source98: perl-requires-squid.sh |
---|
19 | |
---|
20 | # Upstream patches |
---|
21 | #Patch001: http://www.squid-cache.org/Versions/v3/3.0/changesets/bXXXX.patch |
---|
22 | |
---|
23 | # External patches |
---|
24 | |
---|
25 | # Local patches |
---|
26 | # Applying upstream patches first makes it less likely that local patches |
---|
27 | # will break upstream ones. |
---|
28 | Patch201: squid-3.0.STABLE1-config.patch |
---|
29 | Patch202: squid-3.0.STABLE1-location.patch |
---|
30 | Patch203: squid-3.0.STABLE15-build.patch |
---|
31 | Patch204: squid-3.0.STABLE1-perlpath.patch |
---|
32 | Patch205: squid-3.0.STABLE1-smb-path.patch |
---|
33 | Patch208: squid-3.0.STABLE7-from_manpg.patch |
---|
34 | |
---|
35 | Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
---|
36 | Requires: bash >= 2.0 |
---|
37 | Requires(pre): shadow-utils |
---|
38 | Requires(post): /sbin/chkconfig |
---|
39 | Requires(preun): /sbin/service /sbin/chkconfig |
---|
40 | Requires(postun): /sbin/service |
---|
41 | BuildRequires: openjade linuxdoc-tools |
---|
42 | BuildRequires: openldap-devel pam-devel openssl-devel krb5-devel |
---|
43 | BuildRequires: cyrus-sasl-devel |
---|
44 | |
---|
45 | Obsoletes: squid-novm |
---|
46 | # Obsoletes: squid26 |
---|
47 | |
---|
48 | %description |
---|
49 | Squid is a high-performance proxy caching server for Web clients, |
---|
50 | supporting FTP, gopher, and HTTP data objects. Unlike traditional |
---|
51 | caching software, Squid handles all requests in a single, |
---|
52 | non-blocking, I/O-driven process. Squid keeps meta data and especially |
---|
53 | hot objects cached in RAM, caches DNS lookups, supports non-blocking |
---|
54 | DNS lookups, and implements negative caching of failed requests. |
---|
55 | |
---|
56 | Squid consists of a main server program squid, a Domain Name System |
---|
57 | lookup program (dnsserver), a program for retrieving FTP data |
---|
58 | (ftpget), and some management and client tools. |
---|
59 | |
---|
60 | %description -l ja |
---|
61 | Squid はウェブクライアントのための高性能のプロキシキャッシュサーバで、 |
---|
62 | FTP, gopher, HTTP データオブジェクトに対応しています。これまでの |
---|
63 | キャッシュソフトウェアと違い、 Squid は全ての要求を、単一の |
---|
64 | ブロックしない I/O ドリブンのプロセスで処理します。 Squid はメタデータや |
---|
65 | ホットなオブジェクトを RAM に保持し、 DNS 問い合わせをキャッシュします。 |
---|
66 | ブロック無しの DNS 問い合わせをサポートし、失敗した要求のネガティブ |
---|
67 | キャッシングが実装されています。 |
---|
68 | |
---|
69 | Squid は、メインのサーバプログラム squid と、 Domain Name System |
---|
70 | 問い合わせプログラム (dnsserver) と、 FTP データを取得するプログラム |
---|
71 | (ftpget) と、いくつかの管理用またはクライアントツールから成ります。 |
---|
72 | |
---|
73 | %prep |
---|
74 | %setup -q |
---|
75 | |
---|
76 | %patch201 -p1 -b .config |
---|
77 | %patch202 -p1 -b .location |
---|
78 | %patch203 -p1 -b .build |
---|
79 | %patch204 -p1 -b .perlpath |
---|
80 | %patch205 -p1 -b .smb-path |
---|
81 | %patch208 -p1 -b .from_manpg |
---|
82 | |
---|
83 | %build |
---|
84 | export CXXFLAGS="-fPIE %{optflags}" ; export CFLAGS="-fPIE -Os -g -pipe -fsigned-char %{optflags}" ; export LDFLAGS="-pie" ; |
---|
85 | %configure \ |
---|
86 | --exec_prefix=/usr \ |
---|
87 | --bindir=%{_sbindir} \ |
---|
88 | --libexecdir=%{_libdir}/squid \ |
---|
89 | --localstatedir=/var \ |
---|
90 | --datadir=%{_datadir} \ |
---|
91 | --sysconfdir=/etc/squid \ |
---|
92 | --disable-dependency-tracking \ |
---|
93 | --enable-arp-acl \ |
---|
94 | --enable-auth="basic,digest,ntlm,negotiate" \ |
---|
95 | --enable-basic-auth-helpers="LDAP,MSNT,NCSA,PAM,SMB,YP,getpwnam,multi-domain-NTLM,SASL" \ |
---|
96 | --enable-negotiate-auth-helpers="squid_kerb_auth" \ |
---|
97 | --enable-cache-digests \ |
---|
98 | --enable-cachemgr-hostname=localhost \ |
---|
99 | --enable-delay-pools \ |
---|
100 | --enable-digest-auth-helpers="password" \ |
---|
101 | --enable-epoll \ |
---|
102 | --enable-external-acl-helpers="ip_user,ldap_group,unix_group,wbinfo_group" \ |
---|
103 | --enable-icap-client \ |
---|
104 | --enable-ident-lookups \ |
---|
105 | %ifnarch ppc64 ia64 x86_64 s390x |
---|
106 | --with-large-files \ |
---|
107 | %endif |
---|
108 | --enable-linux-netfilter \ |
---|
109 | --enable-ntlm-auth-helpers="SMB,fakeauth" \ |
---|
110 | --enable-referer-log \ |
---|
111 | --enable-removal-policies="heap,lru" \ |
---|
112 | --enable-snmp \ |
---|
113 | --enable-ssl \ |
---|
114 | --enable-storeio="aufs,diskd,null,ufs" \ |
---|
115 | --enable-useragent-log \ |
---|
116 | --enable-wccpv2 \ |
---|
117 | --with-aio \ |
---|
118 | --with-default-user="squid" \ |
---|
119 | --with-filedescriptors=16384 \ |
---|
120 | --with-dl \ |
---|
121 | --with-pthreads |
---|
122 | |
---|
123 | # following options are disabled by vine |
---|
124 | # --with-openssl=/usr/kerberos \ |
---|
125 | |
---|
126 | # following options are no longer supported |
---|
127 | # --with-winbind-auth-challenge \ |
---|
128 | # --enable-follow-x-forwarded-for \ |
---|
129 | # --enable-fd-config \ |
---|
130 | # --with-maxfd=16384 \ |
---|
131 | # --enable-underscores \ |
---|
132 | |
---|
133 | export CXXFLAGS="-fPIE" ; export CFLAGS="-fPIE -Os -g -pipe -fsigned-char" ; export LDFLAGS="-pie" ; |
---|
134 | make %{?_smp_mflags} |
---|
135 | |
---|
136 | mkdir faq |
---|
137 | cp %{SOURCE1} faq |
---|
138 | cd faq |
---|
139 | sgml2html FAQ.sgml |
---|
140 | |
---|
141 | %install |
---|
142 | rm -rf $RPM_BUILD_ROOT |
---|
143 | %makeinstall \ |
---|
144 | sysconfdir=$RPM_BUILD_ROOT/etc/squid \ |
---|
145 | localstatedir=$RPM_BUILD_ROOT/var \ |
---|
146 | bindir=$RPM_BUILD_ROOT/%{_sbindir} \ |
---|
147 | libexecdir=$RPM_BUILD_ROOT/%{_libdir}/squid |
---|
148 | echo " |
---|
149 | # |
---|
150 | # This is /etc/httpd/conf.d/squid.conf |
---|
151 | # |
---|
152 | |
---|
153 | ScriptAlias /Squid/cgi-bin/cachemgr.cgi %{_libdir}/squid/cachemgr.cgi |
---|
154 | |
---|
155 | # Only allow access from localhost by default |
---|
156 | <Location /Squid/cgi-bin/cachemgr.cgi> |
---|
157 | order allow,deny |
---|
158 | allow from localhost.localdomain |
---|
159 | # Add additional allowed hosts as needed |
---|
160 | # allow from .example.com |
---|
161 | </Location>" > $RPM_BUILD_ROOT/squid.httpd.tmp |
---|
162 | |
---|
163 | |
---|
164 | ln -s ../../%{_datadir}/squid/errors/English $RPM_BUILD_ROOT/etc/squid/errors |
---|
165 | ln -s ../../%{_datadir}/squid/icons $RPM_BUILD_ROOT/etc/squid/icons |
---|
166 | |
---|
167 | mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d |
---|
168 | mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d |
---|
169 | mkdir -p $RPM_BUILD_ROOT/etc/sysconfig |
---|
170 | mkdir -p $RPM_BUILD_ROOT/etc/pam.d |
---|
171 | mkdir -p $RPM_BUILD_ROOT/etc/httpd/conf.d/ |
---|
172 | install -m 755 %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/squid |
---|
173 | install -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/squid |
---|
174 | install -m 644 %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/squid |
---|
175 | install -m 644 %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/squid |
---|
176 | install -m 644 $RPM_BUILD_ROOT/squid.httpd.tmp $RPM_BUILD_ROOT/etc/httpd/conf.d/squid.conf |
---|
177 | mkdir -p $RPM_BUILD_ROOT/var/log/squid |
---|
178 | mkdir -p $RPM_BUILD_ROOT/var/spool/squid |
---|
179 | chmod 644 contrib/url-normalizer.pl contrib/rredir.* contrib/user-agents.pl |
---|
180 | iconv -f ISO88591 -t UTF8 ChangeLog -o ChangeLog.tmp |
---|
181 | mv -f ChangeLog.tmp ChangeLog |
---|
182 | |
---|
183 | # remove unpackaged files from the buildroot |
---|
184 | rm -f $RPM_BUILD_ROOT%{_sbindir}/{RunAccel,RunCache} |
---|
185 | rm -f $RPM_BUILD_ROOT/squid.httpd.tmp |
---|
186 | |
---|
187 | %clean |
---|
188 | rm -rf $RPM_BUILD_ROOT |
---|
189 | |
---|
190 | %files |
---|
191 | %defattr(-,root,root,-) |
---|
192 | %doc faq/*\.html README ChangeLog QUICKSTART |
---|
193 | %doc contrib/url-normalizer.pl contrib/rredir.* contrib/user-agents.pl |
---|
194 | |
---|
195 | %attr(755,root,root) %dir /etc/squid |
---|
196 | %attr(755,root,root) %dir %{_libdir}/squid |
---|
197 | %attr(750,squid,squid) %dir /var/log/squid |
---|
198 | %attr(750,squid,squid) %dir /var/spool/squid |
---|
199 | %attr(4750,root,squid) %{_libdir}/squid/ncsa_auth |
---|
200 | %attr(4750,root,squid) %{_libdir}/squid/pam_auth |
---|
201 | |
---|
202 | %config(noreplace) %attr(644,root,root) /etc/httpd/conf.d/squid.conf |
---|
203 | %config(noreplace) %attr(640,root,squid) /etc/squid/squid.conf |
---|
204 | %config(noreplace) %attr(644,root,squid) /etc/squid/cachemgr.conf |
---|
205 | %config(noreplace) /etc/squid/mime.conf |
---|
206 | %config(noreplace) /etc/sysconfig/squid |
---|
207 | %config(noreplace) /etc/squid/msntauth.conf |
---|
208 | %config(noreplace) /etc/squid/mib.txt |
---|
209 | # These are not noreplace because they are just sample config files |
---|
210 | %config /etc/squid/msntauth.conf.default |
---|
211 | %config /etc/squid/squid.conf.default |
---|
212 | %config /etc/squid/mime.conf.default |
---|
213 | %config /etc/squid/cachemgr.conf.default |
---|
214 | %config(noreplace) /etc/pam.d/squid |
---|
215 | %config(noreplace) /etc/logrotate.d/squid |
---|
216 | |
---|
217 | %config(noreplace) /etc/squid/errors |
---|
218 | %dir %{_datadir}/squid |
---|
219 | %attr(-,root,root) %{_datadir}/squid/errors |
---|
220 | %attr(-,root,root) /etc/squid/icons |
---|
221 | %attr(755,root,root) /etc/rc.d/init.d/squid |
---|
222 | %{_datadir}/squid/icons |
---|
223 | %{_sbindir}/squid |
---|
224 | %{_sbindir}/squidclient |
---|
225 | %{_mandir}/man8/* |
---|
226 | %{_libdir}/squid/* |
---|
227 | |
---|
228 | %pre |
---|
229 | if ! getent group squid >/dev/null 2>&1; then |
---|
230 | /usr/sbin/groupadd -g 23 squid |
---|
231 | fi |
---|
232 | |
---|
233 | if ! getent passwd squid >/dev/null 2>&1 ; then |
---|
234 | /usr/sbin/useradd -g 23 -u 23 -d /var/spool/squid -r -s /sbin/nologin squid >/dev/null 2>&1 || exit 1 |
---|
235 | fi |
---|
236 | |
---|
237 | for i in /var/log/squid /var/spool/squid ; do |
---|
238 | if [ -d $i ] ; then |
---|
239 | for adir in `find $i -maxdepth 0 \! -user squid`; do |
---|
240 | chown -R squid:squid $adir |
---|
241 | done |
---|
242 | fi |
---|
243 | done |
---|
244 | |
---|
245 | exit 0 |
---|
246 | |
---|
247 | %post |
---|
248 | /sbin/chkconfig --add squid |
---|
249 | if [ $1 = 0 ]; then |
---|
250 | case "$LANG" in |
---|
251 | bg*) |
---|
252 | DIR=Bulgarian |
---|
253 | ;; |
---|
254 | ca*) |
---|
255 | DIR=Catalan |
---|
256 | ;; |
---|
257 | cs*) |
---|
258 | DIR=Czech |
---|
259 | ;; |
---|
260 | da*) |
---|
261 | DIR=Danish |
---|
262 | ;; |
---|
263 | nl*) |
---|
264 | DIR=Dutch |
---|
265 | ;; |
---|
266 | en*) |
---|
267 | DIR=English |
---|
268 | ;; |
---|
269 | ea*) |
---|
270 | DIR=Estonian |
---|
271 | ;; |
---|
272 | fi*) |
---|
273 | DIR=Finnish |
---|
274 | ;; |
---|
275 | fr*) |
---|
276 | DIR=French |
---|
277 | ;; |
---|
278 | de*) |
---|
279 | DIR=German |
---|
280 | ;; |
---|
281 | he*) |
---|
282 | DIR=Hebrew |
---|
283 | ;; |
---|
284 | hu*) |
---|
285 | DIR=Hungarian |
---|
286 | ;; |
---|
287 | it*) |
---|
288 | DIR=Italian |
---|
289 | ;; |
---|
290 | ja*) |
---|
291 | DIR=Japanese |
---|
292 | ;; |
---|
293 | kr*) |
---|
294 | DIR=Korean |
---|
295 | ;; |
---|
296 | pl*) |
---|
297 | DIR=Polish |
---|
298 | ;; |
---|
299 | pt*) |
---|
300 | DIR=Portuguese |
---|
301 | ;; |
---|
302 | ro*) |
---|
303 | DIR=Romanian |
---|
304 | ;; |
---|
305 | ru*) |
---|
306 | DIR=Russian-koi8-r |
---|
307 | ;; |
---|
308 | sr*) |
---|
309 | DIR=Serbian |
---|
310 | ;; |
---|
311 | sk*) |
---|
312 | DIR=Slovak |
---|
313 | ;; |
---|
314 | es*) |
---|
315 | DIR=Spanish |
---|
316 | ;; |
---|
317 | sv*) |
---|
318 | DIR=Swedish |
---|
319 | ;; |
---|
320 | zh_TW*) |
---|
321 | DIR=Traditional_Chinese |
---|
322 | ;; |
---|
323 | zh_CN*) |
---|
324 | DIR=Simplify_Chinese |
---|
325 | ;; |
---|
326 | tr*) |
---|
327 | DIR=Turkish |
---|
328 | ;; |
---|
329 | greek) |
---|
330 | DIR=Greek |
---|
331 | ;; |
---|
332 | *) |
---|
333 | DIR=English |
---|
334 | ;; |
---|
335 | esac |
---|
336 | ln -snf %{_datadir}/squid/errors/$DIR /etc/squid/errors |
---|
337 | fi |
---|
338 | |
---|
339 | %preun |
---|
340 | if [ $1 = 0 ] ; then |
---|
341 | service squid stop >/dev/null 2>&1 |
---|
342 | rm -f /var/log/squid/* |
---|
343 | /sbin/chkconfig --del squid |
---|
344 | fi |
---|
345 | |
---|
346 | %postun |
---|
347 | if [ "$1" -ge "1" ] ; then |
---|
348 | # service squid condrestart >/dev/null 2>&1 |
---|
349 | service squid condrestart |
---|
350 | fi |
---|
351 | |
---|
352 | %triggerin -- samba-common |
---|
353 | /usr/sbin/usermod -a -G wbpriv squid >/dev/null 2>&1 || \ |
---|
354 | chgrp squid /var/cache/samba/winbindd_privileged >/dev/null 2>&1 || : |
---|
355 | |
---|
356 | %changelog |
---|
357 | * Wed Feb 3 2010 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> |
---|
358 | - 7:3.0.STABLE23-1 |
---|
359 | - new upstream release with security fix (Handle DNS header-only packet) |
---|
360 | |
---|
361 | * Wed Aug 5 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> |
---|
362 | - 7:3.0.STABLE18-1 |
---|
363 | - new upstream release |
---|
364 | - add ja summary/discription |
---|
365 | |
---|
366 | * Tue Jul 28 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> |
---|
367 | - 7:3.0.STABLE17-1 |
---|
368 | - new upstream release |
---|
369 | - drop patch209 (is included in new release) |
---|
370 | |
---|
371 | * Mon Jun 22 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> |
---|
372 | - 7:3.0.STABLE16-3 |
---|
373 | - update patch209 (from upstream) |
---|
374 | |
---|
375 | * Tue Jun 16 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> |
---|
376 | - 7:3.0.STABLE16-2 |
---|
377 | - add patch209 to fix build error |
---|
378 | |
---|
379 | * Tue Jun 16 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> |
---|
380 | - 7:3.0.STABLE16-1 |
---|
381 | - new upstream release |
---|
382 | |
---|
383 | * Sat May 09 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> |
---|
384 | - 7:3.0.STABLE15-1 |
---|
385 | - new upstream release |
---|
386 | - update Patch203 to fit new release |
---|
387 | |
---|
388 | * Mon May 04 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> |
---|
389 | - 7:3.0.STABLE14-2 |
---|
390 | - comment out "Obsoletes: squid26" |
---|
391 | |
---|
392 | * Mon May 04 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> |
---|
393 | - 7:3.0.STABLE14-1 |
---|
394 | - Initial build for VineSeed / Vine 5.x |
---|
395 | - This package is based on Fedora 3.0.STABLE13-1 |
---|