squid-vl.spec 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. %define base_name squid
  2. %define pkg_epoch 7
  3. %define pkg_version 3.4.6
  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.xz
  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 \
  65. --enable-auth-basic="DB,LDAP,MSNT,MSNT-multi-domain,NCSA,NIS,PAM,POP3,SASL,SMB,getpwnam" \
  66. --enable-auth-digest="file,LDAP,eDirectory" \
  67. --enable-auth-negotiate="kerberos" \
  68. --enable-auth-ntlm="smb_lm,fake" \
  69. --enable-external-acl-helpers="LDAP_group,time_quota,session,unix_group,wbinfo_group" \
  70. --enable-cache-digests \
  71. --enable-cachemgr-hostname=localhost \
  72. --enable-delay-pools \
  73. --enable-epoll \
  74. --enable-icap-client \
  75. --enable-ident-lookups \
  76. %ifnarch ppc64 ia64 x86_64 s390x
  77. --with-large-files \
  78. %endif
  79. --enable-linux-netfilter \
  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}/*
  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}/basic_*
  178. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/cert_*
  179. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/digest_*
  180. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/diskd
  181. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/ext_*
  182. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/helper*
  183. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/log_*
  184. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/negotiate_*
  185. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/ntlm_*
  186. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/storeid_*
  187. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/unlinkd
  188. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/url_*
  189. # Config Files
  190. %attr(0640,root,%{base_name}) %config(noreplace) %{_sysconfdir}/%{base_name}/%{base_name}.conf
  191. %attr(0644,root,%{base_name}) %config(noreplace) %{_sysconfdir}/%{base_name}/cachemgr.conf
  192. %config(noreplace) %{_sysconfdir}/%{base_name}/mime.conf
  193. %config(noreplace) %{_sysconfdir}/%{base_name}/msntauth.conf
  194. %config(noreplace) %{_sysconfdir}/%{base_name}/errorpage.css
  195. %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{base_name}.conf
  196. %config(noreplace) %{_sysconfdir}/sysconfig/%{base_name}
  197. %config(noreplace) %{_sysconfdir}/pam.d/%{base_name}
  198. %config(noreplace) %{_sysconfdir}/logrotate.d/%{base_name}
  199. # Sample Config Files
  200. %config %{_sysconfdir}/%{base_name}/%{base_name}.conf.default
  201. %config %{_sysconfdir}/%{base_name}/cachemgr.conf.default
  202. %config %{_sysconfdir}/%{base_name}/mime.conf.default
  203. %config %{_sysconfdir}/%{base_name}/msntauth.conf.default
  204. %config %{_sysconfdir}/%{base_name}/errorpage.css.default
  205. # Data Files
  206. %{_datadir}/%{base_name}/*
  207. # Document Files
  208. %doc README ChangeLog QUICKSTART
  209. %doc contrib/url-normalizer.pl contrib/rredir.* contrib/user-agents.pl
  210. %{_mandir}/man8/*
  211. %{_mandir}/man1/*
  212. %{_sysconfdir}/%{base_name}/%{base_name}.conf.documented
  213. %changelog
  214. * Mon Jul 7 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.4.6-1
  215. - new upstream release.
  216. * Sat Jan 12 2013 Masahiro INOUE <miyabi.-.inoue@nifty.com> 3.1.23-1
  217. - new upstream release
  218. * Sat Dec 08 2012 Masahiro INOUE <miyabi.-.inoue@nifty.com> 3.1.22-1
  219. - new upstream release
  220. * Thu Nov 22 2012 Masahiro INOUE <miyabi.-.inoue@nifty.com> 3.1.21-1
  221. - new upstream release
  222. * Thu Aug 23 2012 Masahiro INOUE <miyabi.-.inoue@nifty.com> 3.1.20-1
  223. - new upstream release
  224. * Mon Oct 17 2011 Masahiro INOUE <miyabi.-.inoue@nifty.com> 3.1.16-1
  225. - new upstream release
  226. - add BuildRequires - libcap-devel
  227. * Fri Jun 10 2011 Masahiro INOUE <miyabi.-.inoue@nifty.com> 3.1.12-2
  228. - files in libexec moved to libdir
  229. * Tue May 17 2011 Masahiro INOUE <miyabi.-.inoue@nifty.com> 3.1.12-1
  230. - initial build for Vine Linux
  231. - This package is based on Vine Linux - squid-3.0.STABLE25-2