squid-vl.spec 10 KB

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