squid-vl.spec 11 KB

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