squid30-vl.spec 12 KB

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