ports/145676: [Maintainer] www/squid31: update to 3.1.1, move default cache and log directory to /var

Thomas-Martin Seck tmseck at web.de
Tue Apr 13 17:50:01 UTC 2010


>Number:         145676
>Category:       ports
>Synopsis:       [Maintainer] www/squid31: update to 3.1.1, move default cache and log directory to /var
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 13 17:50:01 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Thomas-Martin Seck
>Release:        FreeBSD 8.0-RELEASE amd64
>Organization:
a private site in Germany
>Environment:
FreeBSD ports collection as of April 13, 2010.

	
>Description:
- update to 3.1.1, the first stable release of the 3.1 branch
- update MASTER_SITES
- move cache and log directories from $PREFIX/squid to /var/squid/

UPDATING entry:

Starting with Squid 3.1.1 the default cache directory was changed from
$PREFIX/squid/cache to /var/squid/cache. The default log directory was
changed from $PREFIX/squid/logs to /var/log/squid.

The defaults for the following Squid configuration parameters have
changed as follows:

access_log from $PREFIX/squid/logs/access.log to /var/log/squid/access.log

pid_filename from $PREFIX/squid/squid.pid to /var/run/squid/squid.pid

netdb_filename from $PREFIX/squid/logs/netdb.state to
/var/log/squid/netdb.state

cache_log from $PREFIX/squid/logs/cache.log to /var/log/squid/cache.log

coredump_dir from $PREFIX/squid/cache to /var/squid/cache

Please check whether you need to define any of these variables in your
squid.conf explicitly before updating, especially if you have set up
automated log processing or automated log rotation. If you define
pid_filename in your squid.conf you should also set squid_pidfile to the
same value in /etc/rc.conf, cf. $PREFIX/etc/rc.d/squid.

	
>How-To-Repeat:
	
>Fix:
Apply this patch:

Index: Makefile
===================================================================
--- Makefile	(.../www/squid31)	(Revision 1816)
+++ Makefile	(.../local/squid31)	(Revision 1816)
@@ -52,46 +52,45 @@
 #     Do not support loadable modules.
 
 PORTNAME=	squid
-PORTVERSION=	3.1.0.${SQUID_BETA_VER}
+PORTVERSION=	3.1.${SQUID_STABLE_VER}
 CATEGORIES=	www ipv6
 MASTER_SITES=	ftp://ftp.squid-cache.org/pub/%SUBDIR%/ \
-		ftp://mirrors.24-7-solutions.net/pub/squid/%SUBDIR%/ \
-		ftp://ftp.belnet.be/packages/squid/pub/%SUBDIR%/ \
-		ftp://ftp.nl.uu.net/pub/unix/www/squid/%SUBDIR%/ \
-		ftp://ftp.mirrorservice.org/sites/ftp.squid-cache.org/pub/%SUBDIR%/ \
-		ftp://ftp.ntua.gr/pub/www/Squid/%SUBDIR%/ \
-		ftp://ftp.ccs.neu.edu/pub/mirrors/squid.nlanr.net/pub/%SUBDIR%/ \
-		${MASTER_SITE_RINGSERVER:S,%SUBDIR%,net/www/squid/&,} \
+		http://mirrors.ccs.neu.edu/Squid/ \
+		ftp://ftp.fu-berlin.de/unix/www/squid/squid/ \
+		ftp://ftp.nl.uu.net/pub/unix/www/squid/ \
+		ftp://ftp.solnet.ch/mirror/squid/ \
+		ftp://ftp.ntua.gr/pub/www/Squid/squid/ \
+		http://mirror.aarnet.edu.au/pub/squid/squid/ \
+		${MASTER_SITE_RINGSERVER:S,%SUBDIR%,net/www/squid,} \
 		http://www.squid-cache.org/Versions/v3/3.1/ \
-		http://www3.us.squid-cache.org/Versions/v3/3.1/ \
+		http://www2.us.squid-cache.org/Versions/v3/3.1/ \
 		http://www1.at.squid-cache.org/Versions/v3/3.1/ \
-		http://www2.nl.squid-cache.org/Versions/v3/3.1/ \
-		http://www1.ru.squid-cache.org/Versions/v3/3.1/ \
-		http://www1.uk.squid-cache.org/Versions/v3/3.1/ \
+		http://www2.de.squid-cache.org/Versions/v3/3.1/ \
+		http://www.eu.squid-cache.org/Versions/v3/3.1/ \
+		http://www1.ie.squid-cache.org/Versions/v3/3.1/ \
 		http://www1.jp.squid-cache.org/Versions/v3/3.1/ \
 		http://www2.tw.squid-cache.org/Versions/v3/3.1/
 MASTER_SITE_SUBDIR=	squid
