squid.spec 4.8 KB

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