Subject: pkg/13427: suggested fixes and updates for www/squid
To: None <gnats-bugs@gnats.netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 07/10/2001 13:30:23
>Number:         13427
>Category:       pkg
>Synopsis:       suggested fixes and updates for www/squid
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 10 10:28:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Greg A. Woods
>Release:        pkgsrc-2001/07/09
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:

System: NetBSD 1.5W

>Description:

	I find the existing squid package is very much less than ideal
	for production use, especially when installed as a binary
	package.  Not only that but important new features were left out
	of the configuration too!

	The attached variant of the package suits my needs much better
	and may offer some support to other squid users.

	Note that the pkg/REQUIRE script enclosed depends on making
	"require" files work properly in mk/bsd.pkg.mk, and of course in
	renaming them to the less obtuse name "REQUIRE".....  I'll try
	to clean up and document and send-pr my local changes to the
	pkgsrc makefile stuff soon....

	Note too that you have to set these in /etc/mk.conf if you've
	installed net/ucd-snmp:

		USE_BUILDLINK_ONLY= yes
		USE_BUILDLINK_X11= yes

	the following patch to mk/mk.conf-example may also help:

***************
*** 873,879 ****
  # Possible:  /dev/your_favorite_serial_device0 /dev/your_favorite_serial_device1 ...
  # Default: defaults for various machine_archs are set in mk/bsd.prefs.mk
  
! #SQUID_CONFIGURE_ARGS=
  # Used in squid package to set build configuration options.
  # Possible: see "configure --help"
  # Default: --enable-cachemgr-hostname=localhost
--- 903,916 ----
  # Possible:  /dev/your_favorite_serial_device0 /dev/your_favorite_serial_device1 ...
  # Default: defaults for various machine_archs are set in mk/bsd.prefs.mk
  
! SQUID_CONFIGURE_ARGS=	--enable-cache-digests \
! 			--enable-cachemgr-hostname=localhost \
! 			--enable-delay-pools \
! 			--enable-icmp \
! 			--enable-ipf-transparent \
! 			--enable-removal-policies="lru heap" \
! 			--enable-snmp \
! 			--enable-storeio="ufs diskd"
  # Used in squid package to set build configuration options.
  # Possible: see "configure --help"
  # Default: --enable-cachemgr-hostname=localhost


>How-To-Repeat:

