# # Copyright (c) 2006 rPath, Inc. # This file is distributed under the terms of the MIT License. # A copy is available at http://www.rpath.com/permanent/mit-license.html # class Squid(PackageRecipe): buildRequires = [ 'cyrus-sasl:devel', 'glibc:devel', 'krb5:devel', 'openldap:devel', 'openssl:devel', 'autoconf:runtime', 'automake:runtime', 'gcc:devel', 'gcc:runtime', 'gcc-c++:runtime', 'libstdc++:devel', 'pam:devel', 'zlib:devel' ] name = 'squid' version = '2.5.STABLE12' def setup(r): srpm = 'ftp://download.fedora.redhat.com/pub/fedora/linux/core/5/source/SRPMS/squid-2.5.STABLE12-5.1.src.rpm' r.addArchive('%(name)s-%(version)s.tar.bz2', rpm=srpm) # Upstream patches r.addPatch('squid-2.5.STABLE12-setenv.patch', rpm=srpm) r.addPatch('squid-2.5.STABLE12-SMB_BadFetch.patch', rpm=srpm) r.addPatch('squid-2.5.STABLE12-asyncio_counters.patch', rpm=srpm) r.addPatch('squid-2.5.STABLE12-prctl_args.patch', rpm=srpm) r.addPatch('squid-2.5.STABLE12-irix_timezone.patch', rpm=srpm) # External patches r.addPatch('squid-2.5.STABLE12-follow-xff.patch', rpm=srpm) # Fedora patches # Applying upstream patches first makes it less likely # that local patches will break upstream ones. r.addPatch('squid-2.5.STABLE11-config.patch', rpm=srpm) r.addPatch('squid-2.5.STABLE4-location.patch', rpm=srpm) r.addPatch('squid-2.5.STABLE7-build.patch', rpm=srpm) r.addPatch('squid-2.5.STABLE4-perlpath.patch', rpm=srpm) r.addPatch('squid-2.5.STABLE5-pipe.patch', rpm=srpm) r.addPatch('squid-2.5.STABLE12-libbind.patch', rpm=srpm) r.addPatch('squid-2.5.STABLE12-64bit.patch', rpm=srpm) r.addPatch('squid-2.5.STABLE12-fd-config.patch', rpm=srpm) r.addPatch('squid-2.5.STABLE12-fd-config-fix.patch', rpm=srpm) r.addPatch('squid-2.5.STABLE12-smb-path.patch', rpm=srpm) r.addSource('squid.init', rpm=srpm) r.addSource('squid.logrotate', rpm=srpm) r.addSource('squid.pam', rpm=srpm) r.addSource('squid.spec', rpm=srpm) r.addSource('squid.sysconfig', rpm=srpm) r.Configure('--exec_prefix=/usr' ' --bindir=%(sbindir)s' ' --libexecdir=%(libdir)s/squid' ' --localstatedir=/var' ' --datadir=%(datadir)s' ' --sysconfdir=%(sysconfdir)s/squid' ' --enable-poll' ' --enable-snmp' ' --enable-removal-policies="heap,lru"' ' --enable-storeio="aufs,coss,diskd,null,ufs"' ' --enable-ssl' ' --with-openssl=%(prefix)s/kerberos' ' --enable-delay-pools' ' --enable-linux-netfilter' ' --with-pthreads' ' --enable-ntlm-auth-helpers="SMB,winbind,fakeauth"' ' --enable-external-acl-helpers="ip_user,ldap_group,unix_group,wbinfo_group,winbind_group"' ' --enable-auth="basic,digest,ntlm"' ' --enable-digest-auth-helpers="password"' ' --with-winbind-auth-challenge' ' --enable-useragent-log' ' --enable-referer-log' ' --disable-dependency-tracking' ' --enable-cachemgr-hostname=localhost' ' --enable-underscores' ' --enable-basic-auth-helpers="LDAP,MSNT,NCSA,PAM,SMB,YP,getpwnam,multi-domain-NTLM,SASL,winbind"' ' --enable-cache-digests' ' --enable-ident-lookups' ' --with-large-files' ' --enable-fd-config' ' --enable-follow-x-forwarded-for') r.Make() r.MakeInstall() r.Install('squid.init','%(initdir)s/squid', mode=0755) r.Install('squid.logrotate','%(sysconfdir)s/logrotate.d/squid') r.Install('squid.sysconfig','%(sysconfdir)s/sysconfig/squid') r.Install('squid.pam','%(sysconfdir)s/pam.d/squid') r.MakeDirs('%(localstatedir)s/log/squid', '%(localstatedir)s/spool/squid', mode=0750) r.Ownership('squid','squid', r.ExcludeDirectories(exceptions=['%(localstatedir)s/log/squid', '%(localstatedir)s/spool/squid']) r.TagSpec('initscript', '%(initdir)s/')