squid-vl.spec 12 KB

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