summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@pkgsrc.org>2001-07-29 16:41:18 +0000
committertron <tron@pkgsrc.org>2001-07-29 16:41:18 +0000
commit40cda954165b4a3171dc68d6e722c2b1645368e9 (patch)
treef4a7d424b88e5ae4ebeb2523719c6e2164752c6a
parent948627b2d2ccbc6e45f0e802722601a4386d2e78 (diff)
downloadpkgsrc-40cda954165b4a3171dc68d6e722c2b1645368e9.tar.gz
- Apply some of the changes suggested by Greg A. Woods in PR 13427 and
include his improved "rc.d" script. - Use the same directory structure as in the Apache package. The configuration files are now in "${PREFIX}/etc/squid" and won't be removed during deinstallation. - Remove unnecessary configuration variables "SQUID_HTTP_PORT" and "SQUID_ICP_PORT". These values can perfectly be adjusted by editing the configuration file and supporting all these variables would make the package too complex. - Bump the version number to 2.4.1nb1.
-rw-r--r--www/squid/Makefile29
-rw-r--r--www/squid/distinfo4
-rw-r--r--www/squid/files/squid.sh85
-rw-r--r--www/squid/patches/patch-aa37
-rw-r--r--www/squid/pkg/INSTALL20
-rw-r--r--www/squid/pkg/PLIST5
6 files changed, 111 insertions, 69 deletions
diff --git a/www/squid/Makefile b/www/squid/Makefile
index c7114fe95d1..d77cea90df7 100644
--- a/www/squid/Makefile
+++ b/www/squid/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.46 2001/05/01 18:07:48 wennmach Exp $
+# $NetBSD: Makefile,v 1.47 2001/07/29 16:41:18 tron Exp $
DISTNAME= squid-2.4.STABLE1-src
-PKGNAME= squid-2.4.1
+PKGNAME= squid-2.4.1nb1
CATEGORIES= www
MASTER_SITES= http://www.squid-cache.org/Versions/v2/2.4/ \
ftp://ftp.leo.org/pub/comp/general/infosys/www/daemons/squid/squid-2/STABLE/ \
@@ -22,17 +22,15 @@ COMMENT= Post-Harvest_cached WWW proxy cache and accelerator
BUILD_DEPENDS+= perl>=${PERL5_REQD}:../../lang/perl5
GNU_CONFIGURE= # defined
-CONFIGURE_ARGS+= --sysconfdir=/etc \
+CONFIGURE_ARGS+= --sysconfdir=${PREFIX}/etc/squid \
--localstatedir=/var/squid \
${SQUID_CONFIGURE_ARGS}
-CONFIGURE_ENV+= CACHE_HTTP_PORT=${SQUID_HTTP_PORT} \
- CACHE_ICP_PORT=${SQUID_ICP_PORT} \
- PERL=${PERL5}
+CONFIGURE_ENV+= PERL=${PERL5}
-BUILD_DEFS+= SQUID_CONFIGURE_ARGS SQUID_HTTP_PORT SQUID_ICP_PORT
+BUILD_DEFS+= SQUID_CONFIGURE_ARGS
MAKEFILE= makefile
MAKE_ENV+= INSTALL_SCRIPT="${INSTALL_SCRIPT}" PKG_PREFIX="${PREFIX}"
-PLIST_SRC= ${PKGDIR}/PLIST ${WRKDIR}/PLIST.share
+PLIST_SRC= ${WRKDIR}/PLIST
WRKSRC= ${WRKDIR}/${DISTNAME:S/-src//}
.include "../../mk/bsd.prefs.mk"
@@ -41,15 +39,9 @@ SQUID_CONFIGURE_ARGS?= --enable-cachemgr-hostname=localhost \
--enable-delay-pools \
--enable-icmp \
--enable-ipf-transparent \
+ --enable-kill-parent-hack \
--enable-snmp \
--enable-underscores
-SQUID_HTTP_PORT?= 3128
-SQUID_ICP_PORT?= 3130
-
-.if ${OPSYS} == "SunOS"
-DEPENDS+= egcs-1.1.2:../../lang/egcs
-MAKE_ENV+= CPPFLAGS= CFLAGS=
-.endif
post-configure:
@cd ${WRKSRC}/include && \
@@ -61,7 +53,7 @@ post-build:
${SED} s#@PREFIX@#${PREFIX}#g <${FILESDIR}/squid.sh >${WRKDIR}/squid.sh
pre-install:
- @-rm -f ${WRKDIR}/PLIST.share
+ @${CP} ${PKGDIR}/PLIST ${PLIST_SRC}
@${INSTALL_DATA_DIR} ${PREFIX}/share/squid
@${INSTALL_DATA_DIR} ${PREFIX}/share/squid/errors
@${INSTALL_DATA_DIR} ${PREFIX}/share/squid/icons
@@ -73,11 +65,8 @@ pre-install:
ls anthony-*.gif | ${SED} -e 's@^@share/squid/icons/@'; \
${ECHO} "@dirrm share/squid/icons"; \
${ECHO} "share/squid/mib.txt"; \
- ${ECHO} "share/squid/mime.conf"; \
- ${ECHO} "share/squid/mime.conf.default"; \
- ${ECHO} "share/squid/squid.conf.default"; \
${ECHO} "@dirrm share/squid"; \
- ) > ${WRKDIR}/PLIST.share
+ ) >>${PLIST_SRC}
post-install:
${INSTALL_DATA_DIR} /var/squid
diff --git a/www/squid/distinfo b/www/squid/distinfo
index 952d1e8ce32..eed19c0fb4a 100644
--- a/www/squid/distinfo
+++ b/www/squid/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.3 2001/05/21 05:27:58 tron Exp $
+$NetBSD: distinfo,v 1.4 2001/07/29 16:41:18 tron Exp $
SHA1 (squid-2.4.STABLE1-src.tar.gz) = 584eb15080f52ef406e3f66511dba406ec1a40c5
Size (squid-2.4.STABLE1-src.tar.gz) = 1071386 bytes
@@ -14,7 +14,7 @@ SHA1 (squid-2.4.stable1-kill_parent_on_child_sigkill.patch) = c94ba4c220d31ea161
Size (squid-2.4.stable1-kill_parent_on_child_sigkill.patch) = 666 bytes
SHA1 (squid-2.4.stable1-wrong_sign_on_timestamp_check.patch) = cde4530d0c9cd184b0d4c6774e4c20f81ab7179f
Size (squid-2.4.stable1-wrong_sign_on_timestamp_check.patch) = 936 bytes
-SHA1 (patch-aa) = 3722daecfb5da7368860af51383759b20fbe1481
+SHA1 (patch-aa) = 89c0668d6380971734b373d38921525daeac61d5
SHA1 (patch-ab) = afb0c443c708d03fc7ab39120ae9a3c68d9e9b88
SHA1 (patch-ac) = b962e05bcaccd0d9a0969b2f1419fd73456440cd
SHA1 (patch-ad) = 03f76c2a781bff4b3a8680ee815f8c5dcbdd70d0
diff --git a/www/squid/files/squid.sh b/www/squid/files/squid.sh
index 12484055b7c..1e1145d4ec6 100644
--- a/www/squid/files/squid.sh
+++ b/www/squid/files/squid.sh
@@ -1,30 +1,81 @@
-#!/bin/sh
+#! /bin/sh
#
-# $NetBSD: squid.sh,v 1.8 2001/05/10 21:58:02 tron Exp $
+# $NetBSD: squid.sh,v 1.9 2001/07/29 16:41:19 tron Exp $
#
+
# PROVIDE: squid
# REQUIRE: DAEMON
# KEYWORD: shutdown
+SQUID_CONF_DIR="@PREFIX@/etc/squid"
+
+conf_file="${SQUID_CONF_DIR}/squid.conf"
+
name="squid"
command="@PREFIX@/sbin/${name}"
-required_files="/etc/squid.conf"
-command_args="-Y -f $required_files"
+pidfile="/var/run/${name}.pid"
+required_files="${conf_file} ${SQUID_CONF_DIR}/squid-mime.conf"
-if [ ! -d /etc/rc.d ]
-then
- @ECHO@ -n ' ${name}'
- exec ${command} ${command_args}
-fi
+start_cmd="@PREFIX@/sbin/RunCache ${conf_file} &"
+stop_cmd="stop_nicely"
+kill_command="${command} -k shutdown"
+reload_cmd="${command} -k reconfigure"
-. /etc/rc.subr
+#### end of configuration section ####
-extra_commands="reload"
+# XXX Shouldn't the default stop_cmd be this patient too?
+#
+stop_nicely ()
+{
+ if [ -f ${pidfile} ] ; then
+ DAEMON_PID=`sed 1q ${pidfile}`
+ echo -n "Stopping ${name}"
+ ${kill_command}
+ if [ ${DAEMON_PID} -ne 0 ]; then
+ echo -n '['
+ while kill -0 ${DAEMON_PID} >/dev/null 2>&1; do
+ sleep 2
+ echo -n '.'
+ done
+ echo '] Stopped.'
+ fi
+ fi
+}
-if [ "$1" = rotate ]
-then
- exec ${command} -k rotate
-fi
+if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then
+ . /etc/rc.subr
+ . /etc/rc.conf
-load_rc_config $name
-run_rc_command "$1"
+ start_precmd="checkyesno squid"
+ stop_precmd=${start_precmd}
+ reload_precmd=${start_precmd}
+ extra_commands="reload"
+
+ if type load_rc_config > /dev/null 2>&1 ; then
+ load_rc_config $name
+ fi
+ run_rc_command "$1"
+
+else # old NetBSD, Solaris, Linux, etc...
+
+ case $1 in
+ start)
+ if [ -x ${command} -a -f ${conf_file} ] ; then
+ eval ${start_cmd} && echo -n " ${name}"
+ fi
+ ;;
+ stop)
+ ${stop_cmd}
+ ;;
+ reload)
+ if [ -f ${pidfile} ] ; then
+ ${reload_cmd}
+ fi
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|reload}" 1>&2
+ exit 64
+ ;;
+ esac
+
+fi
diff --git a/www/squid/patches/patch-aa b/www/squid/patches/patch-aa
index 4de0f73941b..a47f36c3823 100644
--- a/www/squid/patches/patch-aa
+++ b/www/squid/patches/patch-aa
@@ -1,7 +1,7 @@
-$NetBSD: patch-aa,v 1.5 2001/04/14 10:05:01 tron Exp $
+$NetBSD: patch-aa,v 1.6 2001/07/29 16:41:19 tron Exp $
---- src/Makefile.in.orig Sat Apr 14 11:38:49 2001
-+++ src/Makefile.in Sat Apr 14 11:42:36 2001
+--- src/Makefile.in.orig Sun Jul 29 18:14:54 2001
++++ src/Makefile.in Sun Jul 29 18:20:14 2001
@@ -12,6 +12,8 @@
cgi_suffix = @cgi_suffix@
top_srcdir = @top_srcdir@
@@ -11,13 +11,7 @@ $NetBSD: patch-aa,v 1.5 2001/04/14 10:05:01 tron Exp $
libexecdir = @libexecdir@
sysconfdir = @sysconfdir@
localstatedir = @localstatedir@
-@@ -35,19 +37,19 @@
-
- DEFAULT_PREFIX = $(prefix)
- DEFAULT_CONFIG_FILE = $(sysconfdir)/squid.conf
--DEFAULT_MIME_TABLE = $(sysconfdir)/mime.conf
-+DEFAULT_MIME_TABLE = $(datadir)/squid/mime.conf
- DEFAULT_DNSSERVER = $(libexecdir)/$(DNSSERVER_EXE)
+@@ -40,14 +42,14 @@
DEFAULT_CACHE_LOG = $(localstatedir)/logs/cache.log
DEFAULT_ACCESS_LOG = $(localstatedir)/logs/access.log
DEFAULT_STORE_LOG = $(localstatedir)/logs/store.log
@@ -96,7 +90,7 @@ $NetBSD: patch-aa,v 1.5 2001/04/14 10:05:01 tron Exp $
fi; \
done
@if test -n "$(UTILS)"; then \
-@@ -377,20 +379,20 @@
+@@ -377,21 +379,21 @@
fi; \
done
$(INSTALL_FILE) $(srcdir)/mib.txt $(DEFAULT_MIB_PATH)
@@ -111,7 +105,11 @@ $NetBSD: patch-aa,v 1.5 2001/04/14 10:05:01 tron Exp $
- $(INSTALL_FILE) $(srcdir)/mime.conf $(sysconfdir)/mime.conf.default
- @if test -f $(sysconfdir)/mime.conf ; then \
- echo "$@ will not overwrite existing $(sysconfdir)/mime.conf" ; \
-+ $(INSTALL_FILE) squid.conf $(datadir)/squid/squid.conf.default
+- else \
+- echo "$(INSTALL_FILE) $(srcdir)/mime.conf $(sysconfdir)"; \
+- $(INSTALL_FILE) $(srcdir)/mime.conf $(sysconfdir); \
+- fi
++ $(INSTALL_FILE) squid.conf $(DEFAULT_CONFIG_FILE).default
+# @if test -f $(DEFAULT_CONFIG_FILE) ; then \
+# echo "$@ will not overwrite existing $(DEFAULT_CONFIG_FILE)" ; \
+# else \
@@ -120,13 +118,12 @@ $NetBSD: patch-aa,v 1.5 2001/04/14 10:05:01 tron Exp $
+# fi
+
+ $(INSTALL_FILE) $(srcdir)/mime.conf $(DEFAULT_MIME_TABLE).default
-+ @if test -f $(DEFAULT_MIME_TABLE) ; then \
-+ echo "$@ will not overwrite existing $(DEFAULT_MIME_TABLE)" ; \
- else \
-- echo "$(INSTALL_FILE) $(srcdir)/mime.conf $(sysconfdir)"; \
-- $(INSTALL_FILE) $(srcdir)/mime.conf $(sysconfdir); \
-+ echo "$(INSTALL_FILE) $(srcdir)/mime.conf $(DEFAULT_MIME_TABLE)"; \
-+ $(INSTALL_FILE) $(srcdir)/mime.conf $(DEFAULT_MIME_TABLE); \
- fi
++# @if test -f $(DEFAULT_MIME_TABLE) ; then \
++# echo "$@ will not overwrite existing $(DEFAULT_MIME_TABLE)" ; \
++# else \
++# echo "$(INSTALL_FILE) $(srcdir)/mime.conf $(DEFAULT_MIME_TABLE)"; \
++# $(INSTALL_FILE) $(srcdir)/mime.conf $(DEFAULT_MIME_TABLE); \
++# fi
install-pinger:
+ @f=$(PINGER_EXE); \
diff --git a/www/squid/pkg/INSTALL b/www/squid/pkg/INSTALL
index ec4d6eb172d..72abfdadfa8 100644
--- a/www/squid/pkg/INSTALL
+++ b/www/squid/pkg/INSTALL
@@ -1,30 +1,32 @@
#!/bin/sh
#
-# $NetBSD: INSTALL,v 1.4 1999/01/29 19:26:37 bad Exp $
+# $NetBSD: INSTALL,v 1.5 2001/07/29 16:41:19 tron Exp $
#
PKGNAME=$1
-DEFCONF=${PKG_PREFIX}/share/squid/squid.conf.default
+CONFDIR=${PKG_PREFIX}/share/squid/
+SQUIDCONF=squid.conf
+MIMECONF=mime.conf
case $2 in
PRE-INSTALL)
;;
POST-INSTALL)
echo ""
- echo " o you DO need running nameservice to start and run ${PKGNAME}"
+ echo " o You DO need running nameservice to start and run ${PKGNAME}".
echo ""
- echo " o use the ${PKGNAME} proxy and caching WWW Server by"
+ echo " o Use the ${PKGNAME} proxy and caching WWW Server by"
echo " configuring your WWW Navigator (Netscape, Mosaic,...)"
echo " to use it as a proxy server."
echo ""
- echo " o copy \"${DEFCONF}\" to \"/etc/squid.conf\""
- echo " and edit it as required. You should pay attention to"
- echo " the ACTUAL locations of the cache \"spool\" logfiles"
- echo " and pidfile."
+ echo " o Copy \"${CONFDIR}${SQUIDCONF}.default\" to \"${SQUIDCONF}\""
+ echo " and \"${CONFDIR}${MIMECONF}.default\" to \"${MIMECONF}\""
+ echo " and edit them as required. You should pay attention to the"
+ echo " ACTUAL locations of the cache \"spool\" logfiles and pidfile."
echo ""
;;
*)
- echo "Unexpected Argument $2!!"
+ echo "Unexpected Argument ${2}."
exit 1
;;
esac
diff --git a/www/squid/pkg/PLIST b/www/squid/pkg/PLIST
index d9df267e0ce..e773c0b0ded 100644
--- a/www/squid/pkg/PLIST
+++ b/www/squid/pkg/PLIST
@@ -1,5 +1,8 @@
-@comment $NetBSD: PLIST,v 1.5 2001/04/14 10:05:02 tron Exp $
+@comment $NetBSD: PLIST,v 1.6 2001/07/29 16:41:19 tron Exp $
etc/rc.d/squid
+etc/squid/mime.conf.default
+etc/squid/squid.conf.default
+@unexec rmdir %D/etc/squid 2>/dev/null || true
libexec/cachemgr.cgi
libexec/pinger
libexec/unlinkd