diff --git a/squid/squid.spec b/squid/squid.spec index 6172f14dab..683795a073 100644 --- a/squid/squid.spec +++ b/squid/squid.spec @@ -40,6 +40,10 @@ License: GPL 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 @@ Prefix: %{l_prefix} 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 @@ AutoReqProv: no %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 @@ AutoReqProv: no --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 @@ AutoReqProv: no %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 @@ AutoReqProv: no 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 @@ AutoReqProv: no %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