source: projects/specs/trunk/s/squid/squid-vl.spec @ 3022

Revision 3022, 11.4 KB checked in by Takemikaduchi, 13 years ago (diff)

libxml++: rebuild vine5 package, others: rebuild with openssl-1.0.0d

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