Browse Source

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

master
parent
commit
5725cf856f
  1. 43
      squid/squid.spec

43
squid/squid.spec

@ -40,6 +40,10 @@ License: GPL
Version: %{V_maj}.%{V_min}.%{V_rev} Version: %{V_maj}.%{V_min}.%{V_rev}
Release: 20030711 Release: 20030711
# package options
%option with_ssl no
%option with_snmp no
# list of sources # 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 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 Source1: rc.squid
@ -49,6 +53,10 @@ Prefix: %{l_prefix}
BuildRoot: %{l_buildroot} BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20030710, gcc BuildPreReq: OpenPKG, openpkg >= 20030710, gcc
PreReq: OpenPKG, openpkg >= 20030710 PreReq: OpenPKG, openpkg >= 20030710
%if "%{with_ssl}" == "yes"
BuildPreReq: openssl
PreReq: openssl
%endif
AutoReq: no AutoReq: no
AutoReqProv: no AutoReqProv: no
@ -63,6 +71,9 @@ AutoReqProv: no
%build %build
# configure package # configure package
%{l_shtool} subst \
-e 's;/cgi-bin/;/openpkg-cgi/;' \
src/cachemgr.c
CC="%{l_cc}" \ CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \ CFLAGS="%{l_cflags -O}" \
./configure \ ./configure \
@ -71,14 +82,22 @@ AutoReqProv: no
--libexecdir=%{l_prefix}/libexec/squid \ --libexecdir=%{l_prefix}/libexec/squid \
--localstatedir=%{l_prefix}/var/squid \ --localstatedir=%{l_prefix}/var/squid \
--datadir=%{l_prefix}/share/squid \ --datadir=%{l_prefix}/share/squid \
--disable-ident-lookups \ %if "%{with_ssl}" == "yes"
--enable-err-language=English \ --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-storeio="ufs diskd null" \
--enable-removal-policies="lru heap" \ --enable-removal-policies="lru heap" \
--enable-auth="basic digest" \
--enable-cache-digests \ --enable-cache-digests \
--enable-forw-via-db \ --enable-forw-via-db \
--enable-snmp \ --enable-useragent-log \
--enable-useragent-log --enable-delay-pools
# build package # build package
%{l_make} %{l_mflags} %{l_make} %{l_mflags}
@ -86,8 +105,9 @@ AutoReqProv: no
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
# pregenerate installation directories # pregenerate some (not automatically created) installation directories
%{l_shtool} mkdir -f -p -m 755 \ %{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}/etc/squid \
$RPM_BUILD_ROOT%{l_prefix}/var/squid/logs \ $RPM_BUILD_ROOT%{l_prefix}/var/squid/logs \
$RPM_BUILD_ROOT%{l_prefix}/var/squid/cache $RPM_BUILD_ROOT%{l_prefix}/var/squid/cache
@ -100,9 +120,13 @@ AutoReqProv: no
rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/RunCache 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/*.default
rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/squid/*.orig rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/squid/*.orig
rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/squid/errors/[A-D]* %if "%{with_snmp}" != "yes"
rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/squid/errors/Es* rm -f $RPM_BUILD_ROOT%{l_prefix}/share/squid/mib.txt
rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/squid/errors/[F-Z]* %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 # post-adjust default configuration
%{l_shtool} subst \ %{l_shtool} subst \
@ -142,7 +166,8 @@ AutoReqProv: no
%preun %preun
if [ $1 -eq 0 ]; then 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/cache/[0-9ABCDEF][0-9ABCDEF] >/dev/null 2>&1 || true
rm -rf $RPM_INSTALL_PREFIX/var/squid/logs/* >/dev/null 2>&1 || true
fi fi

Loading…
Cancel
Save