OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /v/openpkg/cvs Email: r...@openpkg.org Module: openpkg-src Date: 08-May-2009 15:55:06 Branch: HEAD Handle: 2009050814550501 Added files: openpkg-src/squid31 fsl.squid rc.squid squid31.patch squid31.spec Log: new package: squid31 3.1.0.7 (World Wide Web Proxy Server) Summary: Revision Changes Path 1.1 +16 -0 openpkg-src/squid31/fsl.squid 1.1 +61 -0 openpkg-src/squid31/rc.squid 1.1 +24 -0 openpkg-src/squid31/squid31.patch 1.1 +249 -0 openpkg-src/squid31/squid31.spec ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-src/squid31/fsl.squid ============================================================================ $ cvs diff -u -r0 -r1.1 fsl.squid --- /dev/null 2009-05-08 15:55:06 +0200 +++ fsl.squid 2009-05-08 15:55:06 +0200 @@ -0,0 +1,16 @@ +## +## fsl.squid -- OSSP fsl configuration +## + +ident (squid)/.+ q{ + prefix( + prefix="%b %d %H:%M:%S %N <%L> $1[%P]: " + ) + -> { + debug: file( + path="@l_prefix@/var/squid/logs/squid.log", + perm=0644, jitter=1 + ) + } +}; + @@ . patch -p0 <<'@@ .' Index: openpkg-src/squid31/rc.squid ============================================================================ $ cvs diff -u -r0 -r1.1 rc.squid --- /dev/null 2009-05-08 15:55:06 +0200 +++ rc.squid 2009-05-08 15:55:06 +0200 @@ -0,0 +1,61 @@ +...@l_prefix@/bin/openpkg rc +## +## rc.squid -- Run-Commands +## + +%config + squid_enable="$openpkg_rc_def" + squid_log_prolog="true" + squid_log_epilog="true" + squid_log_numfiles="10" + squid_log_minsize="1M" + squid_log_complevel="9" + +%status -u @l_susr@ -o + squid_usable="unknown" + squid_active="no" + rcService squid enable yes && \ + @l_prefix@/sbin/squid -k check 2>/dev/null && squid_active="yes" + echo "squid_enable=\"$squid_enable\"" + echo "squid_usable=\"$squid_usable\"" + echo "squid_active=\"$squid_active\"" + +%start -u @l_susr@ + rcService squid enable yes || exit 0 + rcService squid active yes && exit 0 + @l_prefix@/sbin/squid -D -s + sleep 2 + +%stop -u @l_susr@ + rcService squid enable yes || exit 0 + rcService squid active no && exit 0 + @l_prefix@/sbin/squid -k shutdown + i=0 + while [ $i -lt 40 ]; do + @l_prefix@/sbin/squid -k check 2>/dev/null + if [ $? -ne 0 ]; then + break + fi + sleep 1 + i=`expr $i + 1` + done + +%restart -u @l_susr@ + rcService squid enable yes || exit 0 + rcService squid active no && exit 0 + rc squid stop start + +%reload -u @l_susr@ + rcService squid enable yes || exit 0 + @l_prefix@/sbin/squid -k reconfigure + +%daily -u @l_susr@ + rcService squid enable yes || exit 0 + @l_prefix@/sbin/squid -k rotate + shtool rotate -f \ + -n ${squid_log_numfiles} -s ${squid_log_minsize} -d \ + -z ${squid_log_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \ + -P "${squid_log_prolog}" \ + -E "${squid_log_epilog}; rc squid reload" \ + @l_prefix@/var/squid/logs/squid.log + @@ . patch -p0 <<'@@ .' Index: openpkg-src/squid31/squid31.patch ============================================================================ $ cvs diff -u -r0 -r1.1 squid31.patch --- /dev/null 2009-05-08 15:55:06 +0200 +++ squid31.patch 2009-05-08 15:55:06 +0200 @@ -0,0 +1,24 @@ +Index: src/Makefile.in +--- src/Makefile.in.orig 2009-04-08 12:51:29 +0200 ++++ src/Makefile.in 2009-05-08 15:20:00 +0200 +@@ -1342,7 +1342,7 @@ + LIBADD_DL = @LIBADD_DL@ + LIBLTDL = @LIBLTDL@ + LIBOBJS = @LIBOBJS@ +-LIBS = @LIBS@ ++LIBS = @ECAP_LIBS@ @LIBS@ + LIBSASL = @LIBSASL@ + LIBTOOL = @LIBTOOL@ + LIB_DB = @LIB_DB@ +Index: configure +--- configure.orig 2009-04-08 12:51:47 +0200 ++++ configure 2009-05-08 15:48:36 +0200 +@@ -22898,7 +22898,7 @@ + #define USE_ECAP 1 + _ACEOF + +- ECAP_LIBS="ecap/libecap.la $ECAP_LIBS" ++ ECAP_LIBS="adaptation/ecap/libecap.la $ECAP_LIBS" + use_adaptation=yes + else + @@ . patch -p0 <<'@@ .' Index: openpkg-src/squid31/squid31.spec ============================================================================ $ cvs diff -u -r0 -r1.1 squid31.spec --- /dev/null 2009-05-08 15:55:06 +0200 +++ squid31.spec 2009-05-08 15:55:06 +0200 @@ -0,0 +1,249 @@ +## +## 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.7 + +# 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: 20090508 + +# 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 squid = { + 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 + @@ . ______________________________________________________________________ OpenPKG http://openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org