| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- ##
- ## squid31.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
- ##
- ## Permission to use, copy, modify, and distribute this software for
- ## any purpose with or without fee is hereby granted, provided that
- ## the above copyright notice and this permission notice appear in all
- ## copies.
- ##
- ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
- ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- ## SUCH DAMAGE.
- ##
- # FIXME: rse: with_ecap=yes still does not build
- # package version
- %define V_maj 3
- %define V_min 1
- %define V_rev 0.8
- # package information
- Name: squid31
- Summary: World Wide Web Proxy Server
- URL: http://www.squid-cache.org/
- Vendor: The Squid Project
- Packager: OpenPKG Foundation e.V.
- Distribution: OpenPKG Community
- Class: BASE
- Group: Web
- License: GPL
- Version: %{V_maj}.%{V_min}.%{V_rev}
- Release: 20090524
- # package options
- %option with_fsl yes
- %option with_ssl no
- %option with_snmp no
- %option with_ntlm no
- %option with_largefile no
- %option with_icap no
- %option with_ecap no
- %option with_esi no
- # list of sources
- Source0: http://www.squid-cache.org/Versions/v%{V_maj}/%{V_maj}.%{V_min}/squid-%{V_maj}.%{V_min}.%{V_rev}.tar.gz
- Source1: rc.squid
- Source2: fsl.squid
- Patch0: squid31.patch
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20060823, gcc, gcc::with_cxx = yes, perl
- PreReq: OpenPKG, openpkg >= 20060823
- %if "%{with_fsl}" == "yes"
- BuildPreReq: fsl
- PreReq: fsl
- %endif
- %if "%{with_ssl}" == "yes"
- BuildPreReq: openssl
- PreReq: openssl
- %endif
- %if "%{with_ntlm}" == "yes"
- PreReq: samba
- %endif
- %if "%{with_ecap}" == "yes"
- PreReq: libecap
- BuildPreReq: libecap
- %endif
- AutoReq: no
- AutoReqProv: no
- Provides: squid = %{version}
- %description
- Squid is a full-featured Web proxy which supports proxying and
- caching of HTTP, FTP, and other URL's; proxying for SSL cache
- hierarchies; supporting ICP, HTCP, and CARP; supports Cache Digests
- transparent caching, etc.
- %track
- prog squid31 = {
- version = %{V_maj}.%{V_min}.%{V_rev}
- url = http://www.squid-cache.org/Versions/v%{V_maj}/%{V_maj}.%{V_min}/
- regex = squid-(%{V_maj}\.\d+(?:\.\d+)+)\.tar\.gz
- }
- %prep
- %setup -q -n squid-%{V_maj}.%{V_min}.%{V_rev}
- %patch -p0
- %if "%{with_ntlm}" == "yes"
- %{l_shtool} subst \
- -e 's;/usr/bin/perl;%{l_prefix}/bin/perl;' \
- -e 's;wbinfo;%{l_prefix}/bin/wbinfo;' \
- helpers/external_acl/wbinfo_group/wbinfo_group.pl
- %endif
- find . -name "*.orig" -print | xargs rm -f
- %build
- # configure package
- %{l_shtool} subst \
- -e 's;/cgi-bin/;/openpkg-cgi/;' \
- tools/cachemgr.cc
- CC="%{l_cc}" \
- CFLAGS="%{l_cflags -O}" \
- CPPFLAGS="%{l_cppflags}" \
- LDFLAGS="%{l_fsl_ldflags}" \
- LIBS="%{l_fsl_libs}" \
- ./configure \
- --prefix=%{l_prefix} \
- --sysconfdir=%{l_prefix}/etc/squid \
- --libexecdir=%{l_prefix}/libexec/squid \
- --mandir=%{l_prefix}/man \
- --localstatedir=%{l_prefix}/var/squid \
- --datadir=%{l_prefix}/share/squid \
- %if "%{with_ssl}" == "yes"
- --enable-ssl \
- --with-openssl=%{l_prefix} \
- %endif
- %if "%{with_snmp}" == "yes"
- --enable-snmp \
- %endif
- %if "%{with_ntlm}" == "yes"
- --enable-auth="ntlm basic digest" \
- --enable-external-acl-helpers="wbinfo_group" \
- %else
- --enable-auth="basic digest" \
- %endif
- %if "%{with_largefile}" == "yes"
- --with-large-files \
- %endif
- %if "%{with_icap}" == "yes"
- --enable-icap-client \
- %endif
- %if "%{with_ecap}" == "yes"
- --enable-ecap \
- %endif
- %if "%{with_esi}" == "yes"
- --enable-esi \
- %endif
- --enable-basic-auth-helpers="NCSA" \
- --enable-digest-auth-helpers="password" \
- --enable-default-err-language=English \
- --enable-err-languages=English \
- --enable-storeio="ufs diskd" \
- --enable-removal-policies="lru heap" \
- --enable-cache-digests \
- --enable-forw-via-db \
- --enable-useragent-log \
- --enable-delay-pools \
- --enable-x-accelerator-vary \
- --enable-http-violations
- # build package
- %{l_make} %{l_mflags}
- %install
- rm -rf $RPM_BUILD_ROOT
- # pregenerate some (not automatically created) installation directories
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/cgi \
- $RPM_BUILD_ROOT%{l_prefix}/etc/squid \
- $RPM_BUILD_ROOT%{l_prefix}/var/squid/logs \
- $RPM_BUILD_ROOT%{l_prefix}/var/squid/cache
- # install package
- %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
- # strip down installation
- rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/Run*
- rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/RunCache
- rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/squid/*.default
- %if "%{with_snmp}" != "yes"
- rm -f $RPM_BUILD_ROOT%{l_prefix}/share/squid/mib.txt
- %endif
- # move cache manager CGI to correct location
- mv $RPM_BUILD_ROOT%{l_prefix}/libexec/squid/cachemgr.cgi \
- $RPM_BUILD_ROOT%{l_prefix}/cgi/cachemgr.cgi
- # post-adjust default configuration
- %{l_shtool} subst \
- -e 's;^# \(cache_mgr\).*;\1 %{l_musr};' \
- -e 's;^# \(cache_effective_user\).*;\1 %{l_rusr};' \
- -e 's;^# \(cache_effective_group\).*;\1 %{l_rgrp};' \
- -e 's;^# \(http_port\).*;\1 127.0.0.1:3128;' \
- $RPM_BUILD_ROOT%{l_prefix}/etc/squid/squid.conf
- # install run-command script
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- %{SOURCE rc.squid} \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
- # install OSSP fsl configuration
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
- %{l_shtool} install -c -m 644 %{l_value -s -a} \
- %{SOURCE fsl.squid} \
- $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
- # strip executables
- strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
- strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
- strip $RPM_BUILD_ROOT%{l_prefix}/libexec/squid/* >/dev/null 2>&1 || true
- # determine installation files
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} \
- '%config %{l_prefix}/etc/squid/squid.conf' \
- '%config %{l_prefix}/etc/fsl/fsl.squid' \
- '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/squid/*'
- %files -f files
- %clean
- rm -rf $RPM_BUILD_ROOT
- %post
- if [ $1 -eq 1 ]; then
- # initialize cache directory structure
- $RPM_INSTALL_PREFIX/sbin/squid -z >/dev/null 2>&1
- fi
- # after upgrade, restart service
- [ $1 -eq 2 ] || exit 0
- eval `%{l_rc} squid status 2>/dev/null`
- [ ".$squid_active" = .yes ] && %{l_rc} squid restart
- exit 0
- %preun
- # before erase, stop service and remove log files
- [ $1 -eq 0 ] || exit 0
- %{l_rc} squid stop 2>/dev/null
- rm -rf $RPM_INSTALL_PREFIX/var/squid/cache/[0-9ABCDEF][0-9ABCDEF] >/dev/null 2>&1 || true
- rm -rf $RPM_INSTALL_PREFIX/var/squid/logs/* >/dev/null 2>&1 || true
- exit 0
|