squid.spec 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. ##
  2. ## squid.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2001 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2001 Ralf S. Engelschall <rse@engelschall.com>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. %define V_long 2.4.STABLE2
  25. %define V_short 2.4.2
  26. # package information
  27. Name: squid
  28. Summary: Character Set Conversion Tool
  29. URL: http://www.squid-cache.org/
  30. Vendor: Francois Pinard
  31. Packager: The OpenPKG Project
  32. Distribution: OpenPKG [EXP]
  33. Group: Web
  34. License: GPL
  35. Version: %{V_short}
  36. Release: %{l_branch}.0
  37. # list of sources
  38. Source0: http://www.squid-cache.org/Versions/v2/2.4/squid-%{V_long}-src.tar.gz
  39. Source1: rc.squid
  40. Patch0: squid-%{V_long}.patch
  41. # build information
  42. Prefix: %{l_prefix}
  43. BuildRoot: %{l_buildroot}
  44. BuildPreReq: OpenPKG, openpkg >= 20011023.0
  45. PreReq: OpenPKG, openpkg >= 20011023.0
  46. AutoReq: no
  47. AutoReqProv: no
  48. %description
  49. Squid is a full-featured Web proxy which supports proxying and
  50. caching of HTTP, FTP, and other URL's; proxying for SSL cache
  51. hierarchies; supporting ICP, HTCP, and CARP; supports Cache Digests
  52. transparent caching, etc.
  53. %prep
  54. %setup -q -n squid-%{V_long}
  55. %patch -p0
  56. %build
  57. CC="%{l_cc}" \
  58. CFLAGS="%{l_cflags -O}" \
  59. ./configure \
  60. --prefix=%{l_prefix} \
  61. --sysconfdir=%{l_prefix}/etc/squid \
  62. --localstatedir=%{l_prefix}/var/squid \
  63. --disable-ident-lookups \
  64. --enable-err-language=English \
  65. --enable-storeio="ufs diskd null" \
  66. --enable-removal-policies="lru heap" \
  67. --enable-cache-digests \
  68. --enable-forw-via-db \
  69. --enable-snmp \
  70. --enable-useragent-log
  71. %{l_make} %{l_mflags}
  72. %install
  73. rm -rf $RPM_BUILD_ROOT
  74. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}
  75. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/squid
  76. %{l_rpmtool} subst \
  77. "s;^\\(prefix[^=]*=\\).*\$;\\1 $RPM_BUILD_ROOT%{l_prefix};" \
  78. "s;^\\(exec_prefix[^=]*=\\).*\$;\\1 $RPM_BUILD_ROOT%{l_prefix};" \
  79. "s;^\\(sysconfdir[^=]*=\\).*\$;\\1 $RPM_BUILD_ROOT%{l_prefix}/etc/squid;" \
  80. "s;^\\(localstatedir[^=]*=\\).*\$;\\1 $RPM_BUILD_ROOT%{l_prefix}/var/squid;" \
  81. -- `find . -name Makefile -print`
  82. %{l_rpmtool} subst \
  83. 's;install: all install-mkdirs;install: install-mkdirs;' \
  84. -- src/Makefile
  85. %{l_make} %{l_mflags} install
  86. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/Run*
  87. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/RunCache
  88. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/squid/*.default
  89. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/squid/*.orig
  90. mv $RPM_BUILD_ROOT%{l_prefix}/bin/client $RPM_BUILD_ROOT%{l_prefix}/libexec/client
  91. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/squid/logs
  92. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/squid/cache
  93. %{l_rpmtool} subst \
  94. 's;^# \(cache_mgr\).*;\1 %{l_fsusr};' \
  95. 's;^# \(cache_effective_user\).*;\1 %{l_fsusr};' \
  96. 's;^# \(cache_effective_group\).*;\1 %{l_fsgrp};' \
  97. -- $RPM_BUILD_ROOT%{l_prefix}/etc/squid/squid.conf
  98. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/squid/squid.conf.orig
  99. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  100. %{l_shtool} install -c -m 755 -e "s;@l_prefix@;%{l_prefix};g" \
  101. %{SOURCE rc.squid} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  102. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  103. %{l_files_std} \
  104. '%config %{l_prefix}/etc/squid/squid.conf'
  105. %files -f files
  106. %clean
  107. rm -rf $RPM_BUILD_ROOT
  108. %post
  109. if [ $1 -eq 1 ]; then
  110. $RPM_INSTALL_PREFIX/bin/squid -z >/dev/null 2>&1
  111. fi
  112. %preun
  113. if [ $1 -eq 0 ]; then
  114. rm -rf $RPM_INSTALL_PREFIX/var/squid/cache/[0-9ABCDEF][0-9ABCDEF] >/dev/null 2>&1
  115. fi