diff options
Diffstat (limited to 'extra/squid')
-rw-r--r-- | extra/squid/PKGBUILD | 62 | ||||
-rw-r--r-- | extra/squid/fix-for-new-cap-headers.patch | 14 | ||||
-rw-r--r-- | extra/squid/squid | 52 | ||||
-rw-r--r-- | extra/squid/squid-makefiles.patch | 53 | ||||
-rw-r--r-- | extra/squid/squid.conf.d | 4 | ||||
-rw-r--r-- | extra/squid/squid.cron | 4 | ||||
-rw-r--r-- | extra/squid/squid.install | 28 | ||||
-rw-r--r-- | extra/squid/squid.pam | 4 |
8 files changed, 221 insertions, 0 deletions
diff --git a/extra/squid/PKGBUILD b/extra/squid/PKGBUILD new file mode 100644 index 000000000..ab4cca63d --- /dev/null +++ b/extra/squid/PKGBUILD @@ -0,0 +1,62 @@ +# $Id: PKGBUILD 79502 2010-05-04 00:58:56Z kevin $ +# Maintainer: Kevin Piche <kevin@archlinux.org> +# Contributor: Tom Newsom <Jeepster@gmx.co.uk> + +pkgname=squid +pkgver=2.7.STABLE9 +pkgrel=1 +pkgdesc="A full-featured Web proxy cache server." +arch=(i686 x86_64) +url="http://www.squid-cache.org" +depends=('openssl' 'pam' 'cron' 'perl') +makedepends=('libcap>=2.16') +license=('GPL') +backup=(etc/squid/squid.conf etc/squid/mime.conf etc/conf.d/squid) +install=${pkgname}.install +source=(http://www.squid-cache.org/Versions/v2/2.7/${pkgname}-${pkgver}.tar.bz2 + squid-makefiles.patch squid squid.conf.d squid.pam + squid.cron fix-for-new-cap-headers.patch) +md5sums=('3c6642c85470b1079207d43bba25a819' + '082e53bb6e2c79bc44ac95c3d69145da' + 'd213b0cc1db72b749bb8c88716fdab39' + '81f9a446d143f42c6a3f30304e91c39f' + '270977cdd9b47ef44c0c427ab9034777' + '5e17df989e2a74e869790c066f61225b' + '9b7586646c8a81730029798895a0eaca') + +build() { + cd ${srcdir}/${pkgname}-${pkgver} + patch -Np1 -i ${srcdir}/squid-makefiles.patch || return 1 + + ./configure --prefix=/usr --datadir=/usr/share/squid \ + --sysconfdir=/etc/squid --libexecdir=/usr/lib/squid \ + --localstatedir=/var --enable-auth="basic,digest,ntlm" \ + --enable-removal-policies="lru,heap" \ + --enable-digest-auth-helpers="password" \ + --enable-storeio="aufs,ufs,diskd,coss,null" \ + --enable-basic-auth-helpers="getpwnam,YP,NCSA,SMB,MSNT,PAM,multi-domain-NTLM" \ + --enable-external-acl-helpers="ip_user,unix_group,wbinfo_group" \ + --enable-ntlm-auth-helpers="SMB,fakeauth,no_check" \ + --enable-delay-pools --enable-arp-acl --enable-ssl --enable-snmp \ + --enable-linux-netfilter --enable-ident-lookups \ + --enable-useragent-log --enable-cache-digests --enable-referer-log \ + --enable-async-io --enable-truncate --enable-arp-acl \ + --enable-htcp --enable-carp --enable-epoll --with-maxfd=4096 + --with-large-files +#some versions have build problems with both async and truncate enabled: +# --enable-async-io --enable-arp-acl \ + + make || return 1 + make DESTDIR=${pkgdir} install || return 1 + rm -rf ${pkgdir}/var + mv ${pkgdir}/usr/bin/Run* ${pkgdir}/usr/lib/squid + mkdir -p ${pkgdir}/var/cache/squid + mkdir -p ${pkgdir}/var/log/squid + install -D -m755 ${srcdir}/squid ${pkgdir}/etc/rc.d/squid + install -D -m755 ${srcdir}/squid.cron ${pkgdir}/etc/cron.weekly/squid + install -D -m644 ${srcdir}/squid.conf.d ${pkgdir}/etc/conf.d/squid + install -D -m644 ${srcdir}/squid.pam ${pkgdir}/etc/pam.d/squid + install -D -m644 ${pkgdir}/etc/squid/squid.conf \ + ${pkgdir}/etc/squid/squid.conf.default +} +# vim: ts=2 sw=2 et ft=sh diff --git a/extra/squid/fix-for-new-cap-headers.patch b/extra/squid/fix-for-new-cap-headers.patch new file mode 100644 index 000000000..ce24681e8 --- /dev/null +++ b/extra/squid/fix-for-new-cap-headers.patch @@ -0,0 +1,14 @@ +--- src/tools.c.orig 2009-11-02 10:54:49.000000000 -0500 ++++ src/tools.c 2009-11-02 10:55:05.000000000 -0500 +@@ -44,9 +44,9 @@ + #if HAVE_SYS_CAPABILITY_H + #undef _POSIX_SOURCE + /* Ugly glue to get around linux header madness colliding with glibc */ +-#define _LINUX_TYPES_H ++/*#define _LINUX_TYPES_H*/ + #define _LINUX_FS_H +-typedef uint32_t __u32; ++/*typedef uint32_t __u32;*/ + #include <sys/capability.h> + #endif + #endif diff --git a/extra/squid/squid b/extra/squid/squid new file mode 100644 index 000000000..2df1fc72d --- /dev/null +++ b/extra/squid/squid @@ -0,0 +1,52 @@ +#!/bin/bash + +# source application-specific settings +SQUID_ARGS= +[ -f /etc/conf.d/squid ] && . /etc/conf.d/squid + +. /etc/rc.conf +. /etc/rc.d/functions + +PID=`pidof -o %PPID /usr/sbin/squid` +case "$1" in + + start) + if [ ! -f /var/cache/squid/swap.state ]; then + stat_busy "Creating squid's swap directories" + /usr/sbin/squid -z + fi + stat_busy "Starting squid" + [ -z "$PID" ] && /usr/sbin/squid ${SQUID_ARGS} + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon squid + stat_done + fi + ;; + + stop) + stat_busy "Stopping squid" + [ ! -z "$PID" ] && /usr/sbin/squid -k shutdown &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + # wait for squid to shutdown so we can safely do a restart + while [ ! -z "`pidof -o %PPID /usr/sbin/squid`" ]; do + stat_append "." + sleep 3 + done + rm_daemon squid + stat_done + fi + ;; + + restart) + $0 stop + sleep 5 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 diff --git a/extra/squid/squid-makefiles.patch b/extra/squid/squid-makefiles.patch new file mode 100644 index 000000000..4cefb89a0 --- /dev/null +++ b/extra/squid/squid-makefiles.patch @@ -0,0 +1,53 @@ +diff -Naur squid-2.7.STABLE2-orig/helpers/basic_auth/SMB/Makefile.in squid-2.7.STABLE2/helpers/basic_auth/SMB/Makefile.in +--- squid-2.7.STABLE2-orig/helpers/basic_auth/SMB/Makefile.in 2007-11-11 20:14:01.000000000 -0500 ++++ squid-2.7.STABLE2/helpers/basic_auth/SMB/Makefile.in 2008-06-09 21:32:52.000000000 -0400 +@@ -268,7 +268,7 @@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ + SMB_AUTH_HELPER = smb_auth.sh +-SAMBAPREFIX = /usr/local/samba ++SAMBAPREFIX = /usr + SMB_AUTH_HELPER_PATH = $(libexecdir)/$(SMB_AUTH_HELPER) + libexec_SCRIPTS = $(SMB_AUTH_HELPER) + smb_auth_CFLAGS = -DSAMBAPREFIX=\"$(SAMBAPREFIX)\" -DHELPERSCRIPT=\"$(SMB_AUTH_HELPER_PATH)\" +diff -Naur squid-2.7.STABLE2-orig/src/Makefile.in squid-2.7.STABLE2/src/Makefile.in +--- squid-2.7.STABLE2-orig/src/Makefile.in 2008-01-02 20:16:40.000000000 -0500 ++++ squid-2.7.STABLE2/src/Makefile.in 2008-06-09 21:34:39.000000000 -0400 +@@ -653,13 +653,13 @@ + DEFAULT_CONFIG_FILE = $(sysconfdir)/squid.conf + DEFAULT_MIME_TABLE = $(sysconfdir)/mime.conf + DEFAULT_DNSSERVER = $(libexecdir)/`echo dnsserver | sed '$(transform);s/$$/$(EXEEXT)/'` +-DEFAULT_LOG_PREFIX = $(localstatedir)/logs ++DEFAULT_LOG_PREFIX = $(localstatedir)/log/squid + DEFAULT_CACHE_LOG = $(DEFAULT_LOG_PREFIX)/cache.log + DEFAULT_ACCESS_LOG = $(DEFAULT_LOG_PREFIX)/access.log + DEFAULT_STORE_LOG = $(DEFAULT_LOG_PREFIX)/store.log +-DEFAULT_PID_FILE = $(DEFAULT_LOG_PREFIX)/squid.pid ++DEFAULT_PID_FILE = $(localstatedir)/run/squid.pid + DEFAULT_NETDB_FILE = $(DEFAULT_LOG_PREFIX)/netdb.state +-DEFAULT_SWAP_DIR = $(localstatedir)/cache ++DEFAULT_SWAP_DIR = $(localstatedir)/cache/squid + DEFAULT_PINGER = $(libexecdir)/`echo pinger | sed '$(transform);s/$$/$(EXEEXT)/'` + DEFAULT_UNLINKD = $(libexecdir)/`echo unlinkd | sed '$(transform);s/$$/$(EXEEXT)/'` + DEFAULT_DISKD = $(libexecdir)/`echo diskd-daemon | sed '$(transform);s/$$/$(EXEEXT)/'` +diff -Naur squid-2.7.STABLE2-orig/src/cf.data.pre squid-2.7.STABLE2/src/cf.data.pre +--- squid-2.7.STABLE2-orig/src/cf.data.pre 2008-05-31 16:49:45.000000000 -0400 ++++ squid-2.7.STABLE2/src/cf.data.pre 2008-06-09 21:35:43.000000000 -0400 +@@ -3749,7 +3749,7 @@ + + NAME: cache_effective_user + TYPE: string +-DEFAULT: nobody ++DEFAULT: proxy + LOC: Config.effectiveUser + DOC_START + If you start Squid as root, it will change its effective/real +@@ -3763,7 +3763,7 @@ + + NAME: cache_effective_group + TYPE: string +-DEFAULT: none ++DEFAULT: proxy + LOC: Config.effectiveGroup + DOC_START + If you want Squid to run with a specific GID regardless of diff --git a/extra/squid/squid.conf.d b/extra/squid/squid.conf.d new file mode 100644 index 000000000..b41916a1d --- /dev/null +++ b/extra/squid/squid.conf.d @@ -0,0 +1,4 @@ +# +# Parameters to be passed to squid +# +SQUID_ARGS="-D -sYC" diff --git a/extra/squid/squid.cron b/extra/squid/squid.cron new file mode 100644 index 000000000..c2b5bc9ce --- /dev/null +++ b/extra/squid/squid.cron @@ -0,0 +1,4 @@ +#!/bin/bash + +PID=`pidof -o %PPID /usr/sbin/squid` +[ -n "$PID" ] && /usr/sbin/squid -k rotate diff --git a/extra/squid/squid.install b/extra/squid/squid.install new file mode 100644 index 000000000..85776358c --- /dev/null +++ b/extra/squid/squid.install @@ -0,0 +1,28 @@ +post_install() { + if [ -z "$(grep ^proxy: /etc/group)" ]; then + usr/sbin/groupadd -g 15 proxy &>/dev/null + fi + + id proxy &>/dev/null || \ + usr/sbin/useradd -u 15 -g proxy -d /var/empty proxy + + chown proxy.proxy var/{cache,log}/squid + + cat << EOF +Release notes for version 2.7: + http://www.squid-cache.org/Versions/v2/2.7/RELEASENOTES.html + +EOF +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + usr/sbin/userdel proxy &> /dev/null + if [ ! -z "$(grep ^proxy: /etc/group)" ]; then + usr/sbin/groupdel proxy &>/dev/null + fi +} + diff --git a/extra/squid/squid.pam b/extra/squid/squid.pam new file mode 100644 index 000000000..df8a8104f --- /dev/null +++ b/extra/squid/squid.pam @@ -0,0 +1,4 @@ +#/etc/pam.d/squid +# +auth required pam_unix.so +account required pam_unix.so |