-DISTNAME=	squid-3.1.0.${SQUID_BETA_VER}
+DISTNAME=	squid-3.1.${SQUID_STABLE_VER}
 DIST_SUBDIR=	squid3.1
 
 PATCH_SITES=	http://www.squid-cache.org/%SUBDIR%/ \
 		http://www2.us.squid-cache.org/%SUBDIR%/ \
-		http://www3.us.squid-cache.org/%SUBDIR%/ \
 		http://www1.at.squid-cache.org/%SUBDIR%/ \
-		http://www2.nl.squid-cache.org/%SUBDIR%/ \
-		http://www1.ru.squid-cache.org/%SUBDIR%/ \
-		http://www1.uk.squid-cache.org/%SUBDIR%/ \
+		http://www2.de.squid-cache.org/%SUBDIR%/ \
+		http://www.eu.squid-cache.org/%SUBDIR%/ \
+		http://www1.ie.squid-cache.org/%SUBDIR%/ \
 		http://www1.jp.squid-cache.org/%SUBDIR%/ \
-		http://www1.tw.squid-cache.org/%SUBDIR%/
+		http://www2.tw.squid-cache.org/%SUBDIR%/
 PATCH_SITE_SUBDIR=	Versions/v3/3.1/changesets
 PATCHFILES=
 
 MAINTAINER=	tmseck at web.de
-COMMENT=	HTTP Caching Proxy (BETA Version)
+COMMENT=	HTTP Caching Proxy
 
 LATEST_LINK=	squid31
 
-SQUID_BETA_VER=	17
+SQUID_STABLE_VER=	1
 
 CONFLICTS=	squid-2.[0-9].* squid-3.[^1].* cacheboy-[0-9]* lusca-head-[0-9]*
 GNU_CONFIGURE=	yes
@@ -177,7 +176,7 @@
 		ERR_URN_RESOLVE ERR_WRITE_ERROR ERR_ZERO_SIZE_OBJECT
 
 error_dirs=	af ar az bg ca cs da de el en es et fa fi fr he hu hy id it \
-		ja ko lt lv ms nl pl pt pt-br ro ru sk sr sv th tr uk uz \
+		ja ko lt lv ms nl pl pt pt-br ro ru sk sv th tr uk uz \
 		zh-cn zh-tw \
 		templates
 
@@ -196,7 +195,7 @@
 			fr-be fr-ca fr-ch fr-fr fr-lu fr-mc \
 			he-il hu-hu hy-am id-id it-ch it-it \
 			ja-jp ko-kp ko-kr lt-lt lv-lv ms-my nl-nl \
-			pl-pl pt-pt ro-md ro-ro ru-ru sk-sk sr-sp sv-fi sv-se \
+			pl-pl pt-pt ro-md ro-ro ru-ru sk-sk sv-fi sv-se \
 			th-th tr-tr uk-ua zh-hk zh-mo zh-sg
 
 libexec=	cachemgr.cgi digest_pw_auth diskd ip_user_check \
@@ -209,27 +208,15 @@
 
 sbin=		squidclient squid
 
-# XXX:
-# Squid 3.1 changed the default for the pid file location from
-# ${localstatedir}/logs/squid.pid to ${localstatedir}/squid.pid.
-#
-# There are two ways to tackle this:
-# 1) enforce the old default using --with-pidfile=${PREFIX}/squid/logs/squid.pid
-# 2) accept the new default (and hardwire it here as well) and make sure
-#    that ${localstatedir} is writable by the Squid master process. (It
-#    used not to be, unless the Squid master process had root privileges
-#    or ${localstatedir}'s ACL is modified (chgrp squid; chmod g+w).)
-#    This is what we do now, see also files/pkg-install.in.
-
 CONFIGURE_ARGS=	--with-default-user=${SQUID_UID} \
 		--bindir=${PREFIX}/sbin  \
 		--sbindir=${PREFIX}/sbin  \
 		--datadir=${PREFIX}/etc/squid \
 		--libexecdir=${PREFIX}/libexec/squid \
-		--localstatedir=${PREFIX}/squid \
+		--localstatedir=/var/squid \
 		--sysconfdir=${PREFIX}/etc/squid \
-		--with-logdir=${PREFIX}/squid/logs \
-		--with-pidfile=${PREFIX}/squid/squid.pid \
+		--with-logdir=/var/log/squid \
+		--with-pidfile=/var/run/squid/squid.pid \
 		--enable-removal-policies="lru heap" \
 		--disable-linux-netfilter \
 		--disable-linux-tproxy \
@@ -435,7 +422,7 @@
 PLIST_FILES+=	${error_files:S,^,etc/squid/errors/${d}/,}
 .endfor
 PLIST_FILES+=	${error_dir_links:S,^,etc/squid/errors/,}
