squid-vl.spec 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. %define base_name squid
  2. %define pkg_epoch 7
  3. %define pkg_version 3.5.27
  4. %define pkg_release 2%{?_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.5.27-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. --enable-internal-dns \
  101. --with-aio \
  102. --with-default-user="%{base_name}" \
  103. --with-filedescriptors=16384 \
  104. --with-dl \
  105. --with-openssl \
  106. --with-pthreads \
  107. --disable-arch-native \
  108. --with-pic
  109. %{__make} \
  110. %{?_smp_mflags} \
  111. DEFAULT_SWAP_DIR="%{_localstatedir}/cache/%{base_name}"
  112. %install
  113. [ "${RPM_BUILD_ROOT}" != "/" ] && %{__rm} -rf ${RPM_BUILD_ROOT}
  114. %{__make} install \
  115. DESTDIR="${RPM_BUILD_ROOT}" \
  116. DEFAULT_SWAP_DIR="%{_localstatedir}/cache/%{base_name}"
  117. echo "
  118. #
  119. # This is %{_sysconfdir}/httpd/conf.d/%{base_name}.conf
  120. #
  121. ScriptAlias /Squid/cgi-bin/cachemgr.cgi %{_libdir}/%{base_name}/cachemgr.cgi
  122. # Only allow access from localhost by default
  123. <Location /Squid/cgi-bin/cachemgr.cgi>
  124. order allow,deny
  125. allow from localhost.localdomain
  126. # Add additional allowed hosts as needed
  127. # allow from .example.com
  128. </Location>" > ${RPM_BUILD_ROOT}/%{base_name}.httpd.tmp
  129. mkdir -p ${RPM_BUILD_ROOT}%{_initdir}
  130. mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d
  131. mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
  132. mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/pam.d
  133. mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d/
  134. install -m 755 %{SOURCE1} ${RPM_BUILD_ROOT}%{_initdir}/%{base_name}
  135. install -m 644 %{SOURCE2} ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{base_name}
  136. install -m 644 %{SOURCE3} ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/%{base_name}
  137. install -m 644 %{SOURCE4} ${RPM_BUILD_ROOT}%{_sysconfdir}/pam.d/%{base_name}
  138. install -m 644 ${RPM_BUILD_ROOT}/%{base_name}.httpd.tmp ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d/%{base_name}.conf
  139. mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/log/%{base_name}
  140. mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/cache/%{base_name}
  141. chmod 644 contrib/url-normalizer.pl contrib/rredir.* contrib/user-agents.pl
  142. iconv -f ISO88591 -t UTF8 ChangeLog -o ChangeLog.tmp
  143. mv -f ChangeLog.tmp ChangeLog
  144. # remove unpackaged files from the buildroot
  145. rm -f ${RPM_BUILD_ROOT}/%{base_name}.httpd.tmp
  146. %clean
  147. [ "${RPM_BUILD_ROOT}" != "/" ] && %{__rm} -rf ${RPM_BUILD_ROOT}
  148. %pretrans
  149. for l in zh-cn zh-tw; do
  150. if [ -d /usr/share/squid/errors/$l -a ! -L /usr/share/squid/errors/$l ]; then
  151. rm -rf /usr/share/squid/errors/$l
  152. fi
  153. done
  154. %pre
  155. if ! getent group %{base_name} >/dev/null 2>&1; then
  156. /usr/sbin/groupadd -g %{gid} %{base_name}
  157. fi
  158. if ! getent passwd %{base_name} >/dev/null 2>&1 ; then
  159. /usr/sbin/useradd -g %{gid} -u %{uid} -d %{_localstatedir}/cache/%{base_name} -r -s /sbin/nologin %{base_name} >/dev/null 2>&1 || exit 1
  160. fi
  161. for i in %{_localstatedir}/log/%{base_name} %{_localstatedir}/cache/%{base_name} ; do
  162. if [ -d $i ] ; then
  163. for adir in `find $i -maxdepth 0 \! -user %{base_name}`; do
  164. chown -R %{base_name}:%{base_name} $adir
  165. done
  166. fi
  167. done
  168. exit 0
  169. %post
  170. if ! /sbin/chkconfig %{base_name}; then
  171. /sbin/chkconfig --add %{base_name}
  172. fi
  173. if [ "$1" -eq "2" ]; then
  174. %{_initdir}/%{base_name} condrestart
  175. fi
  176. %preun
  177. if [ "$1" -eq "0" ]; then
  178. %{_initdir}/%{base_name} stop
  179. rm -f %{_localstatedir}/log/%{base_name}/*
  180. /sbin/chkconfig --del %{base_name}
  181. fi
  182. %triggerin -- samba-common
  183. /usr/sbin/usermod -a -G wbpriv %{base_name} >/dev/null 2>&1 || \
  184. chgrp %{base_name} %{_localstatedir}/cache/samba/winbindd_privileged >/dev/null 2>&1 || :
  185. %files
  186. %defattr(-,root,root,-)
  187. # Directory
  188. %dir %{_sysconfdir}/%{base_name}/
  189. %dir %{_libdir}/%{base_name}
  190. %dir %{_datadir}/%{base_name}
  191. %attr(0750,%{base_name},%{base_name}) %dir %{_localstatedir}/log/%{base_name}
  192. %attr(0750,%{base_name},%{base_name}) %dir %{_localstatedir}/cache/%{base_name}
  193. # Program Files
  194. %attr(0755,root,root) %{_sbindir}/%{base_name}
  195. %attr(0755,root,root) %{_bindir}/*
  196. %attr(0755,root,root) %{_initdir}/%{base_name}
  197. %attr(0755,root,root) %{_libdir}/%{base_name}/cachemgr.cgi
  198. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/basic_*
  199. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/cert_*
  200. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/digest_*
  201. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/diskd
  202. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/ext_*
  203. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/helper*
  204. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/log_*
  205. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/negotiate_*
  206. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/ntlm_*
  207. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/ssl_crtd
  208. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/storeid_*
  209. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/unlinkd
  210. %attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/url_*
  211. # Config Files
  212. %attr(0640,root,%{base_name}) %config(noreplace) %{_sysconfdir}/%{base_name}/%{base_name}.conf
  213. %attr(0644,root,%{base_name}) %config(noreplace) %{_sysconfdir}/%{base_name}/cachemgr.conf
  214. %config(noreplace) %{_sysconfdir}/%{base_name}/mime.conf
  215. %config(noreplace) %{_sysconfdir}/%{base_name}/errorpage.css
  216. %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{base_name}.conf
  217. %config(noreplace) %{_sysconfdir}/sysconfig/%{base_name}
  218. %config(noreplace) %{_sysconfdir}/pam.d/%{base_name}
  219. %config(noreplace) %{_sysconfdir}/logrotate.d/%{base_name}
  220. # Sample Config Files
  221. %config %{_sysconfdir}/%{base_name}/%{base_name}.conf.default
  222. %config %{_sysconfdir}/%{base_name}/cachemgr.conf.default
  223. %config %{_sysconfdir}/%{base_name}/mime.conf.default
  224. %config %{_sysconfdir}/%{base_name}/errorpage.css.default
  225. # Data Files
  226. %{_datadir}/%{base_name}/*
  227. # Document Files
  228. %doc README ChangeLog QUICKSTART
  229. %doc contrib/url-normalizer.pl contrib/rredir.* contrib/user-agents.pl
  230. %{_mandir}/man8/*
  231. %{_mandir}/man1/*
  232. %{_sysconfdir}/%{base_name}/%{base_name}.conf.documented
  233. %changelog
  234. * Tue Jan 09 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.27-2
  235. - enabled a build option: --enable-internal-dns.
  236. * Wed Sep 06 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.27-1
  237. - new upstream release.
  238. - updated Patch203.
  239. * Wed Jun 29 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.19-1
  240. - new upstream release.
  241. * Fri Apr 29 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.17-1
  242. - new upstream release.
  243. * Tue Apr 12 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.16-1
  244. - new upstream release.
  245. * Thu Jun 18 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.5-1
  246. - new upstream release.
  247. * Mon Jul 7 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.4.6-1
  248. - new upstream release.
  249. * Sat Jan 12 2013 Masahiro INOUE <miyabi.-.inoue@nifty.com> 3.1.23-1
  250. - new upstream release
  251. * Sat Dec 08 2012 Masahiro INOUE <miyabi.-.inoue@nifty.com> 3.1.22-1
  252. - new upstream release
  253. * Thu Nov 22 2012 Masahiro INOUE <miyabi.-.inoue@nifty.com> 3.1.21-1
  254. - new upstream release
  255. * Thu Aug 23 2012 Masahiro INOUE <miyabi.-.inoue@nifty.com> 3.1.20-1
  256. - new upstream release
  257. * Mon Oct 17 2011 Masahiro INOUE <miyabi.-.inoue@nifty.com> 3.1.16-1
  258. - new upstream release
  259. - add BuildRequires - libcap-devel
  260. * Fri Jun 10 2011 Masahiro INOUE <miyabi.-.inoue@nifty.com> 3.1.12-2
  261. - files in libexec moved to libdir
  262. * Tue May 17 2011 Masahiro INOUE <miyabi.-.inoue@nifty.com> 3.1.12-1
  263. - initial build for Vine Linux
  264. - This package is based on Vine Linux - squid-3.0.STABLE25-2