Author: glen                         Date: Wed Nov 12 14:07:29 2008 GMT
Module: SPECS                         Tag: SQUID_2
---- Log message:
- disable epoll for ac
- cachemgr uses webapps and is standalone from squid
- rel 2

---- Files affected:
SPECS:
   squid.spec (1.282.2.8.2.13 -> 1.282.2.8.2.14) 

---- Diffs:

================================================================
Index: SPECS/squid.spec
diff -u SPECS/squid.spec:1.282.2.8.2.13 SPECS/squid.spec:1.282.2.8.2.14
--- SPECS/squid.spec:1.282.2.8.2.13     Tue Oct 28 22:01:52 2008
+++ SPECS/squid.spec    Wed Nov 12 15:07:23 2008
@@ -1,9 +1,13 @@
 # $Revision$, $Date$
 # TODO
-# - use /usr/lib/cgi-bin instead of /home/services
 # - update combined_log patch
 # Conditional build:
 %bcond_with    combined_log    # enables apache-like combined log format
+%if "%{pld_release}" == "ac"
+%bcond_with            epoll           # enable epoll support
+%else
+%bcond_without epoll           # disable epoll support
+%endif
 #
 Summary:       SQUID Internet Object Cache
 Summary(es.UTF-8):     proxy/cache para WWW/FTP/gopher
@@ -14,7 +18,7 @@
 Summary(zh_CN.UTF-8):  SQUID 高速缓冲代理服务器
 Name:          squid
 Version:       2.7.STABLE5
-Release:       1
+Release:       2
 Epoch:         7
 License:       GPL v2
 Group:         Networking/Daemons
@@ -34,6 +38,7 @@
 # Bug fixes from Squid home page, please include URL
 # lets have fun - there is no patches... yet:)
 # Other patches:
+Source8:       %{name}-cachemgr-apache.conf
 Patch0:                %{name}-fhs.patch
 Patch1:                %{name}-location.patch
 Patch2:                %{name}-domainmatch.patch
@@ -43,6 +48,7 @@
 Patch6:                %{name}-2.5.STABLE4-apache-like-combined-log.patch
 Patch7:                %{name}-auth_on_acceleration.patch
 Patch8:                %{name}-ppc-m32.patch
+Patch9:                %{name}-cachemgr-webapp.patch
 URL:           http://www.squid-cache.org/
 BuildRequires: autoconf
 BuildRequires: automake
@@ -52,6 +58,7 @@
 BuildRequires: openssl-devel >= 0.9.7d
 BuildRequires: pam-devel
 BuildRequires: perl-base
+BuildRequires: rpm >= 4.4.9-56
 BuildRequires: rpmbuild(macros) >= 1.268
 BuildRequires: sed >= 4.0
 BuildRequires: unzip
@@ -69,16 +76,17 @@
 Requires(pre): /usr/sbin/useradd
 Requires:      rc-scripts >= 0.2.0
 Requires:      setup >= 2.4.6
-# epoll enabled by default:
-Requires:      uname(release) >= 2.6
+%{?with_epoll:Requires:        uname(release) >= 2.6}
 Provides:      group(squid)
 Provides:      user(squid)
 Conflicts:     logrotate < 3.7-4
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define                _webapps        /etc/webapps
+%define                _webapp         cachemgr
 %define                _libexecdir     %{_libdir}/%{name}
 %define                _sysconfdir     /etc/%{name}
-%define                _cgidir         /home/services/httpd/cgi-bin
+%define                _cgidir         %{_prefix}/lib/cgi-bin/%{_webapp}
 
 %description
 Squid is a high-performance proxy caching server for web clients,
@@ -179,9 +187,14 @@
 %package cachemgr
 Summary:       CGI script for Squid management
 Summary(pl.UTF-8):     Skrypt CGI do zarządzania Squidem przez WWW
-Group:         Networking/Admin
-Requires:      %{name} = %{epoch}:%{version}-%{release}
+Group:         Applications/WWW
+# does not require squid locally
+Requires:      group(http)
+Requires:      webapps
 Requires:      webserver
+Requires:      webserver(access)
+Requires:      webserver(alias)
+Requires:      webserver(cgi)
 
 %description cachemgr
 Cachemgr.cgi is a CGI script that allows administrator to chceck
