squid30-vl.spec 12 KB

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