squid-vl.spec 11 KB

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