>Fix:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	Makefile
#	distinfo
#	files
#	files/squid.sh
#	patches
#	patches/patch-aa
#	patches/patch-ab
#	patches/patch-ac
#	patches/patch-ad
#	patches/patch-ae
#	patches/patch-ag
#	patches/patch-ah
#	patches/patch-aj
#	patches/patch-ak
#	patches/patch-al
#	pkg
#	pkg/DESCR
#	pkg/INSTALL
#	pkg/PLIST
#	pkg/REQUIRE
#
echo x - Makefile
sed 's/^X//' >Makefile << 'END-of-Makefile'
X# $NetBSD: Makefile,v 1.46 2001/05/01 18:07:48 wennmach Exp $
X
XDISTNAME=	squid-2.4.STABLE1-src
XPKGNAME=	squid-2.4.1
XCATEGORIES=	www
XMASTER_SITES=	http://www.squid-cache.org/Versions/v2/2.4/ \
X		ftp://ftp.leo.org/pub/comp/general/infosys/www/daemons/squid/squid-2/STABLE/ \
X		ftp://ftp1.au.squid-cache.org/pub/squid/squid-2/STABLE/
X
XPATCH_SITES=	http://www.squid-cache.org/Versions/v2/2.4/bugs/
XPATCHFILES=	squid-2.4.stable1-diskd_fixed_path.patch \
X		squid-2.4.stable1-force_valid_blksize.patch \
X		squid-2.4.stable1-high_cpu_with_peers.patch \
X		squid-2.4.stable1-htcp_assertion_fix.patch \
X		squid-2.4.stable1-kill_parent_on_child_sigkill.patch \
X		squid-2.4.stable1-wrong_sign_on_timestamp_check.patch
X
XMAINTAINER=	tron@netbsd.org
XHOMEPAGE=	http://www.squid-cache.org/
XCOMMENT=	Post-Harvest_cached WWW proxy cache and accelerator
X
XBUILD_DEPENDS+=	perl>=${PERL5_REQD}:../../lang/perl5
X
X###BUILD_DEPENDS+=	autoconf:../../devel/autoconf
X
XGNU_CONFIGURE=	yes
X
X.include "../../mk/bsd.prefs.mk"
X
XWRKSRC=		${WRKDIR}/${DISTNAME:S/-src//}
X
X# Configuration options which can be overwritten by the user.
X#
XSQUID_CONFIGURE_ARGS?=	--enable-cachemgr-hostname=localhost \
X			--enable-icmp \
X			--enable-ipf-transparent \
X			--enable-snmp
X
X# Note all of the following can all be changed at runtime too...
X#
XSQUID_CONF_DIR?=	${LOCALBASE}/etc
XSQUID_LOG_DIR?=		/var/log/squid
XSQUID_ERR_LANG?=	English
XSQUID_HTTP_PORT?=	3128
XSQUID_ICP_PORT?=	3130
XSQUID_USER?=		wwwcache
XSQUID_GROUP?=		wwwcache
X
XCONFIGURE_ARGS+=	--sysconfdir=${SQUID_CONF_DIR}
XCONFIGURE_ARGS+=	--localstatedir=${SQUID_LOG_DIR}
XCONFIGURE_ARGS+=	--enable-err-language=${SQUID_ERR_LANG}
XCONFIGURE_ARGS+=	--enable-kill-parent-hack
XCONFIGURE_ARGS+=	${SQUID_CONFIGURE_ARGS}
X
XCONFIGURE_ENV+=	CACHE_HTTP_PORT=${SQUID_HTTP_PORT} \
X		CACHE_ICP_PORT=${SQUID_ICP_PORT} \
X		PERL=${PERL5}
X
XBUILD_DEFS+=	SQUID_CONFIGURE_ARGS SQUID_HTTP_PORT SQUID_ICP_PORT
XMAKEFILE=	makefile
XMAKE_ENV+=	INSTALL_SCRIPT="${INSTALL_SCRIPT}" PKG_PREFIX="${PREFIX}"
X
X.if ${OPSYS} == "SunOS"
XDEPENDS+=	egcs-1.1.2:../../lang/egcs
XMAKE_ENV+=	CPPFLAGS= CFLAGS=
X.endif
X
X.if ${CONFIGURE_ARGS:M--enable-ipf-transparent} == "--enable-ipf-transparent"
XSQUID_USES_IPNAT=	YES
X.else
XSQUID_USES_IPNAT=	NO
X.endif
X
X# NOTE: this variable name is magic
XPLIST_SRC=	${PKGDIR}/PLIST ${WRKDIR}/.PLIST.share
X# NOTE: this variable name is magic
XINSTALL_FILE=	${WRKDIR}/.INSTALL
X# NOTE: this variable name is magic
XREQUIRE_FILE=	${WRKDIR}/.REQUIRE
X
XSTARTUP_FILE=	${WRKDIR}/.squid.sh
X
XSED_EXPR=	-e 's|@SQUID_USER@|${SQUID_USER}|g'			\
X		-e 's|@SQUID_GROUP@|${SQUID_GROUP}|g'			\
X		-e 's|@SQUID_CONF_DIR@|${SQUID_CONF_DIR}|g'		\
X		-e 's|@SQUID_LOG_DIR@|${SQUID_LOG_DIR}|g'		\
X		-e 's|@SQUID_USES_IPNAT@|${SQUID_USES_IPNAT}|g'		\
X		-e 's|@DEFCONF@|${PREFIX}/share/squid/squid.conf.default|g' \
X		-e 's|@PREFIX@|${PREFIX}|g'
X
Xpost-patch:
X	${SED} ${SED_EXPR} ${PKGDIR}/INSTALL > ${INSTALL_FILE}
X	${SED} ${SED_EXPR} ${PKGDIR}/REQUIRE > ${REQUIRE_FILE}
X	${SED} ${SED_EXPR} ${FILESDIR}/squid.sh > ${STARTUP_FILE}
X
X###pre-configure:
X###	(cd ${WRKSRC}; autoreconf --force)
X
X# this hack helps us avoid patching configure.in and include/autoconf.h.in
X#
Xpost-configure:
X	@echo "Fixing generated ${WRKSRC}/include/autoconf.h ..."
X	@cd ${WRKSRC}/include && \
X	${MV} autoconf.h autoconf.h.prepatch && \
X	${SED} -e 's%#define fd_mask int%/* #undef fd_mask */%' \
X		< autoconf.h.prepatch > autoconf.h
X
X# for some reason the configure script doesn't allow these to be set....
X#
Xpre-build:
X	mv ${WRKSRC}/src/cf.data.pre ${WRKSRC}/src/cf.data.pre.bak
X	sed -e 's|nobody|${SQUID_USER}|g' 				\
X	    -e 's|nogroup|${SQUID_GROUP}|g' 				\
X	  < ${WRKSRC}/src/cf.data.pre.bak > ${WRKSRC}/src/cf.data.pre
X
X# NOTE: we can't define this in terms of a dependency on ${PLIST_SRC}
X# because the variables used are not defined until too late....
X#
Xpost-build:
X	@-rm -f ${WRKDIR}/.PLIST.share
X	@echo "Creating ${WRKDIR}/.PLIST.share ..."
X	@(								\
X		cd ${WRKSRC}/errors/English;				\
X		ls ERR_* | ${SED} -e 's@^@share/squid/errors/@';	\
X		${ECHO} "@dirrm share/squid/errors";			\
X		cd ${WRKSRC}/icons;					\
X		ls anthony-*.gif | ${SED} -e 's@^@share/squid/icons/@';	\
X		${ECHO} "@dirrm share/squid/icons";			\
X		${ECHO} "share/squid/mib.txt";				\
X		${ECHO} "share/examples/squid-mime.conf";		\
X		${ECHO} "share/examples/squid.conf";			\
X		${ECHO} "@dirrm share/squid";				\
X	) > ${WRKDIR}/.PLIST.share
X
Xpre-install:
X	@${INSTALL_DATA_DIR} ${PREFIX}/share/squid
X	@${INSTALL_DATA_DIR} ${PREFIX}/share/squid/errors
X	@${INSTALL_DATA_DIR} ${PREFIX}/share/squid/icons
X	@${SETENV} ${MAKE_ENV} ${SH} ${REQUIRE_FILE} ${PKGNAME} INSTALL
X	@${SETENV} ${MAKE_ENV} ${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL
X
Xpost-install:
X	${INSTALL_DATA_DIR} /var/squid
X	${INSTALL} -d -o ${SQUID_USER} -g ${SQUID_GROUP} /var/log/squid
X	cd ${WRKSRC}/src; ${MAKE} install-pinger
X	${INSTALL_SCRIPT} ${STARTUP_FILE} ${PREFIX}/etc/rc.d/squid
X	@${SETENV} ${MAKE_ENV} ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL
X
X.include "../../mk/bsd.pkg.mk"
END-of-Makefile
echo x - distinfo
sed 's/^X//' >distinfo << 'END-of-distinfo'
X$NetBSD: distinfo,v 1.3 2001/05/21 05:27:58 tron Exp $
X
XSHA1 (squid-2.4.STABLE1-src.tar.gz) = 584eb15080f52ef406e3f66511dba406ec1a40c5
XSize (squid-2.4.STABLE1-src.tar.gz) = 1071386 bytes
XSHA1 (squid-2.4.stable1-diskd_fixed_path.patch) = 1ec289b37d0640a8d16e691659acc3776632b321
XSize (squid-2.4.stable1-diskd_fixed_path.patch) = 3321 bytes
XSHA1 (squid-2.4.stable1-force_valid_blksize.patch) = 1282c7cb5b7e367f04867b9658e002dd51f00313
XSize (squid-2.4.stable1-force_valid_blksize.patch) = 975 bytes
XSHA1 (squid-2.4.stable1-high_cpu_with_peers.patch) = 759f713faad31d13a3492ae814b2cdcba0f5fbe4
XSize (squid-2.4.stable1-high_cpu_with_peers.patch) = 710 bytes
XSHA1 (squid-2.4.stable1-htcp_assertion_fix.patch) = afdbe390453cc65b375c6616be583ee84299260b
XSize (squid-2.4.stable1-htcp_assertion_fix.patch) = 1314 bytes
XSHA1 (squid-2.4.stable1-kill_parent_on_child_sigkill.patch) = c94ba4c220d31ea1612e5b1a84970de2c058f7a9
XSize (squid-2.4.stable1-kill_parent_on_child_sigkill.patch) = 666 bytes
XSHA1 (squid-2.4.stable1-wrong_sign_on_timestamp_check.patch) = cde4530d0c9cd184b0d4c6774e4c20f81ab7179f
XSize (squid-2.4.stable1-wrong_sign_on_timestamp_check.patch) = 936 bytes
XSHA1 (patch-NetBSD) = da39a3ee5e6b4b0d3255bfef95601890afd80709
XSHA1 (patch-aa) = c4f8f87e9c3f61822ccebf89db60ca8937033dfd
XSHA1 (patch-ab) = afb0c443c708d03fc7ab39120ae9a3c68d9e9b88
XSHA1 (patch-ac) = c7b045437bb00711ef9c792a60420fae4cf21dde
XSHA1 (patch-ad) = 03f76c2a781bff4b3a8680ee815f8c5dcbdd70d0
XSHA1 (patch-ae) = 5189de99c6f453ef58b97a4df54c065c87cf7e21
XSHA1 (patch-ah) = 71c75196b88575ae876f994956afe927b98f598a
XSHA1 (patch-aj) = c50f9474870c0ada822db2345a05dc1d81192cd3
XSHA1 (patch-ak) = a3f3000dbab7ba6f08904008ccf9e08bc70b3e3f
XSHA1 (patch-al) = 83198acc0accb358075500d4b71486b3f401c449
END-of-distinfo
echo c - files
mkdir -p files > /dev/null 2>&1
echo x - files/squid.sh
sed 's/^X//' >files/squid.sh << 'END-of-files/squid.sh'
X#! /bin/sh
X#
X# $NetBSD: squid.sh,v 1.8 2001/05/10 21:58:02 tron Exp $
X#
X
X# PROVIDE: squid
X# REQUIRE: DAEMON
X# KEYWORD: shutdown
X
XSQUID_CONF_DIR="@SQUID_CONF_DIR@"
XSQUID_LOG_DIR="@SQUID_LOG_DIR@"
X
Xconf_file="${SQUID_CONF_DIR}/squid.conf"
X
Xname="squid"
Xcommand="@PREFIX@/sbin/${name}"
Xpidfile="/var/run/${name}.pid"
Xrequired_files="${conf_file} ${SQUID_CONF_DIR}/squid-mime.conf"
X
Xstart_cmd="@PREFIX@/sbin/RunCache ${conf_file} &"
Xstop_cmd="stop_nicely"
Xkill_command="${command} -k shutdown"
Xreload_cmd="${command} -k reconfigure"
X
X#### end of configuration section ####
X
X# XXX Shouldn't the default stop_cmd be this patient too?
X#
Xstop_nicely ()
X{
X	if [ -f ${pidfile} ] ; then
X		DAEMON_PID=`sed 1q ${pidfile}`
X		echo -n "Stopping ${name}"
X		${kill_command}
X		if [ ${DAEMON_PID} -ne 0 ]; then
X			echo -n '['
X			while kill -0 ${DAEMON_PID} >/dev/null 2>&1; do
X				sleep 2
X				echo -n '.'
X			done
X			echo ']  Stopped.'
X		fi
X	fi
X}
X
Xif [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ] ; then	# i.e. is this NetBSD's weird startup?
X
X	. /etc/rc.subr
X	. /etc/rc.conf
X
X	start_precmd="checkyesno squid"
X	stop_precmd=${start_precmd}
X	reload_precmd=${start_precmd}
X	extra_commands="reload"
X
X	if type load_rc_config > /dev/null 2>&1 ; then
X		load_rc_config $name
X	fi
X	run_rc_command "$1"
X
Xelse				# old NetBSD, Solaris, Linux, etc...
X
X	case $1 in
X	start)
X		if [ -x ${command} -a -f ${conf_file} ] ; then
X			eval ${start_cmd} && echo -n " ${name}"
X		fi
X		;;
X	stop)
X		${stop_cmd}
X		;;
X	reload)
X		if [ -f ${pidfile} ] ; then
X			${reload_cmd}
X		fi
X		;;
X	*)
X		echo "Usage: $0 {start|stop|reload}" 1>&2
X		exit 64
X		;;
X	esac
X
Xfi
END-of-files/squid.sh
echo c - patches
mkdir -p patches > /dev/null 2>&1
echo x - patches/patch-aa
sed 's/^X//' >patches/patch-aa << 'END-of-patches/patch-aa'
X+++ src/Makefile.in	Mon Jun 11 17:36:47 2001
X@@ -12,6 +12,8 @@
X cgi_suffix	= @cgi_suffix@
X top_srcdir	= @top_srcdir@
X bindir		= @bindir@
X+sbindir		= @sbindir@
X+datadir		= @datadir@
X libexecdir      = @libexecdir@
X sysconfdir	= @sysconfdir@
X localstatedir   = @localstatedir@
X@@ -35,19 +37,19 @@
X 
X DEFAULT_PREFIX		= $(prefix)
X DEFAULT_CONFIG_FILE     = $(sysconfdir)/squid.conf
X-DEFAULT_MIME_TABLE	= $(sysconfdir)/mime.conf
X+DEFAULT_MIME_TABLE	= $(sysconfdir)/squid-mime.conf
X DEFAULT_DNSSERVER       = $(libexecdir)/$(DNSSERVER_EXE)
X-DEFAULT_CACHE_LOG       = $(localstatedir)/logs/cache.log
X-DEFAULT_ACCESS_LOG      = $(localstatedir)/logs/access.log
X-DEFAULT_STORE_LOG       = $(localstatedir)/logs/store.log
X-DEFAULT_PID_FILE        = $(localstatedir)/logs/squid.pid
X-DEFAULT_SWAP_DIR        = $(localstatedir)/cache
X+DEFAULT_CACHE_LOG       = $(localstatedir)/cache
X+DEFAULT_ACCESS_LOG      = $(localstatedir)/access
X+DEFAULT_STORE_LOG       = $(localstatedir)/store
X+DEFAULT_PID_FILE        = /var/run/squid.pid
X+DEFAULT_SWAP_DIR        = /var/squid
X DEFAULT_PINGER		= $(libexecdir)/$(PINGER_EXE)
X DEFAULT_UNLINKD		= $(libexecdir)/$(UNLINKD_EXE)
X DEFAULT_DISKD		= $(libexecdir)/$(DISKD_EXE)
X-DEFAULT_ICON_DIR	= $(sysconfdir)/icons
X-DEFAULT_ERROR_DIR	= $(sysconfdir)/errors
X-DEFAULT_MIB_PATH	= $(sysconfdir)/mib.txt
X+DEFAULT_ICON_DIR	= $(datadir)/squid/icons
X+DEFAULT_ERROR_DIR	= $(datadir)/squid/errors
X+DEFAULT_MIB_PATH	= $(datadir)/squid/mib.txt
X 
X CC		= @CC@
X MAKEDEPEND	= @MAKEDEPEND@
X@@ -310,9 +312,9 @@
X 		echo "mkdir $(exec_prefix)"; \
X 		mkdir -p $(exec_prefix); \
X 	fi
X-	-@if test ! -d $(bindir); then \
X-		echo "mkdir $(bindir)"; \
X-		mkdir -p $(bindir); \
X+	-@if test ! -d $(sbindir); then \
X+		echo "mkdir $(sbindir)"; \
X+		mkdir -p $(sbindir); \
X 	fi
X 	-@if test ! -d $(libexecdir); then \
X 		echo "mkdir $(libexecdir)"; \
X@@ -322,14 +324,6 @@
X 		echo "mkdir $(sysconfdir)"; \
X 		mkdir -p $(sysconfdir); \
X 	fi
X-	-@if test ! -d $(localstatedir); then \
X-		echo "mkdir $(localstatedir)"; \
X-		mkdir -p $(localstatedir); \
X-	fi
X-	-@if test ! -d $(localstatedir)/logs; then \
X-		echo "mkdir $(localstatedir)/logs"; \
X-		mkdir -p $(localstatedir)/logs; \
X-	fi
X 
X # Michael Lupp <mike@nemesis.saar.de> wants to know about additions
X # to the install target.
X@@ -339,15 +333,15 @@
X 		(cd $$dir ; $(MAKE) $(MFLAGS) prefix="$(prefix)" $@) || exit 1; \
X 	done
X 	@for f in $(PROGS); do \
X-		if test -f $(bindir)/$$f; then \
X-			echo $(MV) $(bindir)/$$f $(bindir)/-$$f; \
X-			$(MV) $(bindir)/$$f $(bindir)/-$$f; \
X+		if test -f $(sbindir)/$$f; then \
X+			echo $(MV) $(sbindir)/$$f $(sbindir)/-$$f; \
X+			$(MV) $(sbindir)/$$f $(sbindir)/-$$f; \
X 		fi; \
X-		echo $(INSTALL_BIN) $$f $(bindir); \
X-		$(INSTALL_BIN) $$f $(bindir); \
X-		if test -f $(bindir)/-$$f; then \
X-			echo $(RM) -f $(bindir)/-$$f; \
X-			$(RM) -f $(bindir)/-$$f; \
X+		echo $(INSTALL_BIN) $$f $(sbindir); \
X+		$(INSTALL_BIN) $$f $(sbindir); \
X+		if test -f $(sbindir)/-$$f; then \
X+			echo $(RM) -f $(sbindir)/-$$f; \
X+			$(RM) -f $(sbindir)/-$$f; \
X 		fi; \
X 	done
X 	@if test -n "$(UTILS)"; then \
X@@ -377,21 +371,8 @@
X 		fi; \
X 	done
X 	$(INSTALL_FILE) $(srcdir)/mib.txt $(DEFAULT_MIB_PATH)
X-	$(INSTALL_FILE) squid.conf $(sysconfdir)/squid.conf.default
X-	@if test -f $(sysconfdir)/squid.conf ; then \
X-		echo "$@ will not overwrite existing $(sysconfdir)/squid.conf" ; \
X-	else \
X-		echo "$(INSTALL_FILE) squid.conf $(sysconfdir)"; \
X-		$(INSTALL_FILE) squid.conf $(sysconfdir); \
X-	fi
X-
X-	$(INSTALL_FILE) $(srcdir)/mime.conf $(sysconfdir)/mime.conf.default
X-	@if test -f $(sysconfdir)/mime.conf ; then \
X-		echo "$@ will not overwrite existing $(sysconfdir)/mime.conf" ; \
X-	else \
X-		echo "$(INSTALL_FILE) $(srcdir)/mime.conf $(sysconfdir)"; \
X-		$(INSTALL_FILE) $(srcdir)/mime.conf $(sysconfdir); \
X-	fi
X+	$(INSTALL_FILE) squid.conf $(datadir)/examples/squid.conf
X+	$(INSTALL_FILE) $(srcdir)/mime.conf $(datadir)/examples/squid-mime.conf
X 
X install-pinger:
X 	@f=$(PINGER_EXE); \
END-of-patches/patch-aa
echo x - patches/patch-ab
sed 's/^X//' >patches/patch-ab << 'END-of-patches/patch-ab'
X$NetBSD: patch-ab,v 1.5 2001/05/01 18:07:49 wennmach Exp $
X
X+++ scripts/Makefile.in	Sat Apr 14 11:46:07 2001
X@@ -7,6 +7,7 @@
X exec_prefix     = @exec_prefix@
X top_srcdir      = @top_srcdir@
X bindir          = @bindir@
X+sbindir         = @sbindir@
X sysconfdir      = @sysconfdir@
X srcdir          = @srcdir@
X VPATH           = @srcdir@
X@@ -25,12 +26,12 @@
X 		echo "mkdir $(exec_prefix)"; \
X 		mkdir -p $(exec_prefix); \
X 	fi
X-	@if test ! -d $(bindir); then \
X-		echo "mkdir $(bindir)"; \
X-		mkdir -p $(bindir); \
X+	@if test ! -d $(sbindir); then \
X+		echo "mkdir $(sbindir)"; \
X+		mkdir -p $(sbindir); \
X 	fi
X-	$(INSTALL_BIN) RunCache $(bindir)
X-	$(INSTALL_BIN) RunAccel $(bindir)
X+	$(INSTALL_SCRIPT) RunCache $(sbindir)
X+	$(INSTALL_SCRIPT) RunAccel $(sbindir)
X 
X clean:
X 
END-of-patches/patch-ab
echo x - patches/patch-ac
sed 's/^X//' >patches/patch-ac << 'END-of-patches/patch-ac'
X$NetBSD: patch-ac,v 1.4 1999/05/02 12:49:43 tron Exp $
X
X+++ scripts/RunCache.in	Thu Nov 25 12:42:14 1999
X@@ -5,9 +5,11 @@
X prefix=@prefix@
X exec_prefix=@exec_prefix@
X logdir=@localstatedir@
X+PATH=@sbindir@:/bin:/usr/bin
X export PATH
X 
X+progname=`basename $0`
X+
X conf=""
X if test "$1" ; then
X 	conf="-f $1"
X@@ -16,8 +18,8 @@
X 
X failcount=0
X while : ; do
X+	logger -p daemon.notice -t squid "$progname: Running: squid -NsY $conf"
X+	echo "`date` $progname: Running: squid -NsY $conf" >> $logdir/squid.out
X 	start=`date '+%d%H%M%S'`
X 	squid -NsY $conf >> $logdir/squid.out 2>&1
X 	stop=`date '+%d%H%M%S'`
X@@ -28,7 +30,8 @@
X 		failcount=0
X 	fi
X 	if test $failcount -gt 5 ; then
X+		logger -s -p daemon.alert -t squid "RunCache: EXITING DUE TO REPEATED, FREQUENT FAILURES"
X+		echo "`date` $progname: EXITING DUE TO REPEATED, FREQUENT FAILURES" >> $logdir/squid.out
X 		exit 1
X 	fi
X 	sleep 10
END-of-patches/patch-ac
echo x - patches/patch-ad
sed 's/^X//' >patches/patch-ad << 'END-of-patches/patch-ad'
X$NetBSD: patch-ad,v 1.3 1998/12/06 12:42:00 tron Exp $
X
X+++ errors/Makefile.in	Thu Oct  1 16:25:32 1998
X@@ -4,6 +4,7 @@
X exec_prefix	= @exec_prefix@
X top_srcdir	= @top_srcdir@
X bindir		= @bindir@
X+datadir		= @datadir@
X libexecdir      = @libexecdir@
X sysconfdir	= @sysconfdir@
X localstatedir   = @localstatedir@
X@@ -15,7 +16,7 @@
X 
X INSTALL         	= @INSTALL@
X INSTALL_FILE    	= @INSTALL_DATA@
X-DEFAULT_ERROR_DIR	= $(sysconfdir)/errors
X+DEFAULT_ERROR_DIR	= $(datadir)/squid/errors
X 
X LANGUAGE		= @ERR_LANGUAGE@
X 
END-of-patches/patch-ad
echo x - patches/patch-ae
sed 's/^X//' >patches/patch-ae << 'END-of-patches/patch-ae'
X$NetBSD: patch-ae,v 1.4 1999/11/12 16:25:30 rh Exp $
X
X+++ icons/Makefile.in	Fri Nov 12 17:20:06 1999
X@@ -4,6 +4,7 @@
X exec_prefix	= @exec_prefix@
X top_srcdir	= @top_srcdir@
X bindir		= @bindir@
X+datadir		= @datadir@
X libexecdir      = @libexecdir@
X sysconfdir	= @sysconfdir@
X localstatedir   = @localstatedir@
X@@ -15,7 +16,7 @@
X 
X INSTALL         	= @INSTALL@
X INSTALL_FILE    	= @INSTALL_DATA@
X-DEFAULT_ICON_DIR        = $(sysconfdir)/icons
X+DEFAULT_ICON_DIR        = $(datadir)/squid/icons
X 
X ICONS		= anthony-binhex.gif \
X 		  anthony-bomb.gif \
END-of-patches/patch-ae
echo x - patches/patch-ag
sed 's/^X//' >patches/patch-ag << 'END-of-patches/patch-ag'
X$NetBSD: patch-ag,v 1.8 2001/04/14 10:05:01 tron Exp $
X
X+++ configure	Sat Apr 14 11:49:08 2001
X@@ -711,11 +711,11 @@
X REGEXLIB=''	# -lregex
X LIBREGEX=''	# libregex.a
X 
X-if test "$libexecdir" = '${exec_prefix}/libexec' &&
X-   test "$localstatedir" = '${prefix}/var'; then
X-	libexecdir='${prefix}/libexec/squid'
X-	localstatedir='${prefix}'
X-fi
X+#if test "$libexecdir" = '${exec_prefix}/libexec' &&
X+#   test "$localstatedir" = '${prefix}/var'; then
X+#	libexecdir='${prefix}/libexec/squid'
X+#	localstatedir='${prefix}'
X+#fi
X 
X case "$host_os" in
X cygwin|cygwin32|os2)
X@@ -1428,7 +1428,7 @@
X #define SQUID_SNMP 1
X EOF
X 
X-    SNMPLIB='-L../snmplib -lsnmp'
X+    SNMPLIB='../snmplib/libsnmp.a'
X     SNMP_OBJS='$(SNMP_OBJS)'
X     SNMP_MAKEFILE=./snmplib/Makefile
X     makesnmplib=snmplib
END-of-patches/patch-ag
echo x - patches/patch-ah
sed 's/^X//' >patches/patch-ah << 'END-of-patches/patch-ah'
X$NetBSD: patch-ah,v 1.1 1998/12/06 12:43:23 tron Exp $
X
X+++ scripts/RunAccel.in	Tue Jun  1 14:28:48 1999
X@@ -8,9 +8,12 @@
X prefix=@prefix@
X exec_prefix=@exec_prefix@
X logdir=@localstatedir@
X+PATH=@sbindir@:/bin:/usr/bin
X export PATH
X 
X+progname=`basename $0`
X+
X+conf=""
X if test $# = 1 ; then
X 	conf="-f $1"
X 	shift
X@@ -18,9 +21,10 @@
X 
X failcount=0
X while : ; do
X+	logger -p daemon.notice -t squid "$progname: Running: squid -Ns $port $conf"
X+	echo "`date` $progname: Running: squid -Ns $port $conf" >> $logdir/squid.out
X 	start=`date '+%d%H%M%S'`
X-	squid -N $port -s $conf >> $logdir/squid.out 2>&1
X+	squid -N $port $conf >> $logdir/squid.out 2>&1
X 	stop=`date '+%d%H%M%S'`
X 	t=`expr $stop - $start`
X 	if test 0 -le $t -a $t -lt 5 ; then
X@@ -29,7 +33,8 @@
X 		failcount=0
X 	fi
X 	if test $failcount -gt 5 ; then
X+		logger -s -p daemon.alert -t squid "$progname: EXITING DUE TO REPEATED, FREQUENT FAILURES"
X+		echo "`date` $progname: EXITING DUE TO REPEATED, FREQUENT FAILURES" >> $logdir/squid.out
X 		exit 1
X 	fi
X 	sleep 10
END-of-patches/patch-ah
echo x - patches/patch-aj
sed 's/^X//' >patches/patch-aj << 'END-of-patches/patch-aj'
X$NetBSD: patch-aj,v 1.4 2000/11/02 10:41:45 jdolecek Exp $
X
X+++ src/access_log.c	Thu Nov  2 11:06:28 2000
X@@ -122,6 +122,8 @@ log_quote(const char *header)
X {
X     int c;
X     int i;
X+    int log_all, check_name, log_this;
X+    const struct _wordlist *wl;
X     char *buf;
X     char *buf_cursor;
X     if (header == NULL) {
X@@ -131,13 +133,41 @@ log_quote(const char *header)
X     }
X     buf = xcalloc((strlen(header) * 3) + 1, 1);
X     buf_cursor = buf;
X+
X+    /* if empty or first keyword is "all", log all mime headers */
X+    log_all = (!Config.log_mime_hdrs_list
X+		|| strcasecmp(Config.log_mime_hdrs_list->key, "all") == 0);
X+
X     /*
X      * We escape: \x00-\x1F"#%;<>?{}|\\\\^~`\[\]\x7F-\xFF 
X      * which is the default escape list for the CPAN Perl5 URI module
X      * modulo the inclusion of space (x40) to make the raw logs a bit
X      * more readable.
X      */
X-    while ((c = *(const unsigned char *) header++) != '\0') {
X+    check_name = 1;
X+    log_this = 1;
X+    for(; (c = *(const unsigned char *) header) != '\0'; header++) {
X+	if (!log_all && check_name) {
X+		/* loop over configured header names and only continue
X+		 * if the current header is on the list */
X+		wl = Config.log_mime_hdrs_list;
X+		log_this = 0;
X+		for(; wl; wl = wl->next) {
X+			if (strncasecmp(wl->key, header, strlen(wl->key)) == 0){
X+				log_this = 1;
X+				break;
X+			}
X+		}
X+		check_name = 0;
X+	}
X+	if (!log_this) {
X+		if (c == '\n') {
X+			/* check header name in next iteration */
X+			check_name = 1;
X+		}
X+		continue;
X+	}
X+ 
X #if !OLD_LOG_MIME
X 	if (c == '\r') {
X 	    *buf_cursor++ = '\\';
X@@ -145,6 +175,7 @@ log_quote(const char *header)
X 	} else if (c == '\n') {
X 	    *buf_cursor++ = '\\';
X 	    *buf_cursor++ = 'n';
X+	    check_name = 1;
X 	} else
X #endif
X 	    if (c <= 0x1F
END-of-patches/patch-aj
echo x - patches/patch-ak
sed 's/^X//' >patches/patch-ak << 'END-of-patches/patch-ak'
X$NetBSD: patch-ak,v 1.5 2001/04/14 10:05:01 tron Exp $
X
X+++ src/cf.data.pre	Sat Apr 14 11:56:42 2001
X@@ -858,6 +858,23 @@
X DOC_END
X 
X 
X+NAME: log_mime_hdrs_list
X+TYPE: wordlist
X+LOC: Config.log_mime_hdrs_list
X+DEFAULT: none
X+DOC_START
X+	The Cache can record both the request and the response MIME
X+	headers for each HTTP transaction.  The headers are encoded
X+	safely and will appear as two bracketed fields at the end of
X+	the access log (for either the native or httpd-emulated log
X+	formats). This list specifies which headers should be passed.
X+	Note header logging need to be enabled by 'log_mime_hdrs on'
X+	first.
X+
X+log_mime_hdrs_list all
X+DOC_END
X+
X+
X NAME: useragent_log
X TYPE: string
X LOC: Config.Log.useragent
END-of-patches/patch-ak
echo x - patches/patch-al
sed 's/^X//' >patches/patch-al << 'END-of-patches/patch-al'
X$NetBSD: patch-al,v 1.2 2000/11/02 10:41:45 jdolecek Exp $
X
X+++ src/structs.h	Thu Nov  2 09:52:03 2000
X@@ -359,6 +359,7 @@ struct _SquidConfig {
X     wordlist *mcast_group_list;
X     wordlist *dns_testname_list;
X     wordlist *dns_nameservers;
X+    wordlist *log_mime_hdrs_list;
X     peer *peers;
X     int npeers;
X     struct {
END-of-patches/patch-al
echo c - pkg
mkdir -p pkg > /dev/null 2>&1
echo x - pkg/DESCR
sed 's/^X//' >pkg/DESCR << 'END-of-pkg/DESCR'
XThis is the Squid Internet Object Cache developed by the National
XLaboratory for Applied Networking Research (NLANR) and Internet
Xvolunteers.  This software is freely available for anyone to use.
X
XThis software is based on the Harvest Object Cache developed by
Xthe University of Colorado and the University of Southern California.
XThe Harvest home page is http://harvest.cs.colorado.edu/.
X
XARPA funding for the Harvest project has ended, the squid project has
Xcontinued development of the cache where Harvest finished.
X
XPORTER'S NOTES. To this moment, Squid is not well documented.
XBut you aren't lost in space: there is a mailing list,
X<squid-users@nlanr.net>, where you will find some support and help.
XWe also _strongly_ suggest you to examine Web pages noted above.
END-of-pkg/DESCR
echo x - pkg/INSTALL
sed 's/^X//' >pkg/INSTALL << 'END-of-pkg/INSTALL'
X#! /bin/sh
X#
X# $NetBSD: INSTALL,v 1.4 1999/01/29 19:26:37 bad Exp $
X
XPKGNAME=$1
XDEFCONF=${PKG_PREFIX}/share/examples/squid.conf
XDEFMIME=${PKG_PREFIX}/share/examples/squid-mime.conf
X
Xcase $2 in
XPRE-INSTALL)
X	;;
XPOST-INSTALL)
X	# XXX this script could safely install the default configs if
X	# they don't yet exist.
X	#
X	echo ""
X	echo " o You must have running DNS name servers to start and run ${PKGNAME}!"
X	echo ""
X	echo " o Copy ${DEFMIME} to ${PKG_PREFIX}/etc/squid-mime.conf"
X	echo "   and edit it as required.  You should pay particular attention to"
X	echo "   the setting for 'cache_dir'."
X	echo ""
X	echo " o Copy ${DEFCONF} to ${PKG_PREFIX}/etc/squid.conf"
X	echo "   and edit it if necessary."
X	echo ""
X	echo " o Check the ownership and permissions for the 'cache_dir' and the"
X	echo "   log directory @SQUID_LOG_DIR@."
X	echo "   They must both be writable by @SQUID_USER@ (or the user you set"
X	echo "   'cache_effective_user' to)."
X	echo ""
X	;;
X*)
X	echo "Unexpected Argument $2!!"
X	exit 1
X	;;
Xesac
Xexit 0
END-of-pkg/INSTALL
echo x - pkg/PLIST
sed 's/^X//' >pkg/PLIST << 'END-of-pkg/PLIST'
X@comment $NetBSD: PLIST,v 1.5 2001/04/14 10:05:02 tron Exp $
Xetc/rc.d/squid
Xlibexec/cachemgr.cgi
Xlibexec/pinger
Xlibexec/unlinkd
Xlibexec/diskd
Xsbin/RunAccel
Xsbin/RunCache
Xsbin/client
Xsbin/squid
END-of-pkg/PLIST
echo x - pkg/REQUIRE
sed 's/^X//' >pkg/REQUIRE << 'END-of-pkg/REQUIRE'
X#! /bin/sh
X#
X#	Squid package REQUIRE script
X#
X#ident	"@(#)$NetBSD$"
X
XSQUID_USER=@SQUID_USER@
XSQUID_GROUP=@SQUID_GROUP@
X
XPKG=$1
XSTAGE=$2
X
X# pkg_delete also calls this script...
Xif [ "$STAGE" != "INSTALL" ]; then
X	exit 0
Xfi
X
X# Group... the default should be shipped with NetBSD
X# XXX but if changed from default this won't go through NIS et al
X#
Xif grep "^${SQUID_GROUP}:" /etc/group 2>&1 >/dev/null ; then
X	echo "Group '${SQUID_GROUP}' already exists, proceeding."
Xelse
X	echo "ERROR: Please add group '${SQUID_GROUP}' to /etc/group, then retry ${PKG} install." 1>&2
X	exit 1
Xfi
X
X# use finger to be able to use NIS et al...
Xif finger ${SQUID_USER} 2>&1 | grep >/dev/null "no such user" ; then
X	echo "ERROR: Please add user '${SQUID_USER}' using 'useradd' or 'vipw', then retry ${PKG} install." 1>&2
X	exit 1
Xfi
X
Xexit 0
END-of-pkg/REQUIRE
exit

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