-PLIST_DIRS+=	etc/squid/errors etc/squid squid/logs squid/cache squid
+PLIST_DIRS+=	etc/squid/errors etc/squid
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \
Index: distinfo
===================================================================
--- distinfo	(.../www/squid31)	(Revision 1816)
+++ distinfo	(.../local/squid31)	(Revision 1816)
@@ -1,3 +1,3 @@
-MD5 (squid3.1/squid-3.1.0.17.tar.bz2) = 5acabbc26f52363389703a8ce510c88d
-SHA256 (squid3.1/squid-3.1.0.17.tar.bz2) = 1ea00fe852370cfa1b1b26d02526e8a61716243081e6488c29e586df0b7dd770
-SIZE (squid3.1/squid-3.1.0.17.tar.bz2) = 2383810
+MD5 (squid3.1/squid-3.1.1.tar.bz2) = 4316f396d9134049c775c16dc5cf297c
+SHA256 (squid3.1/squid-3.1.1.tar.bz2) = e61fa87631bab41257295b6be010b72f8a1a8961aac2197256d87cf0be7e3081
+SIZE (squid3.1/squid-3.1.1.tar.bz2) = 2385027
Index: pkg-descr
===================================================================
--- pkg-descr	(.../www/squid31)	(Revision 1816)
+++ pkg-descr	(.../local/squid31)	(Revision 1816)
@@ -7,7 +7,4 @@
 By using the lightweight Internet Cache Protocol, Squid caches can be
 arranged in a hierarchy or mesh for additional bandwidth savings.
 
-NOTE: This is a beta version. Stable Squid versions are located in
-      www/squid (2.7 series) and www/squid30 (3.0 series).
-
 WWW: http://www.squid-cache.org/
Index: files/pkg-deinstall.in
===================================================================
--- files/pkg-deinstall.in	(.../www/squid31)	(Revision 1816)
+++ files/pkg-deinstall.in	(.../local/squid31)	(Revision 1816)
@@ -4,13 +4,22 @@
 #
 
 PATH=/bin:/usr/bin:/usr/sbin
+squid_base="/var/squid"
+squid_cachedir="${squid_base}/cache"
+squid_confdir=${PKG_PREFIX}/etc/squid
+squid_logdir="/var/log/squid"
+squid_rundir="/var/run/squid"
 
 case $2 in
 DEINSTALL)
-	cd ${PKG_PREFIX}/etc/squid || exit 1
+	cd ${squid_confdir} || exit 1
 	for f in cachemgr.conf errorpage.css mime.conf msntauth.conf squid.conf; do
 		cmp -s -z ${f} ${f}.default && rm ${f}
 	done
+	# try to cleanup directories in /var:
+	for d in ${squid_cachedir} ${squid_base} ${squid_logdir} ${squid_rundir}; do
+		rmdir ${d} 2>/dev/null
+	done
 	;;
 POST-DEINSTALL)
 	echo "===> post-deinstallation information for $1:"
@@ -22,7 +31,7 @@
 	echo "     created by a default installation of this package, run"
 	echo ""
 	echo "     pw userdel -n %%SQUID_UID%% -u 100"
-	if  [ -d ${PKG_PREFIX}/squid -o -d ${PKG_PREFIX}/etc/squid ] ; then
+	if  [ -d ${squid_base} -o -d ${squid_confdir} -o -d ${squid_logdir} -o -d ${squid_rundir} ] ; then
 		echo ""
 		echo "     In order to ease updates the cache and log directories"
 		echo "     and all configuration files modified by you were preserved."
Index: files/pkg-message.in
===================================================================
--- files/pkg-message.in	(.../www/squid31)	(Revision 1816)
+++ files/pkg-message.in	(.../local/squid31)	(Revision 1816)
@@ -1,8 +1,8 @@
      o You can find the configuration files for this package in the
        directory %%PREFIX%%/etc/squid.
 
-     o A cache directory has been created in %%PREFIX%%/squid/cache.
-       Log files will be written to %%PREFIX%%/squid/logs.
+     o The default cache directory is /var/squid/.
+       The default log directory is /var/log/squid/.
 
        Note:
        You must initialize new cache directories before you can start
@@ -10,14 +10,12 @@
        If your cache directories are already initialized (e.g. after an
        upgrade of squid) you do not need to initialize them again.
 
-     o The default configuration will deny everyone access to the
-       proxy service. Edit the "http_access" directives in
-       %%PREFIX%%/etc/squid/squid.conf to suit your needs.
+     o The default configuration will deny everyone but the local host and
+       local networks as defined in RFC 1918 for IPv4 and RFCs 4193 and
+       4291 for IPv6 access to the proxy service.  Edit the "http_access
+       allow/deny" directives in %%PREFIX%%/etc/squid/squid.conf
+       to suit your needs.
 
