diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-09-02 13:56:52 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-09-02 13:56:52 +0000 |
commit | 92c80a5b15124177c3dd28eeb9542f5f3e94c965 (patch) | |
tree | 7261ce2b790360685b87dd8a08d0e3fa518e99be /testing | |
parent | 7916c04b07a879cff00e2084c6ae30d897ff7237 (diff) | |
download | aports-92c80a5b15124177c3dd28eeb9542f5f3e94c965.tar.bz2 aports-92c80a5b15124177c3dd28eeb9542f5f3e94c965.tar.xz |
testing/squid: test squid 3.1
Diffstat (limited to 'testing')
-rw-r--r-- | testing/squid/APKBUILD | 288 | ||||
-rw-r--r-- | testing/squid/squid-alpine.patch | 155 | ||||
-rw-r--r-- | testing/squid/squid.confd | 15 | ||||
-rw-r--r-- | testing/squid/squid.initd | 115 | ||||
-rw-r--r-- | testing/squid/squid.logrotate | 11 | ||||
-rw-r--r-- | testing/squid/squid.post-install | 5 | ||||
-rw-r--r-- | testing/squid/squid.pre-install | 6 | ||||
-rw-r--r-- | testing/squid/squid.pre-upgrade | 6 |
8 files changed, 601 insertions, 0 deletions
diff --git a/testing/squid/APKBUILD b/testing/squid/APKBUILD new file mode 100644 index 0000000000..70e786ff4e --- /dev/null +++ b/testing/squid/APKBUILD @@ -0,0 +1,288 @@ +# Contributor: Carlo Landmeter <clandmeter@gmail.com> +# Maintainer: Carlo Landmeter <clandmeter@gmail.com> +pkgname=squid +pkgver=3.1.15 +pkgrel=0 +pkgdesc="A full-featured Web proxy cache server." +url="http://www.squid-cache.org" +install="squid.pre-install squid.pre-upgrade squid.post-install" +pkgusers="squid" +pkggroups="squid" +arch="all" +license="GPL-2" +depends="logrotate" +makedepends="openssl-dev perl-dev autoconf automake heimdal-dev libtool + libcap-dev" +subpackages="$pkgname-doc" +linguas="af ar az bg ca cs da de el es et fa fi fr he hu hy id it ja ko lt + lv ms nl oc pl pt ro ru sk sr sv th tr uk uz vi zh" +langdir="/usr/share/squid/errors" + +source="http://www.squid-cache.org/Versions/v3/3.2/squid-$pkgver.tar.bz2 + squid.initd + squid.confd + $pkgname.logrotate + squid-alpine.patch + " + +pkgusers="squid" +pkggroups="squid" + +_builddir="$srcdir"/$pkgname-$pkgver +prepare() { + cd "$_builddir" + for i in $source; do + case $i in + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; + esac + done +# ./bootstrap.sh +} + +build() { + cd "$_builddir" + + ./configure --prefix=/usr \ + --datadir=/usr/share/squid \ + --sysconfdir=/etc/squid \ + --libexecdir=/usr/lib/squid \ + --localstatedir=/var \ + --disable-strict-error-checking \ + --enable-auth="basic,digest,ntlm,negotiate" \ + --enable-removal-policies="lru,heap" \ + --enable-digest-auth-helpers="password" \ + --enable-basic-auth-helpers="getpwnam,NCSA,SMB,MSNT,multi-domain-NTLM,squid_radius_auth" \ + --enable-epoll \ + --enable-external-acl-helpers="ip_user,unix_group,wbinfo_group" \ + --enable-ntlm-auth-helpers="fakeauth,no_check,smb_lm" \ + --enable-negotiate-auth-helpers="squid_kerb_auth" \ + --disable-mit \ + --enable-heimdal \ + --enable-delay-pools \ + --enable-arp-acl \ + --enable-ssl \ + --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-poll --with-maxfd=4096 \ + --enable-follow-x-forwarded-for \ + --with-large-files \ + || return 1 + + make || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install + + install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname + install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname + install -m644 -D "$srcdir"/$pkgname.logrotate \ + "$pkgdir"/etc/logrotate.d/squid + + install -d -o squid -g squid \ + "$pkgdir"/var/cache/squid \ + "$pkgdir"/var/log/squid \ + "$pkgdir"/var/run/squid + chmod +x "$pkgdir"/usr/lib/squid/* +} + +squid_kerb_auth() { + pkgdesc="Squid kerberos authetication helper" + install -d "$subpkgdir"/usr/lib/squid + mv "$pkgdir"/usr/lib/squid/squid_kerb_auth "$subpkgdir"/usr/lib/squid/ +} + +_mv_error() { + local d=usr/share/squid/errors + mkdir -p "$subpkgdir/$d" + mv "$pkgdir/$d/${1}" "$subpkgdir/$d/" || return 1 + # last one removed the dir + rmdir "$pkgdir/$d" 2>/dev/null + return 0 +} + +errors_armenian() { + depends="$pkgname" + _mv_error Armenian +} + +errors_azerbaijani() { + depends="$pkgname" + _mv_error Azerbaijani +} + +errors_bulgarian() { + depends="$pkgname" + _mv_error Bulgarian +} + +errors_catalan() { + depends="$pkgname" + _mv_error Catalan +} + +errors_czech() { + depends="$pkgname" + _mv_error Czech +} + +errors_danish() { + depends="$pkgname" + _mv_error Danish +} + +errors_dutch() { + depends="$pkgname" + _mv_error Dutch +} + +errors_english() { + depends= + _mv_error English +} + +errors_estonian() { + depends="$pkgname" + _mv_error Estonian +} + +errors_finnish() { + depends="$pkgname" + _mv_error Finnish +} + +errors_french() { + depends="$pkgname" + _mv_error French +} + +errors_german() { + depends="$pkgname" + _mv_error German +} + +errors_greek() { + depends="$pkgname" + _mv_error Greek +} + +errors_hebrew() { + depends="$pkgname" + _mv_error Hebrew +} + +errors_hungarian() { + depends="$pkgname" + _mv_error Hungarian +} + +errors_italian() { + depends="$pkgname" + _mv_error Italian +} + +errors_japanese() { + depends="$pkgname" + _mv_error Japanese +} + +errors_korean() { + depends="$pkgname" + _mv_error Korean +} + +errors_lithuanian() { + depends="$pkgname" + _mv_error Lithuanian +} + +errors_polish() { + depends="$pkgname" + _mv_error Polish +} + +errors_portuguese() { + depends="$pkgname" + _mv_error Portuguese +} + +errors_romanian() { + depends="$pkgname" + _mv_error Romanian +} + +errors_russian_1251() { + depends="$pkgname" + _mv_error Russian-1251 +} + +errors_russian_koi8_r() { + depends="$pkgname" + _mv_error Russian-koi8-r +} + +errors_serbian() { + depends="$pkgname" + _mv_error Serbian +} + +errors_simplify_chinese() { + depends="$pkgname" + _mv_error Simplify_Chinese +} + +errors_slovak() { + depends="$pkgname" + _mv_error Slovak +} + +errors_spanish() { + depends="$pkgname" + _mv_error Spanish +} + +errors_swedish() { + depends="$pkgname" + _mv_error Swedish +} + +errors_traditional_chinese() { + depends="$pkgname" + _mv_error Traditional_Chinese +} + +errors_turkish() { + depends="$pkgname" + _mv_error Turkish +} + +errors_ukrainian_1251() { + depends="$pkgname" + _mv_error Ukrainian-1251 +} + +errors_ukrainian_koi8_u() { + depends="$pkgname" + _mv_error Ukrainian-koi8-u +} + +errors_ukrainian_utf8() { + depends="$pkgname" + _mv_error Ukrainian-utf8 +} + + +md5sums="73d47363ddccc400bc0fb2f814c63a92 squid-3.1.15.tar.bz2 +57fed05adc40acab6a5480ec7a014154 squid.initd +44b052db7910f386ef88ddcf69c9ba4e squid.confd +58823e0b86bc2dc71d270208b7b284b4 squid.logrotate +9068114b32e91c82e8068070908e35a6 squid-alpine.patch" diff --git a/testing/squid/squid-alpine.patch b/testing/squid/squid-alpine.patch new file mode 100644 index 0000000000..e660d3c592 --- /dev/null +++ b/testing/squid/squid-alpine.patch @@ -0,0 +1,155 @@ +diff -Nru squid-3.1.9.orig/helpers/basic_auth/MSNT/confload.c squid-3.1.9/helpers/basic_auth/MSNT/confload.c +--- squid-3.1.9.orig/helpers/basic_auth/MSNT/confload.c 2010-10-25 13:34:23.000000000 +0200 ++++ squid-3.1.9/helpers/basic_auth/MSNT/confload.c 2010-11-27 13:43:30.000000000 +0100 +@@ -27,7 +27,7 @@ + + /* Path to configuration file */ + #ifndef SYSCONFDIR +-#define SYSCONFDIR "/usr/local/squid/etc" ++#define SYSCONFDIR "/etc/squid" + #endif + #define CONFIGFILE SYSCONFDIR "/msntauth.conf" + +diff -Nru squid-3.1.9.orig/helpers/basic_auth/MSNT/msntauth.conf.default squid-3.1.9/helpers/basic_auth/MSNT/msntauth.conf.default +--- squid-3.1.9.orig/helpers/basic_auth/MSNT/msntauth.conf.default 2010-10-25 13:34:24.000000000 +0200 ++++ squid-3.1.9/helpers/basic_auth/MSNT/msntauth.conf.default 2010-11-27 13:43:30.000000000 +0100 +@@ -8,6 +8,6 @@ + server other_PDC other_BDC otherdomain + + # Denied and allowed users. Comment these if not needed. +-#denyusers /usr/local/squid/etc/msntauth.denyusers +-#allowusers /usr/local/squid/etc/msntauth.allowusers ++#denyusers /etc/squid/msntauth.denyusers ++#allowusers /etc/squid/msntauth.allowusers + +diff -Nru squid-3.1.9.orig/helpers/basic_auth/SMB/smb_auth.sh squid-3.1.9/helpers/basic_auth/SMB/smb_auth.sh +--- squid-3.1.9.orig/helpers/basic_auth/SMB/smb_auth.sh 2010-10-25 13:34:25.000000000 +0200 ++++ squid-3.1.9/helpers/basic_auth/SMB/smb_auth.sh 2010-11-27 13:43:30.000000000 +0100 +@@ -24,7 +24,7 @@ + read AUTHSHARE + read AUTHFILE + read SMBUSER +-read SMBPASS ++read -r SMBPASS + + # Find domain controller + echo "Domain name: $DOMAINNAME" +@@ -47,7 +47,7 @@ + addropt="" + fi + echo "Query address options: $addropt" +-dcip=`nmblookup $addropt "$PASSTHROUGH#1c" | awk '/^[0-9.]+ / { print $1 ; exit }'` ++dcip=`nmblookup $addropt "$PASSTHROUGH#1c" | awk '/^[0-9.]+\..+ / { print $1 ; exit }'` + echo "Domain controller IP address: $dcip" + [ -n "$dcip" ] || exit 1 + +diff -Nru squid-3.1.9.orig/helpers/external_acl/session/squid_session.8 squid-3.1.9/helpers/external_acl/session/squid_session.8 +--- squid-3.1.9.orig/helpers/external_acl/session/squid_session.8 2010-10-25 13:34:23.000000000 +0200 ++++ squid-3.1.9/helpers/external_acl/session/squid_session.8 2010-11-27 13:43:30.000000000 +0100 +@@ -35,7 +35,7 @@ + .P + Configuration example using the default automatic mode + .IP +-external_acl_type session ttl=300 negative_ttl=0 children=1 concurrency=200 %LOGIN /usr/local/squid/libexec/squid_session ++external_acl_type session ttl=300 negative_ttl=0 children=1 concurrency=200 %LOGIN /usr/lib/squid/squid_session + .IP + acl session external session + .IP +diff -Nru squid-3.1.9.orig/helpers/external_acl/unix_group/squid_unix_group.8 squid-3.1.9/helpers/external_acl/unix_group/squid_unix_group.8 +--- squid-3.1.9.orig/helpers/external_acl/unix_group/squid_unix_group.8 2010-10-25 13:34:25.000000000 +0200 ++++ squid-3.1.9/helpers/external_acl/unix_group/squid_unix_group.8 2010-11-27 13:43:30.000000000 +0100 +@@ -27,7 +27,7 @@ + This squid.conf example defines two Squid acls. usergroup1 matches users in group1, and usergroup2 + matches users in group2 or group3 + .IP +-external_acl_type unix_group %LOGIN /usr/local/squid/libexec/squid_unix_group -p ++external_acl_type unix_group %LOGIN /usr/lib/squid/squid_unix_group -p + .IP + acl usergroup1 external unix_group group1 + .IP +diff -Nru squid-3.1.9.orig/src/cf.data.pre squid-3.1.9/src/cf.data.pre +--- squid-3.1.9.orig/src/cf.data.pre 2010-10-25 13:34:25.000000000 +0200 ++++ squid-3.1.9/src/cf.data.pre 2010-11-27 13:43:30.000000000 +0100 +@@ -716,6 +716,7 @@ + acl Safe_ports port 488 # gss-http + acl Safe_ports port 591 # filemaker + acl Safe_ports port 777 # multiling http ++acl Safe_ports port 901 # SWAT + acl CONNECT method CONNECT + NOCOMMENT_END + DOC_END +@@ -862,6 +863,9 @@ + http_access allow localnet + http_access allow localhost + ++# Allow the localhost to have access by default ++http_access allow localhost ++ + # And finally deny all other access to this proxy + http_access deny all + NOCOMMENT_END +@@ -4027,11 +4031,11 @@ + + NAME: cache_mgr + TYPE: string +-DEFAULT: webmaster ++DEFAULT: root + LOC: Config.adminEmail + DOC_START + Email-address of local cache manager who will receive +- mail if the cache dies. The default is "webmaster." ++ mail if the cache dies. The default is "root". + DOC_END + + NAME: mail_from +@@ -6345,7 +6349,7 @@ + NAME: forwarded_for + COMMENT: on|off|transparent|truncate|delete + TYPE: string +-DEFAULT: on ++DEFAULT: delete + LOC: opt_forwarded_for + DOC_START + If set to "on", Squid will append your client's IP address +diff -Nru squid-3.1.9.orig/src/debug.cc squid-3.1.9/src/debug.cc +--- squid-3.1.9.orig/src/debug.cc 2010-10-25 13:34:24.000000000 +0200 ++++ squid-3.1.9/src/debug.cc 2010-11-27 13:43:30.000000000 +0100 +@@ -452,7 +452,7 @@ + #if HAVE_SYSLOG && defined(LOG_LOCAL4) + + if (Debug::log_syslog) +- openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY | LOG_CONS, syslog_facility); ++ openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY, syslog_facility); + + #endif /* HAVE_SYSLOG */ + +diff -Nru squid-3.1.9.orig/src/main.cc squid-3.1.9/src/main.cc +--- squid-3.1.9.orig/src/main.cc 2010-10-25 13:34:25.000000000 +0200 ++++ squid-3.1.9/src/main.cc 2010-11-27 13:43:30.000000000 +0100 +@@ -1556,7 +1556,7 @@ + if (*(argv[0]) == '(') + return; + +- openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4); ++ openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY, LOG_DAEMON); + + if ((pid = fork()) < 0) + syslog(LOG_ALERT, "fork failed: %s", xstrerror()); +@@ -1600,7 +1600,7 @@ + + if ((pid = fork()) == 0) { + /* child */ +- openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4); ++ openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY, LOG_DAEMON); + prog = xstrdup(argv[0]); + argv[0] = xstrdup("(squid)"); + execvp(prog, argv); +@@ -1608,7 +1608,7 @@ + } + + /* parent */ +- openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4); ++ openlog(APP_SHORTNAME, LOG_PID | LOG_NDELAY, LOG_DAEMON); + + syslog(LOG_NOTICE, "Squid Parent: child process %d started", pid); + diff --git a/testing/squid/squid.confd b/testing/squid/squid.confd new file mode 100644 index 0000000000..14a9ee84bd --- /dev/null +++ b/testing/squid/squid.confd @@ -0,0 +1,15 @@ +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/net-proxy/squid/files/squid.confd,v 1.2 2008/11/30 19:20:44 mrness Exp $ + +# Config file for /etc/init.d/squid + +SQUID_OPTS="-DYC" + +# Max. number of filedescriptors to use. You can increase this on a busy +# cache to a maximum of (currently) 8192 filedescriptors. Default is 1024. +SQUID_MAXFD=1024 + +# Kerberos keytab file to use. This is required if you enable kerberos authentication. +SQUID_KEYTAB="" + diff --git a/testing/squid/squid.initd b/testing/squid/squid.initd new file mode 100644 index 0000000000..2eaf1dd2af --- /dev/null +++ b/testing/squid/squid.initd @@ -0,0 +1,115 @@ +#!/sbin/runscript +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/net-proxy/squid/files/squid.initd,v 1.10 2008/11/30 19:20:44 mrness Exp $ + +opts="${opts} reload rotate" + +conf=/etc/squid/squid.conf + +depend() { + need net + after firewall +} + +# Try to increase the # of filedescriptors we can open. +maxfds() { + [ -n "$SQUID_MAXFD" ] || return + [ -f /proc/sys/fs/file-max ] || return 0 + [ $SQUID_MAXFD -le 8192 ] || SQUID_MAXFD=8192 + local global_file_max=`cat /proc/sys/fs/file-max` + local minimal_file_max=$(($SQUID_MAXFD + 4096)) + if [ "$global_file_max" -lt $minimal_file_max ]; then + echo $minimal_file_max > /proc/sys/fs/file-max + fi + ulimit -n $SQUID_MAXFD +} + +checkconfig() { + maxfds + + local CACHE_SWAP=$(awk '/^[ \t]*cache_dir[ \t]+/ { if ($2 == "coss" ) printf "%s/stripe ", $3 ; else printf "%s/00 ", $3; }' < $conf) + [ -z "$CACHE_SWAP" ] && CACHE_SWAP="/var/cache/squid/00" + + local x + for x in $CACHE_SWAP ; do + if [ ! -e $x ] ; then + ebegin "Initializing cache directories" + local ORIG_UMASK=$(umask) + umask 027 + local INIT_CACHE_RESPONSE="$(/usr/sbin/squid -z -N -D 2>&1)" + if [ $? != 0 ] || echo "$INIT_CACHE_RESPONSE" | grep -q "erminated abnormally" ; then + umask $ORIG_UMASK + eend 1 + echo "$INIT_CACHE_RESPONSE" + return 1 + fi + umask $ORIG_UMASK + eend 0 + break + fi + done + + squid -k parse +} + +get_pidfile() { + PIDFILE=$(awk '/^[ \t]*pid_filename[ \t]+/ {print $2}' $conf) + [ -z "$PIDFILE" ] && PIDFILE=/var/run/squid/squid.pid +} + +start() { + get_pidfile + checkconfig || return 1 + ebegin "Starting squid" + start-stop-daemon --start --pidfile "$PIDFILE" \ + --env KRB5_KTNAME="${SQUID_KEYTAB}" \ + --exec /usr/sbin/squid -- ${SQUID_OPTS} + eend $? && sleep 1 +} + +stop() { + local rc=0 pid + ebegin "Stopping squid" + get_pidfile + /usr/sbin/squid -k shutdown + + # Now we have to wait until squid has _really_ stopped. + if [ -f "$PIDFILE" ] ; then + pid=$(cat "$PIDFILE") + if [ -d /proc/$pid ]; then + einfon "Waiting for squid to shutdown ." + else + rm -f "$PIDFILE" + fi + cnt=0 + while [ -f "$PIDFILE" ] ; do + cnt=$(expr $cnt + 1) + if [ $cnt -gt 60 ] ; then + # Waited 120 seconds now. Fail. + echo + rc=1 + break + fi + sleep 2 + echo -n "." + done + echo + fi + eend $rc +} + +reload() { + checkconfig || return 1 + ebegin "Reloading squid" + /usr/sbin/squid -k reconfigure + eend $? +} + +rotate() { + service_started squid || return 1 + ebegin "Rotating logs" + /usr/sbin/squid -k rotate + eend $? +} + diff --git a/testing/squid/squid.logrotate b/testing/squid/squid.logrotate new file mode 100644 index 0000000000..fb3279e013 --- /dev/null +++ b/testing/squid/squid.logrotate @@ -0,0 +1,11 @@ +/var/log/squid/*.log { + daily + compress + rotate 5 + missingok + nocreate + sharedscripts + postrotate + /usr/sbin/squid -k rotate + endscript +} diff --git a/testing/squid/squid.post-install b/testing/squid/squid.post-install new file mode 100644 index 0000000000..88df6d26f9 --- /dev/null +++ b/testing/squid/squid.post-install @@ -0,0 +1,5 @@ +#!/bin/sh + +chown squid:squid /var/cache/squid /var/log/squid +exit 0 + diff --git a/testing/squid/squid.pre-install b/testing/squid/squid.pre-install new file mode 100644 index 0000000000..322d21deab --- /dev/null +++ b/testing/squid/squid.pre-install @@ -0,0 +1,6 @@ +#!/bin/sh + +adduser -D squid -H /var/cache/squid 2>/dev/null +addgroup winbind 2>/dev/null +addgroup squid winbind +exit 0 diff --git a/testing/squid/squid.pre-upgrade b/testing/squid/squid.pre-upgrade new file mode 100644 index 0000000000..322d21deab --- /dev/null +++ b/testing/squid/squid.pre-upgrade @@ -0,0 +1,6 @@ +#!/bin/sh + +adduser -D squid -H /var/cache/squid 2>/dev/null +addgroup winbind 2>/dev/null +addgroup squid winbind +exit 0 |