@@ -444,6 +457,7 @@
 %ifarch ppc
 %patch8 -p1
 %endif
+%patch9 -p1
 
 %{__sed} -i -e '1s#!.*bin/perl#!%{__perl}#' {contrib,scripts,helpers/*/*}/*.pl
 
@@ -486,6 +500,7 @@
        --sysconfdir=%{_sysconfdir} \
        --with-auth-on-acceleration \
        --with-pthreads \
+       %{!?with_epoll:--disable-epoll} \
        --with-large-files \
        --with-maxfd=32768
 
@@ -493,7 +508,7 @@
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_cgidir} \
+install -d $RPM_BUILD_ROOT{%{_cgidir},%{_webapps}/%{_webapp}} \
        $RPM_BUILD_ROOT/etc/{pam.d,rc.d/init.d,security,sysconfig,logrotate.d} \
        $RPM_BUILD_ROOT{%{_sbindir},%{_bindir},%{_libexecdir}/contrib} \
        $RPM_BUILD_ROOT%{_mandir}/man8 \
@@ -509,7 +524,16 @@
 install %{SOURCE7} $RPM_BUILD_ROOT/etc/pam.d/squid
 touch $RPM_BUILD_ROOT/etc/security/blacklist.squid
 
+cat > apache.conf <<'EOF'
+Alias /%{_webapp} %{_cgidir}/cachemgr.cgi
+<Directory %{_appdir}>
+       Allow from all
+</Directory>
+EOF
+
 mv -f $RPM_BUILD_ROOT%{_libdir}/squid/cachemgr.cgi $RPM_BUILD_ROOT%{_cgidir}
+cp -a %{SOURCE8} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
+cp -a %{SOURCE8} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
 
 cd $RPM_BUILD_ROOT/etc/squid
 cp -f squid.conf{,.default}
@@ -583,6 +607,24 @@
 %triggerpostun -- squid < 7:2.5.STABLE7-5
 %addusertogroup stats squid
 
+%triggerin cachemgr -- apache1 < 1.3.37-3, apache1-base
+%webapp_register apache %{_webapp}
+
+%triggerun cachemgr -- apache1 < 1.3.37-3, apache1-base
+%webapp_unregister apache %{_webapp}
+
+%triggerin cachemgr -- apache < 2.2.0, apache-base
+%webapp_register httpd %{_webapp}
+
+%triggerun cachemgr -- apache < 2.2.0, apache-base
+%webapp_unregister httpd %{_webapp}
+
+%triggerpostun -- cachemgr < 7:2.7.STABLE5-1.1
+if [ -f %{_sysconfdir}/cachemgr.conf.rpmsave ]; then
+       cp -f %{_webapps}/%{_webapp}/cachemgr.conf{,.rpmsave}
+       mv -f %{_sysconfdir}/cachemgr.conf.rpmsave 
%{_webapps}/%{_webapp}/cachemgr.conf
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc CONTRIBUTORS COPYRIGHT CREDITS README ChangeLog QUICKSTART 
RELEASENOTES.html SPONSORS
@@ -661,8 +703,11 @@
 
 %files cachemgr
 %defattr(644,root,root,755)
-%attr(640,root,squid) %config(noreplace) %verify(not md5 mtime size) 
%{_sysconfdir}/cachemgr.conf
-%attr(755,root,root) %{_cgidir}/*
+%dir %attr(750,root,http) %{_webapps}/%{_webapp}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) 
%{_webapps}/%{_webapp}/apache.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) 
%{_webapps}/%{_webapp}/httpd.conf
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) 
%{_webapps}/%{_webapp}/cachemgr.conf
+%attr(755,root,root) %{_cgidir}/cachemgr.cgi
 %{_mandir}/man8/cachemgr.cgi.8*
 
 %files ldap_auth
@@ -758,6 +803,11 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.282.2.8.2.14  2008/11/12 14:07:23  glen
+- disable epoll for ac
+- cachemgr uses webapps and is standalone from squid
+- rel 2
+
 Revision 1.282.2.8.2.13  2008/10/28 21:01:52  dzeus
 - up to 2.7.STABLE5
 
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/squid.spec?r1=1.282.2.8.2.13&r2=1.282.2.8.2.14&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to