1 | %define base_name squid |
---|
2 | %define pkg_epoch 7 |
---|
3 | %define pkg_version 3.1.21 |
---|
4 | %define pkg_release 1%{?_dist_release} |
---|
5 | %define uid 23 |
---|
6 | %define gid 23 |
---|
7 | |
---|
8 | Summary: The Squid proxy caching server |
---|
9 | Summary(ja): Squid ウェブプロキシキャッシュ |
---|
10 | Name: %{base_name} |
---|
11 | Epoch: %{pkg_epoch} |
---|
12 | Version: %{pkg_version} |
---|
13 | Release: %{pkg_release} |
---|
14 | Source0: %{base_name}-%{version}.tar.bz2 |
---|
15 | Source1: %{base_name}.init |
---|
16 | Source2: %{base_name}.logrotate |
---|
17 | Source3: %{base_name}.sysconfig |
---|
18 | Source4: %{base_name}.pam |
---|
19 | License: GPLv2+ |
---|
20 | Group: Applications/Services |
---|
21 | URL: http://www.squid-cache.org |
---|
22 | |
---|
23 | Requires: bash >= 2.0 |
---|
24 | Requires(pre): shadow-utils |
---|
25 | Requires(post): %{_syssbindir}/chkconfig |
---|
26 | Requires(preun): %{_syssbindir}/chkconfig |
---|
27 | BuildRequires: openldap-devel pam-devel openssl-devel krb5-devel |
---|
28 | BuildRequires: cyrus-sasl-devel libcap-devel |
---|
29 | BuildRoot: %{_tmppath}/%{base_name}-%{version}-root |
---|
30 | |
---|
31 | Conflicts: squid30 |
---|
32 | Obsoletes: squid-novm |
---|
33 | |
---|
34 | Vendor: Project Vine |
---|
35 | Distribution: Vine Linux |
---|
36 | Packager: miyabi |
---|
37 | |
---|
38 | %description |
---|
39 | Squid is a high-performance proxy caching server for Web clients, |
---|
40 | supporting FTP, gopher, and HTTP data objects. Unlike traditional |
---|
41 | caching software, Squid handles all requests in a single, |
---|
42 | non-blocking, I/O-driven process. Squid keeps meta data and especially |
---|
43 | hot objects cached in RAM, caches DNS lookups, supports non-blocking |
---|
44 | DNS lookups, and implements negative caching of failed requests. |
---|
45 | |
---|
46 | Squid consists of a main server program squid, a Domain Name System |
---|
47 | lookup program (dnsserver), a program for retrieving FTP data |
---|
48 | (ftpget), and some management and client tools. |
---|
49 | |
---|
50 | %description -l ja |
---|
51 | Squid はウェブクライアントのための高性能のプロキシキャッシュサーバで、 |
---|
52 | FTP, gopher, HTTP データオブジェクトに対応しています。これまでの |
---|
53 | キャッシュソフトウェアと違い、 Squid は全ての要求を、単一の |
---|
54 | ブロックしない I/O ドリブンのプロセスで処理します。 Squid はメタデータや |
---|
55 | ホットなオブジェクトを RAM に保持し、 DNS 問い合わせをキャッシュします。 |
---|
56 | ブロック無しの DNS 問い合わせをサポートし、失敗した要求のネガティブ |
---|
57 | キャッシングが実装されています。 |
---|
58 | |
---|
59 | Squid は、メインのサーバプログラム squid と、 Domain Name System |
---|
60 | 問い合わせプログラム (dnsserver) と、 FTP データを取得するプログラム |
---|
61 | (ftpget) と、いくつかの管理用またはクライアントツールから成ります。 |
---|
62 | |
---|
63 | %prep |
---|
64 | %setup -q |
---|
65 | |
---|
66 | %build |
---|
67 | export CXXFLAGS="-fPIE %{optflags}" ; export CFLAGS="-fPIE -Os -g -pipe -fsigned-char %{optflags}" ; export LDFLAGS="-pie" ; |
---|
68 | %configure \ |
---|
69 | --libexecdir=%{_libdir}/%{base_name} \ |
---|
70 | --sysconfdir=%{_sysconfdir}/%{base_name} \ |
---|
71 | --datadir=%{_datadir}/%{base_name} \ |
---|
72 | --disable-dependency-tracking \ |
---|
73 | --enable-arp-acl \ |
---|
74 | --enable-auth="basic,digest,ntlm,negotiate" \ |
---|
75 | --enable-basic-auth-helpers="LDAP,MSNT,NCSA,PAM,SMB,YP,getpwnam,multi-domain-NTLM,SASL" \ |
---|
76 | --enable-negotiate-auth-helpers="squid_kerb_auth" \ |
---|
77 | --enable-cache-digests \ |
---|
78 | --enable-cachemgr-hostname=localhost \ |
---|
79 | --enable-delay-pools \ |
---|
80 | --enable-digest-auth-helpers="password" \ |
---|
81 | --enable-epoll \ |
---|
82 | --enable-external-acl-helpers="ip_user,ldap_group,unix_group,wbinfo_group" \ |
---|
83 | --enable-icap-client \ |
---|
84 | --enable-ident-lookups \ |
---|
85 | %ifnarch ppc64 ia64 x86_64 s390x |
---|
86 | --with-large-files \ |
---|
87 | %endif |
---|
88 | --enable-linux-netfilter \ |
---|
89 | --enable-ntlm-auth-helpers="smb_lm,fakeauth" \ |
---|
90 | --enable-referer-log \ |
---|
91 | --enable-removal-policies="heap,lru" \ |
---|
92 | --enable-snmp \ |
---|
93 | --enable-ssl \ |
---|
94 | --enable-storeio="aufs,diskd,ufs" \ |
---|
95 | --enable-useragent-log \ |
---|
96 | --enable-wccpv2 \ |
---|
97 | --with-aio \ |
---|
98 | --with-default-user="%{base_name}" \ |
---|
99 | --with-logdir=%{_localstatedir}/log/%{base_name} \ |
---|
100 | --with-filedescriptors=16384 \ |
---|
101 | --with-dl \ |
---|
102 | --with-pthreads |
---|
103 | |
---|
104 | export CXXFLAGS="-fPIE" ; export CFLAGS="-fPIE -Os -g -pipe -fsigned-char" ; export LDFLAGS="-pie" ; |
---|
105 | %{__make} \ |
---|
106 | %{?_smp_mflags} \ |
---|
107 | DEFAULT_SWAP_DIR="%{_localstatedir}/cache/%{base_name}" |
---|
108 | |
---|
109 | %install |
---|
110 | [ "${RPM_BUILD_ROOT}" != "/" ] && %{__rm} -rf ${RPM_BUILD_ROOT} |
---|
111 | |
---|
112 | %{__make} install \ |
---|
113 | DESTDIR="${RPM_BUILD_ROOT}" \ |
---|
114 | DEFAULT_SWAP_DIR="%{_localstatedir}/cache/%{base_name}" |
---|
115 | |
---|
116 | echo " |
---|
117 | # |
---|
118 | # This is %{_sysconfdir}/httpd/conf.d/%{base_name}.conf |
---|
119 | # |
---|
120 | |
---|
121 | ScriptAlias /Squid/cgi-bin/cachemgr.cgi %{_libdir}/%{base_name}/cachemgr.cgi |
---|
122 | |
---|
123 | # Only allow access from localhost by default |
---|
124 | <Location /Squid/cgi-bin/cachemgr.cgi> |
---|
125 | order allow,deny |
---|
126 | allow from localhost.localdomain |
---|
127 | # Add additional allowed hosts as needed |
---|
128 | # allow from .example.com |
---|
129 | </Location>" > ${RPM_BUILD_ROOT}/%{base_name}.httpd.tmp |
---|
130 | |
---|
131 | mkdir -p ${RPM_BUILD_ROOT}%{_initdir} |
---|
132 | mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d |
---|
133 | mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig |
---|
134 | mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/pam.d |
---|
135 | mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d/ |
---|
136 | |
---|
137 | install -m 755 %{SOURCE1} ${RPM_BUILD_ROOT}%{_initdir}/%{base_name} |
---|
138 | install -m 644 %{SOURCE2} ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{base_name} |
---|
139 | install -m 644 %{SOURCE3} ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/%{base_name} |
---|
140 | install -m 644 %{SOURCE4} ${RPM_BUILD_ROOT}%{_sysconfdir}/pam.d/%{base_name} |
---|
141 | install -m 644 ${RPM_BUILD_ROOT}/%{base_name}.httpd.tmp ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d/%{base_name}.conf |
---|
142 | mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/log/%{base_name} |
---|
143 | mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/cache/%{base_name} |
---|
144 | chmod 644 contrib/url-normalizer.pl contrib/rredir.* contrib/user-agents.pl |
---|
145 | iconv -f ISO88591 -t UTF8 ChangeLog -o ChangeLog.tmp |
---|
146 | mv -f ChangeLog.tmp ChangeLog |
---|
147 | |
---|
148 | # remove unpackaged files from the buildroot |
---|
149 | rm -f ${RPM_BUILD_ROOT}/%{base_name}.httpd.tmp |
---|
150 | |
---|
151 | %clean |
---|
152 | [ "${RPM_BUILD_ROOT}" != "/" ] && %{__rm} -rf ${RPM_BUILD_ROOT} |
---|
153 | |
---|
154 | %pre |
---|
155 | if ! getent group %{base_name} >/dev/null 2>&1; then |
---|
156 | /usr/sbin/groupadd -g %{gid} %{base_name} |
---|
157 | fi |
---|
158 | |
---|
159 | if ! getent passwd %{base_name} >/dev/null 2>&1 ; then |
---|
160 | /usr/sbin/useradd -g %{gid} -u %{uid} -d %{_localstatedir}/cache/%{base_name} -r -s /sbin/nologin %{base_name} >/dev/null 2>&1 || exit 1 |
---|
161 | fi |
---|
162 | |
---|
163 | for i in %{_localstatedir}/log/%{base_name} %{_localstatedir}/cache/%{base_name} ; do |
---|
164 | if [ -d $i ] ; then |
---|
165 | for adir in `find $i -maxdepth 0 \! -user %{base_name}`; do |
---|
166 | chown -R %{base_name}:%{base_name} $adir |
---|
167 | done |
---|
168 | fi |
---|
169 | done |
---|
170 | |
---|
171 | exit 0 |
---|
172 | |
---|
173 | %post |
---|
174 | if ! /sbin/chkconfig %{base_name}; then |
---|
175 | /sbin/chkconfig --add %{base_name} |
---|
176 | fi |
---|
177 | |
---|
178 | if [ "$1" -eq "2" ]; then |
---|
179 | %{_initdir}/%{base_name} condrestart |
---|
180 | fi |
---|
181 | |
---|
182 | %preun |
---|
183 | if [ "$1" -eq "0" ]; then |
---|
184 | %{_initdir}/%{base_name} stop |
---|
185 | rm -f %{_localstatedir}/log/%{base_name}/* |
---|
186 | /sbin/chkconfig --del %{base_name} |
---|
187 | fi |
---|
188 | |
---|
189 | %triggerin -- samba-common |
---|
190 | /usr/sbin/usermod -a -G wbpriv %{base_name} >/dev/null 2>&1 || \ |
---|
191 | chgrp %{base_name} %{_localstatedir}/cache/samba/winbindd_privileged >/dev/null 2>&1 || : |
---|
192 | |
---|
193 | %files |
---|
194 | %defattr(-,root,root,-) |
---|
195 | |
---|
196 | # Directory |
---|
197 | %dir %{_sysconfdir}/%{base_name}/ |
---|
198 | %dir %{_libdir}/%{base_name} |
---|
199 | %dir %{_datadir}/%{base_name} |
---|
200 | |
---|
201 | %attr(0750,%{base_name},%{base_name}) %dir %{_localstatedir}/log/%{base_name} |
---|
202 | %attr(0750,%{base_name},%{base_name}) %dir %{_localstatedir}/cache/%{base_name} |
---|
203 | |
---|
204 | # Program Files |
---|
205 | %attr(0755,root,root) %{_sbindir}/%{base_name} |
---|
206 | %attr(0755,root,root) %{_bindir}/squidclient |
---|
207 | |
---|
208 | %attr(0755,root,root) %{_initdir}/%{base_name} |
---|
209 | |
---|
210 | %attr(0755,root,root) %{_libdir}/%{base_name}/cachemgr.cgi |
---|
211 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/digest_pw_auth |
---|
212 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/diskd |
---|
213 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/fakeauth_auth |
---|
214 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/getpwname_auth |
---|
215 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/ip_user_check |
---|
216 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/msnt_auth |
---|
217 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/ncsa_auth |
---|
218 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/negotiate_kerb_auth |
---|
219 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/negotiate_kerb_auth_test |
---|
220 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/ntlm_smb_lm_auth |
---|
221 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/pam_auth |
---|
222 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/sasl_auth |
---|
223 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/smb_auth |
---|
224 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/smb_auth.pl |
---|
225 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/smb_auth.sh |
---|
226 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/squid_kerb_auth |
---|
227 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/squid_kerb_auth_test |
---|
228 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/squid_ldap_auth |
---|
229 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/squid_ldap_group |
---|
230 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/squid_unix_group |
---|
231 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/unlinkd |
---|
232 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/wbinfo_group.pl |
---|
233 | %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/yp_auth |
---|
234 | |
---|
235 | # Config Files |
---|
236 | %attr(0640,root,%{base_name}) %config(noreplace) %{_sysconfdir}/%{base_name}/%{base_name}.conf |
---|
237 | %attr(0644,root,%{base_name}) %config(noreplace) %{_sysconfdir}/%{base_name}/cachemgr.conf |
---|
238 | %config(noreplace) %{_sysconfdir}/%{base_name}/mime.conf |
---|
239 | %config(noreplace) %{_sysconfdir}/%{base_name}/msntauth.conf |
---|
240 | %config(noreplace) %{_sysconfdir}/%{base_name}/errorpage.css |
---|
241 | |
---|
242 | %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{base_name}.conf |
---|
243 | |
---|
244 | %config(noreplace) %{_sysconfdir}/sysconfig/%{base_name} |
---|
245 | %config(noreplace) %{_sysconfdir}/pam.d/%{base_name} |
---|
246 | %config(noreplace) %{_sysconfdir}/logrotate.d/%{base_name} |
---|
247 | |
---|
248 | # Sample Config Files |
---|
249 | %config %{_sysconfdir}/%{base_name}/%{base_name}.conf.default |
---|
250 | %config %{_sysconfdir}/%{base_name}/cachemgr.conf.default |
---|
251 | %config %{_sysconfdir}/%{base_name}/mime.conf.default |
---|
252 | %config %{_sysconfdir}/%{base_name}/msntauth.conf.default |
---|
253 | %config %{_sysconfdir}/%{base_name}/errorpage.css.default |
---|
254 | |
---|
255 | # Data Files |
---|
256 | %{_datadir}/%{base_name}/* |
---|
257 | |
---|
258 | # Document Files |
---|
259 | %doc README ChangeLog QUICKSTART |
---|
260 | %doc contrib/url-normalizer.pl contrib/rredir.* contrib/user-agents.pl |
---|
261 | %{_mandir}/man8/* |
---|
262 | %{_mandir}/man1/* |
---|
263 | %{_sysconfdir}/%{base_name}/%{base_name}.conf.documented |
---|
264 | |
---|
265 | %changelog |
---|
266 | * Thu Nov 22 2012 Masahiro INOUE <miyabi.-.inoue@nifty.com> 3.1.21-1 |
---|
267 | - new upstream release |
---|
268 | |
---|
269 | * Thu Aug 23 2012 Masahiro INOUE <miyabi.-.inoue@nifty.com> 3.1.20-1 |
---|
270 | - new upstream release |
---|
271 | |
---|
272 | * Mon Oct 17 2011 Masahiro INOUE <miyabi.-.inoue@nifty.com> 3.1.16-1 |
---|
273 | - new upstream release |
---|
274 | - add BuildRequires - libcap-devel |
---|
275 | |
---|
276 | * Fri Jun 10 2011 Masahiro INOUE <miyabi.-.inoue@nifty.com> 3.1.12-2 |
---|
277 | - files in libexec moved to libdir |
---|
278 | |
---|
279 | * Tue May 17 2011 Masahiro INOUE <miyabi.-.inoue@nifty.com> 3.1.12-1 |
---|
280 | - initial build for Vine Linux |
---|
281 | - This package is based on Vine Linux - squid-3.0.STABLE25-2 |
---|