-     Please note that the Squid start script is an rc.d style script.
-     This means that Squid will not start automatically at boot
-     time unless it is explicitly enabled.
-
      To enable Squid, set squid_enable=yes in either
      /etc/rc.conf, /etc/rc.conf.local or /etc/rc.conf.d/squid
      Please see %%PREFIX%%/etc/rc.d/squid for further details.
Index: files/pkg-install.in
===================================================================
--- files/pkg-install.in	(.../www/squid31)	(Revision 1816)
+++ files/pkg-install.in	(.../local/squid31)	(Revision 1816)
@@ -5,8 +5,11 @@
 
 PATH=/bin:/usr/bin:/usr/sbin
 pkgname=$1
-squid_base="${PKG_PREFIX:-%%PREFIX%%}/squid"
+squid_base="/var/squid"
+squid_cachedir="${squid_base}/cache"
 squid_confdir="${PKG_PREFIX:-%%PREFIX%%}/etc/squid"
+squid_logdir="/var/log/squid"
+squid_rundir="/var/run/squid"
 if [ -x /usr/sbin/nologin ]; then
 	nologin=/usr/sbin/nologin
 else
@@ -50,10 +53,8 @@
 		echo "I will use the existing user '${squid_user}':"
 	fi
 	pw usershow ${squid_user}
-	# Starting with 3.1, Squid's PID file moved from
-	# ${squid_base}/logs/squid.pid to ${squid_base}/squid.pid.
-	# Since we usually start the Squid master process as ${squid_user},
-	# make sure that ${squid_base} is writable for it.
+	# Since we usually start the Squid master process as ${squid_user}
+	# instead of root make sure that ${squid_base} is writable for it.
 	if [ ! -d ${squid_base} ]; then
 		echo "Creating ${squid_base}..."
 		install -d -o root -g ${squid_group} \
@@ -62,18 +63,26 @@
 		chgrp ${squid_group} ${squid_base}
 		chmod g+w ${squid_base}
 	fi
-	for dir in cache logs; do
-	if [ ! -d ${squid_base}/${dir} ]; then
-		echo "Creating ${squid_base}/${dir}..."
+	if [ ! -d ${squid_cachedir} ]; then
+		echo "Creating ${squid_cachedir} ..."
 		install -d -o ${squid_user} -g ${squid_group} \
-		    -m 0750 ${squid_base}/${dir}
+		    -m 0750 ${squid_cachedir}
 	fi
-	done
 	if [ ! -d ${squid_confdir} ]; then
 		echo "Creating ${squid_confdir}..."
 		install -d -o root -g ${squid_group} \
 		    -m 0755 ${squid_confdir}
 	fi
+	if [ ! -d ${squid_logdir} ]; then
+		echo "Creating ${squid_logdir}..."
+		install -d -o ${squid_user} -g ${squid_group} \
+		    -m 0750 ${squid_logdir}
+	fi
+	if [ ! -d ${squid_rundir} ]; then
+		echo "Creating ${squid_rundir}..."
+		install -d -o ${squid_user} -g ${squid_group} \
+		    -m 0755 ${squid_rundir}
+	fi
 	;;
 POST-INSTALL)
 	for file in cachemgr.conf errorpage.css mime.conf msntauth.conf squid.conf; do
Index: files/squid.in
===================================================================
--- files/squid.in	(.../www/squid31)	(Revision 1816)
+++ files/squid.in	(.../local/squid31)	(Revision 1816)
@@ -13,7 +13,7 @@
 # Additional variables you can define in one of these files:
 #
 # squid_chdir:	the directory into which the rc system moves into before
-# 		starting Squid. Default: %%PREFIX%%/squid
+# 		starting Squid. Default: /var/squid
 #
 # squid_conf:	The configuration file that Squid should use.
 #		Default: %%PREFIX%%/etc/squid/squid.conf
@@ -32,7 +32,7 @@
 # squid_pidfile:
 #		The name (including the full path) of the Squid
 #		master process' PID file.
-#		Default: %%PREFIX%%/squid/squid.pid.
+#		Default: /var/run/squid/squid.pid.
 #		You only need to change this if you changed the
 #		corresponding entry in your Squid configuration.
 #
@@ -73,11 +73,11 @@
 
 load_rc_config ${name}
 
-squid_chdir=${squid_chdir:-"%%PREFIX%%/squid"}
+squid_chdir=${squid_chdir:-"/var/squid"}
 squid_conf=${squid_conf:-"%%PREFIX%%/etc/squid/squid.conf"}
 squid_enable=${squid_enable:-"NO"}
 squid_fib=${squid_fib:-"NONE"}
-squid_pidfile=${squid_pidfile:-"%%PREFIX%%/squid/squid.pid"}
+squid_pidfile=${squid_pidfile:-"/var/run/squid/squid.pid"}
 squid_user=${squid_user:-%%SQUID_UID%%}
 
 pidfile=${squid_pidfile}
	


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list