OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 11-Jul-2003 20:38:25
Branch: HEAD Handle: 2003071119382400
Modified files:
openpkg-src/squid squid.spec
Log:
work-off this package to bring it into best shape it can be:
- add optional SSL support for reverse proxy mode
- make SNMP support optional to remove possibly dangerous code by default
- remove mib.txt if SNMP is not enabled
- remove --disable-ident-lookups because this code is fully config file controlled
- use the language autoconf options to restrict to English instead of removing
files later
- enable "digest" auth method
- enable "delay pools" because its a useful option and is config file controlled
anyway
- remove also log files on full deinstallation
- move cachemgr.cgi from libexec/squid/ to cgi/ and make sure it knows that
it is called via URL /openpkg-cgi/cachemgr.cgi
Summary:
Revision Changes Path
1.42 +34 -9 openpkg-src/squid/squid.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/squid/squid.spec
============================================================================
$ cvs diff -u -r1.41 -r1.42 squid.spec
--- openpkg-src/squid/squid.spec 11 Jul 2003 16:33:13 -0000 1.41
+++ openpkg-src/squid/squid.spec 11 Jul 2003 18:38:24 -0000 1.42
@@ -40,6 +40,10 @@
Version: %{V_maj}.%{V_min}.%{V_rev}
Release: 20030711
+# package options
+%option with_ssl no
+%option with_snmp no
+
# list of sources
Source0:
http://www.squid-cache.org/Versions/v%{V_maj}/%{V_maj}.%{V_min}/squid-%{V_maj}.%{V_min}.STABLE%{V_rev}.tar.gz
Source1: rc.squid
@@ -49,6 +53,10 @@
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20030710, gcc
PreReq: OpenPKG, openpkg >= 20030710
+%if "%{with_ssl}" == "yes"
+BuildPreReq: openssl
+PreReq: openssl
+%endif
AutoReq: no
AutoReqProv: no
@@ -63,6 +71,9 @@
%build
# configure package
+ %{l_shtool} subst \
+ -e 's;/cgi-bin/;/openpkg-cgi/;' \
+ src/cachemgr.c
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
./configure \
@@ -71,14 +82,22 @@
--libexecdir=%{l_prefix}/libexec/squid \
--localstatedir=%{l_prefix}/var/squid \
--datadir=%{l_prefix}/share/squid \
- --disable-ident-lookups \
- --enable-err-language=English \
+%if "%{with_ssl}" == "yes"
+ --enable-ssl \
+ --with-openssl=%{l_prefix} \
+%endif
+%if "%{with_snmp}" == "yes"
+ --enable-snmp \
+%endif
+ --enable-default-err-language=English \
+ --enable-err-languages=English \
--enable-storeio="ufs diskd null" \
--enable-removal-policies="lru heap" \
+ --enable-auth="basic digest" \
--enable-cache-digests \
--enable-forw-via-db \
- --enable-snmp \
- --enable-useragent-log
+ --enable-useragent-log \
+ --enable-delay-pools
# build package
%{l_make} %{l_mflags}
@@ -86,8 +105,9 @@
%install
rm -rf $RPM_BUILD_ROOT
- # pregenerate installation directories
+ # 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
@@ -100,9 +120,13 @@
rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/RunCache
rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/squid/*.default
rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/squid/*.orig
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/squid/errors/[A-D]*
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/squid/errors/Es*
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/squid/errors/[F-Z]*
+%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 \
@@ -142,7 +166,8 @@
%preun
if [ $1 -eq 0 ]; then
- # remove cache directory structure and contents
+ # remove cache directory structure (including contents) and logfiles
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
fi
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]