squid-vl.spec 11 KB

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