## % define _use_internal_dependency_generator 0 %define __perl_requires %{SOURCE98} ## % define __find_requires %{SOURCE99} Summary: The Squid proxy caching server. Name: squid Version: 2.5.STABLE6 Release: 6.bsousa Epoch: 7 License: GPL Group: System Environment/Daemons Source: http://www.squid-cache.org/Squid/Versions/v2/2.5/squid-%{version}.tar.bz2 Source1: http://www.squid-cache.org/Squid/FAQ/FAQ.sgml Source2: squid.init Source3: squid.logrotate Source4: squid.sysconfig Source5: squid.pam Source98: perl-requires-squid.sh ## Source99: filter-requires-squid.sh Patch1: squid-2.5.STABLE3-config.patch #Patch2: squid-perlpath.patch Patch3: squid-2.5.STABLE4-location.patch Patch4: squid-2.5.STABLE3-build.patch Patch5: squid-2.5.STABLE4-perlpath.patch Patch6: squid-2.5.STABLE5-pipe.patch # These four are from upstream, but out of order. . . Patch7: squid-2.5.STABLE6-SNMP_core_dump.patch Patch8: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-ldap_helpers.patch Patch9: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-balance_on_multiple_ip.patch Patch10: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-reply_header_max_size.patch Patch20: squid-2.5.STABLE6-nonbl.patch Patch100: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-ufs_no_valid_dir.patch Patch102: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-concurrent_dns_lookups.patch Patch103: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-request_header_max_size.patch Patch104: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-partial_hit_is_miss.patch Patch105: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-HEAD.patch Patch106: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-ufs_create_error.patch Patch107: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-basic_auth_caseinsensitive.patch Patch108: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-active_requests_delaypool.patch Patch109: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-client_db_gc.patch Patch110: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-ntlmtruncated.patch Patch111: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-grammar.patch Patch112: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-errorpage_quote.patch Patch113: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-heap_segfault.patch # 114 had to be modified to work with patch-2 #Patch114: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-initgroups.patch Patch114: squid-2.5.STABLE6-initgroups.patch Patch115: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-external_acl_newlines.patch Patch116: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-ntlm_fetch_string.patch Patch117: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-ntlm_noreuse_leak.patch Patch118: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-ntlm_challengereuse_leak.patch Patch119: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-rotate_error.patch Patch120: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-digest_crash.patch Patch121: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-acl_times.patch Patch122: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-http_header_range.patch Patch123: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-Content-Disposition.patch Patch124: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-freebsd_arp_nowarning.patch Patch125: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-huge_tcp_windows.patch Patch126: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-arbitrary_headers.patch Patch127: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-ncsa_auth_lineendings.patch Patch128: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-basic_auth_caseinsensitive-2.patch # 119 had to be modified #Patch129: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-program-prefix.patch Patch129: squid-2.5.STABLE6-program-prefix.patch Patch130: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE6-CONNECT.patch # these are backported from 2.5.STABLE7 Patch200: squid-2.5.STABLE7-fakeauth_auth.patch Patch201: squid-2.5.STABLE7-gopher_html_parsing.patch Patch202: squid-2.5.STABLE7-wccp_denial_of_service.patch Patch203: squid-2.5.STABLE6-ldap_spaces.patch Patch204: squid-2.5.STABLE7-header_parsing.patch Patch205: squid-2.5.STABLE7-response_splitting.patch Patch206: squid-2.5.STABLE7-wccp_buffer_overflow.patch Patch207: squid-2.5.STABLE7-oversize_reply_headers.patch Patch208: squid-2.5.STABLE7-LDAP_version_documentation.patch Patch209: squid-2.5.STABLE7-ldap_search.patch Patch210: squid-2.5.STABLE7-post.patch # These are backported from 2.5.STABLE8 Patch300: squid-2.5.STABLE6-dns_assert.patch # These are backported from 2.5.STABLE9 Patch400: http://www.squid-cache.org/Versions/v2/2.5/bugs/squid-2.5.STABLE9-setcookie.patch Patch401: squid-2.5.STABLE6-acl_error.patch Patch402: squid-2.5.STABLE6-ldap-backport.patch Patch403: squid-2.5.STABLE9-cachemgr_conf.patch Patch404: squid-2.5.STABLE6-dns_query-4.patch # This is forward-ported from 2.5.STABLE3 Patch500: squid-2.5.STABLE3-config_change.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root Prereq: /sbin/chkconfig logrotate shadow-utils Requires: bash >= 2.0 BuildPrereq: openjade linuxdoc-tools openldap-devel pam-devel openssl-devel Obsoletes: squid-novm %description Squid is a high-performance proxy caching server for Web clients, supporting FTP, gopher, and HTTP data objects. Unlike traditional caching software, Squid handles all requests in a single, non-blocking, I/O-driven process. Squid keeps meta data and especially hot objects cached in RAM, caches DNS lookups, supports non-blocking DNS lookups, and implements negative caching of failed requests. Squid consists of a main server program squid, a Domain Name System lookup program (dnsserver), a program for retrieving FTP data (ftpget), and some management and client tools. %prep %setup -q %patch1 -p1 -b .config #%patch2 -p1 -b .perlpath %patch3 -p1 -b .location %patch4 -p1 -b .build %patch5 -p1 -b .perlpath %patch6 -p1 -b .pipe %patch7 -p1 %patch8 -p1 %patch9 -p1 %patch10 -p1 %patch20 -p1 -b .nonbl %patch100 -p1 %patch102 -p1 %patch103 -p1 %patch104 -p1 %patch105 -p1 %patch106 -p1 %patch107 -p1 %patch108 -p1 %patch109 -p1 %patch110 -p1 %patch111 -p1 %patch112 -p1 %patch113 -p1 %patch114 -p1 -b .initgroups %patch115 -p1 %patch116 -p1 %patch117 -p1 %patch118 -p1 %patch119 -p1 %patch120 -p1 %patch121 -p1 %patch122 -p1 %patch123 -p1 %patch124 -p1 %patch125 -p1 %patch126 -p1 %patch127 -p1 %patch128 -p1 %patch129 -p1 -b .program-prefix %patch130 -p1 %patch200 -p1 -b .fakeauth_auth %patch201 -p1 -b .gopher_html_parsing %patch202 -p1 -b .wccp_denial_of_service %patch203 -p1 -b .ldap_spaces %patch204 -p1 -b .header_parsing %patch205 -p1 -b .response_splitting %patch206 -p1 -b .wccp_buffer_overflow %patch207 -p1 -b .oversize_reply_headers %patch208 -p1 -b .LDAP_version_documentation %patch209 -p1 -b .ldap_search %patch210 -p1 -b .post %patch300 -p1 -b .dns_assert %patch400 -p1 -b .setcookie %patch401 -p1 -b .acl_error %patch402 -p2 -b .ldap-backport %patch403 -p1 -b .cachemgr_conf %patch404 -p1 -b .dns_query-4 %patch500 -p1 -b .config_change %build export CFLAGS="-fPIE -Os -g -pipe -fsigned-char" ; export LDFLAGS=-pie ; %configure \ --exec_prefix=/usr \ --bindir=%{_sbindir} \ --libexecdir=%{_libdir}/squid \ --localstatedir=/var \ --sysconfdir=/etc/squid \ --enable-poll \ --enable-snmp \ --enable-removal-policies="heap,lru" \ --enable-storeio="aufs,coss,diskd,null,ufs" \ --enable-ssl \ --with-openssl=/usr/kerberos \ --enable-delay-pools \ --enable-linux-netfilter \ --enable-ntlm-auth-helpers="SMB,winbind" \ --enable-external-acl-helpers="ip_user,ldap_group,unix_group,wbinfo_group,winbind_group" \ --enable-auth="basic,ntlm" \ --with-winbind-auth-challenge \ --enable-useragent-log \ --enable-referer-log \ --disable-dependency-tracking \ --enable-cachemgr-hostname=localhost \ --disable-ident-lookups \ --enable-truncate \ --enable-underscores \ --datadir=%{_datadir} \ --enable-basic-auth-helpers="LDAP,MSNT,NCSA,PAM,SMB,YP,getpwnam,multi-domain-NTLM,SASL,winbind" \ export CFLAGS="-fPIE -Os -g -pipe -fsigned-char" ; export LDFLAGS=-pie ; make %{?_smp_mflags} mkdir faq cp %{SOURCE1} faq cd faq sgml2html FAQ.sgml #cd .. %install rm -rf $RPM_BUILD_ROOT %makeinstall \ sysconfdir=$RPM_BUILD_ROOT/etc/squid \ localstatedir=$RPM_BUILD_ROOT/var \ bindir=$RPM_BUILD_ROOT/%{_sbindir} \ libexecdir=$RPM_BUILD_ROOT/%{_libdir}/squid ln -s %{_datadir}/squid/errors/English $RPM_BUILD_ROOT/etc/squid/errors ln -s %{_datadir}/squid/icons $RPM_BUILD_ROOT/etc/squid/icons mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d mkdir -p $RPM_BUILD_ROOT/etc/sysconfig mkdir -p $RPM_BUILD_ROOT/etc/pam.d install -m 755 %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/squid install -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/squid install -m 644 %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/squid install -m 644 %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/squid mkdir -p $RPM_BUILD_ROOT/var/log/squid mkdir -p $RPM_BUILD_ROOT/var/spool/squid # remove unpackaged files from the buildroot rm -f $RPM_BUILD_ROOT%{_sbindir}/{RunAccel,RunCache} %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc faq/* README ChangeLog QUICKSTART doc/* %doc contrib/url-normalizer.pl contrib/rredir.* contrib/user-agents.pl %attr(755,root,root) %dir /etc/squid %attr(755,root,root) %dir %{_libdir}/squid %attr(750,squid,squid) %dir /var/log/squid %attr(750,squid,squid) %dir /var/spool/squid %attr(644,root,root) /etc/pam.d/squid %config(noreplace) %attr(640,root,squid) /etc/squid/squid.conf %config(noreplace) %attr(640,root,squid) /etc/squid/cachemgr.conf %config(noreplace) /etc/squid/mime.conf %config(noreplace) /etc/sysconfig/squid %config(noreplace) /etc/squid/msntauth.conf %config(noreplace) /etc/squid/mib.txt /etc/squid/msntauth.conf.default /etc/squid/squid.conf.default /etc/squid/mime.conf.default %config(noreplace) /etc/squid/errors %{_datadir}/squid %{_sbindir}/squid %{_sbindir}/squidclient %config(noreplace) /etc/squid/icons %config(noreplace) /etc/rc.d/init.d/squid %config(noreplace) /etc/logrotate.d/squid %doc faq/* README ChangeLog QUICKSTART doc/* #%doc contrib/url-normalizer.pl contrib/rredir.* contrib/user-agents.pl %{_mandir}/man8/* %{_libdir}/squid/* %pre if getent passwd squid >/dev/null 2>&1 ; then : ; else /usr/sbin/useradd -u 23 -d /var/spool/squid -r -s /sbin/nologin squid >/dev/null 2>&1 || exit 1 ; fi for i in /var/log/squid /var/spool/squid ; do if [ -d $i ] ; then for adir in `find $i -maxdepth 0 \! -user squid`; do chown -R squid:squid $adir done fi done exit 0 %post /sbin/chkconfig --add squid if [ $1 = 0 ]; then case "$LANG" in bg*) DIR=Bulgarian ;; ca*) DIR=Catalan ;; cs*) DIR=Czech ;; da*) DIR=Danish ;; nl*) DIR=Dutch ;; en*) DIR=English ;; ea*) DIR=Estonian ;; fi*) DIR=Finnish ;; fr*) DIR=French ;; de*) DIR=German ;; he*) DIR=Hebrew ;; hu*) DIR=Hungarian ;; it*) DIR=Italian ;; ja*) DIR=Japanese ;; kr*) DIR=Korean ;; pl*) DIR=Polish ;; pt*) DIR=Portuguese ;; ro*) DIR=Romanian ;; ru*) DIR=Russian-koi8-r ;; sr*) DIR=Serbian ;; sk*) DIR=Slovak ;; es*) DIR=Spanish ;; sv*) DIR=Swedish ;; zh_TW*) DIR=Traditional_Chinese ;; zh_CN*) DIR=Simplify_Chinese ;; tr*) DIR=Turkish ;; *) DIR=English ;; esac ln -snf %{_datadir}/squid/errors/$DIR /etc/squid/errors fi %preun if [ $1 = 0 ] ; then service squid stop >/dev/null 2>&1 rm -f /var/log/squid/* /sbin/chkconfig --del squid fi %postun if [ "$1" -ge "1" ] ; then service squid condrestart >/dev/null 2>&1 fi %triggerin -- samba-common chgrp squid /var/cache/samba/winbindd_privileged > /dev/null 2>& 1 || true