aboutsummaryrefslogtreecommitdiffstats
path: root/www
diff options
context:
space:
mode:
authorsergei <sergei@FreeBSD.org>2004-02-18 20:25:09 +0800
committersergei <sergei@FreeBSD.org>2004-02-18 20:25:09 +0800
commiteb96eec63fb0fa3531f07fd8ad79a52d52ef5d67 (patch)
tree57a4e89ec288933628832f95bb5b9076bc91aa19 /www
parent08b02ec1a3560486a396a9e562769ea798cef7af (diff)
downloadfreebsd-ports-gnome-eb96eec63fb0fa3531f07fd8ad79a52d52ef5d67.tar.gz
freebsd-ports-gnome-eb96eec63fb0fa3531f07fd8ad79a52d52ef5d67.tar.zst
freebsd-ports-gnome-eb96eec63fb0fa3531f07fd8ad79a52d52ef5d67.zip
- add two patches from squid-cache.org
- synchronize as much as possible with www/squid - add SQUID_{U,G}ID and SQUID_LANGUAGE tunables - utilize OPTIONS, PLIST_FILES, PLIST_DIRS, and USE_SIZE - add a patch to make the LDAP helper at least compile - add NO_LATEST_LINK and mark the port DEPRECATED - bump PORTREVISION PR: ports/62443 Submitted by: maintainer
Diffstat (limited to 'www')
-rw-r--r--www/squid24/Makefile300
-rw-r--r--www/squid24/distinfo5
-rw-r--r--www/squid24/files/squid.sh91
-rw-r--r--www/squid24/pkg-descr15
-rw-r--r--www/squid24/pkg-install120
-rw-r--r--www/squid24/pkg-plist27
6 files changed, 371 insertions, 187 deletions
diff --git a/www/squid24/Makefile b/www/squid24/Makefile
index 01ba240557ac..fa699c22b3d1 100644
--- a/www/squid24/Makefile
+++ b/www/squid24/Makefile
@@ -4,136 +4,222 @@
#
# $FreeBSD$
#
+# Tunables not (yet) configurable via 'make config':
+# SQUID_{U,G}ID
+# Which user/group squid should run as (default: squid/squid).
+# The user and group will be created if they do not already exist.
+# NOTE: before version 2.4.7_11, these settings defaulted to
+# nobody/nogroup.
+# If you wish to keep these settings, please define SQUID_UID=nobody and
+#
+# SQUID_LANGUAGE
+# The set of error pages to be installed. Valid values are:
+# Bulgarian Czech Danish Dutch English Estonian Finnish
+# French German Hungarian Italian Japanese Korean Polish
+# Portuguese Romanian Russian-1251 Russian-koi8-r Serbian
+# Simplify_Chinese Slovak Spanish Swedish Traditional_Chinese
+# Turkish
+# (default: English)
+#
+# SQUID_CONFIGURE_ARGS
+# Additional configuration options, see below for a list
PORTNAME= squid
PORTVERSION= 2.4
-PORTREVISION= 10
+PORTREVISION= 11
CATEGORIES= www
MASTER_SITES= \
- ftp://ftp.squid-cache.org/pub/%SUBDIR%/ \
- ftp://www.unimelb.edu.au/pub/cwis/servers/unix/squid/%SUBDIR%/ \
- ftp://sunsite.auc.dk/pub/infosystems/squid/%SUBDIR%/ \
- ftp://ftp.net.lut.ac.uk/squid/%SUBDIR%/ \
- ${MASTER_SITE_RINGSERVER:S,%SUBDIR%,net/www/squid/&,}
+ ftp://ftp.squid-cache.org/pub/%SUBDIR%/ \
+ ftp://ftp.unimelb.edu.au/pub/cwis/servers/unix/squid/%SUBDIR%/ \
+ ftp://sunsite.auc.dk/pub/infosystems/squid/%SUBDIR%/ \
+ ftp://ftp.leo.org/pub/comp/general/infosys/www/servers/squid/%SUBDIR%/ \
+ ${MASTER_SITE_RINGSERVER:S,%SUBDIR%,net/www/squid/&,}
MASTER_SITE_SUBDIR= squid-2/STABLE
DISTNAME= squid-2.4.STABLE7
EXTRACT_SUFX= -src.tar.gz
+DIST_SUBDIR= squid2.4
PATCH_SITES= http://www.squid-cache.org/Versions/v2/2.4/bugs/
-PATCHFILES=
+PATCHFILES= squid-2.4.STABLE7-url_port.patch \
+ squid-2.4.STABLE7-url_escape.patch
+PATCH_DIST_STRIP= -p1
MAINTAINER= tmseck@netcologne.de
COMMENT= The successful WWW proxy cache and accelerator
CONFLICTS= squid-*
-DIST_SUBDIR= squid2.4
-PATCH_DIST_STRIP= -p0
-
GNU_CONFIGURE= yes
+STRIP= # won't install scripts correctly otherwise.
+MAKEFILE= makefile
+USE_PERL5= yes
USE_REINPLACE= yes
-USE_PERL5_RUN= yes
-USE_PERL5_BUILD=yes
-# Follow the apache port's lead...
+
+NO_LATEST_LINK= yes
+DEPRECATED= This version of squid-2 is no longer officially supported
+EXPIRATION_DATE= when the next release of squid-2 is out
+
+SQUID_UID?= squid
+SQUID_GID?= squid
+SQUID_LANGUAGE?= English
+
+docs= QUICKSTART README doc/debug-sections.txt
+sbin= RunAccel RunCache client squid \
+ getpwnam_auth ncsa_auth yp_auth
+libexec= cachemgr.cgi diskd unlinkd msnt_auth pam_auth \
+ smb_auth smb_auth.sh
+
+OPTIONS= SQUID_LDAP_AUTH "Install LDAP authentication helpers" off \
+ SQUID_DELAY_POOLS "Enable delay pools" off \
+ SQUID_SNMP "Enable SNMP support" off \
+ SQUID_CARP "Enable CARP support" off \
+ SQUID_SSL "Enable SSL support for reverse proxies" off \
+ SQUID_PINGER "Install the icmp helper" off \
+ SQUID_DNS_HELPER "Use the old 'dnsserver' helper" off \
+ SQUID_HTCP "Enable HTCP support" off \
+ SQUID_VIA_DB "Enable forward/via database" off \
+ SQUID_CACHE_DIGESTS "Enable cache digests" off \
+ SQUID_WCCP "Enable Web Cache Coordination Protocol" on \
+ SQUID_STRICT_HTTP "Be strictly HTTP compliant" off \
+ SQUID_UNDERSCORES "Allow underscores in hostnames" on \
+ SQUID_IDENT "Enable ident (RFC 931) lookups" on \
+ SQUID_USERAGENT_LOG "Enable User-Agent-header logging" off
+
CONFIGURE_ARGS= --bindir=${PREFIX}/sbin --sysconfdir=${PREFIX}/etc/squid \
+ --datadir=${PREFIX}/etc/squid \
+ --libexecdir=${PREFIX}/libexec/squid \
--localstatedir=${PREFIX}/squid \
--enable-storeio="ufs diskd null" \
--enable-removal-policies="lru heap" \
+ --enable-err-language=${SQUID_LANGUAGE}
-STRIP= # won't install scripts correctly otherwise.
-MAKEFILE= makefile
+.include <bsd.port.pre.mk>
-# Some other configure options..
-# - Compile and use the malloc package from Doug Lea
-#CONFIGURE_ARGS+= --enable-dlmalloc
-# - Compile and use the supplied GNUregex routines instead of BSD regex.
-#CONFIGURE_ARGS+= --enable-gnuregex
-# - Enable simple malloc debugging
-#CONFIGURE_ARGS+= --enable-xmalloc-debug
-# - Detailed trace of memory allocations
-#CONFIGURE_ARGS+= --enable-xmalloc-debug-count
-# - Show malloc statistics in cachemgr status pages
-#CONFIGURE_ARGS+= --enable-xmalloc-statistics
-# - Enable CARP support
-#CONFIGURE_ARGS+= --enable-carp
-# - Enable ICMP pinging for heirarchy stats and selection
-#CONFIGURE_ARGS+= --enable-icmp
-# - Enable delay pools to limit bandwidth usage
-#CONFIGURE_ARGS+= --enable-delay-pools
-# - Enable generic memory use tracing
-#CONFIGURE_ARGS+= --enable-mem-gen-trace
-# - Enable logging of the User-Agent header
-#CONFIGURE_ARGS+= --enable-useragent-log
-# - Disable Web Cache Coordination Protocol
-#CONFIGURE_ARGS+= --disable-wccp
-# - Kill parent (eg: RunCache) on shutdown (use with great care!!)
-#CONFIGURE_ARGS+= --enable-kill-parent-hack
-# - Turn on SNMP server support
-#CONFIGURE_ARGS+= --enable-snmp
-# - Optimize time updates to one per second rather than calling gettimeofday()
-#CONFIGURE_ARGS+= --enable-time-hack
-# - Set an explicit hostname in cachemgr.cgi
-#CONFIGURE_ARGS+= --enable-cachemgr-hostname=some.hostname
-# - Enable ACL based on ethernet address (eg: for machines with dynamic DHCP
-# assigned IP addresses)
-#CONFIGURE_ARGS+= --enable-arp-acl
-# - Enable HTCP protocol
-#CONFIGURE_ARGS+= --enable-htcp
-# - Enable Forw/Via database
-#CONFIGURE_ARGS+= --enable-forw-via-db
-# - Use Cache Digests - see http://squid.nlanr.net/Squid/FAQ/FAQ-16.html
-#CONFIGURE_ARGS+= --enable-cache-digests
-# - Select language for Error pages (see errors dir)
-#CONFIGURE_ARGS+= --enable-err-language=lang
-# (--enable-poll is not needed, it's detected correctly on 3.0)
-# - Strict HTTP compliance
-#CONFIGURE_ARGS+= --disable-http-violations
-# - Enable Transparent Proxy support for IP-Filter systems (incl 3.0)
-#CONFIGURE_ARGS+= --enable-ipf-transparent
-# (--enable-leakfinder is a developer support tool only)
-# - Compile out code that does optional Ident (RFC931) lookups
-#CONFIGURE_ARGS+= --disable-ident-lookups
-# - Disable squid's internal async DNS lookup code.
-#CONFIGURE_ARGS+= --disable-internal-dns
-# - Use truncate() rather than unlink()
-#CONFIGURE_ARGS+= --enable-truncate
-# - accept the illegal '_' character in hostnames.
-#CONFIGURE_ARGS+= --enable-underscores
-# - Enable control of different heap replacement algorithms at runtime.
-#CONFIGURE_ARGS+= --enable-removal-policies='heap lru'
-
-post-extract:
- @${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' \
- ${WRKSRC}/configure
- @${SED} -e "s=%%PREFIX%%=${PREFIX}=g" ${FILESDIR}/squid.sh \
- > ${WRKSRC}/squid.sh
+# Authentication methods and modules:
+
+auth_modules= MSNT NCSA PAM SMB YP getpwnam
+.if defined(WITH_SQUID_LDAP_AUTH)
+USE_OPENLDAP= yes
+CONFIGURE_ENV+= CFLAGS="${CFLAGS} -I${LOCALBASE}/include" \
+ LDFLAGS="-L${LOCALBASE}/lib"
+auth_modules+= LDAP
+libexec+= squid_ldap_auth
+.endif
+
+CONFIGURE_ARGS+= --enable-auth-modules="${auth_modules}"
+
+# Other options set via 'make config':
+
+.if defined(WITH_SQUID_DELAY_POOLS)
+CONFIGURE_ARGS+= --enable-delay-pools
+.endif
+.if defined(WITH_SQUID_SNMP)
+CONFIGURE_ARGS+= --enable-snmp
+.endif
+.if defined(WITH_SQUID_CARP)
+CONFIGURE_ARGS+= --enable-carp
+.endif
+.if defined(WITH_SQUID_SSL)
+CONFIGURE_ARGS+= --enable-ssl
+.endif
+.if defined(WITH_SQUID_PINGER)
+CONFIGURE_ARGS+= --enable-icmp
+libexec+= pinger
+.endif
+.if defined(WITH_SQUID_DNS_HELPER)
+CONFIGURE_ARGS+= --disable-internal-dns
+libexec+= dnsserver
+.endif
+.if defined(WITH_SQUID_HTCP)
+CONFIGURE_ARGS+= --enable-htcp
+.endif
+.if defined(WITH_SQUID_VIA_DB)
+CONFIGURE_ARGS+= --enable-forw-via-db
+.endif
+.if defined(WITH_SQUID_CACHE_DIGESTS)
+CONFIGURE_ARGS+= --enable-cache-digests
+.endif
+.if defined(WITHOUT_SQUID_WCCP)
+CONFIGURE_ARGS+= --disable-wccp
+.endif
+.if defined(WITH_SQUID_UNDERSCORES)
+CONFIGURE_ARGS+= --enable-underscores
+.endif
+.if defined(WITH_SQUID_STRICT_HTTP)
+CONFIGURE_ARGS+= --disable-http-violations
+.endif
+.if defined(WITHOUT_SQUID_IDENT)
+CONFIGURE_ARGS+= --disable-ident-lookups
+.endif
+.if defined(WITH_SQUID_USERAGENT_LOG)
+CONFIGURE_ARGS+= --enable-useragent-log
+.endif
+
+.if !defined(NOPORTDOCS)
+PORTDOCS= ${docs:T}
+.endif
+PLIST_DIRS= libexec/squid
+PLIST_FILES= etc/rc.d/squid.sh etc/squid/mib.txt \
+ etc/squid/mime.conf.default etc/squid/squid.conf.default
+PLIST_FILES+= ${libexec:S/^/libexec\/squid\//} ${sbin:S/^/sbin\//}
+
+# Other not so common configure options you can set via SQUID_CONFIGURE_ARGS:
+#
+# Please see the configure script in the squid source distribution for a
+# complete list.
+#
+# --enable-dlmalloc
+# Compile and use the malloc package from Doug Lea
+# --enable-gnuregex
+# Compile and use the supplied GNUregex routines instead of BSD regex.
+# --enable-xmalloc-debug
+# Enable simple malloc debugging
+# --enable-xmalloc-debug-count
+# Detailed trace of memory allocations
+# --enable-xmalloc-statistics
+# Show malloc statistics in cachemgr status pages
+# --enable-mem-gen-trace
+# Enable generic memory use tracing
+# --enable-kill-parent-hack
+# Kill parent (eg: RunCache) on shutdown (use with great care!!)
+# --enable-time-hack
+# Optimize time updates to one per second rather than calling gettimeofday()
+# --enable-cachemgr-hostname=some.hostname
+# Set an explicit hostname in cachemgr.cgi
+# --enable-ipf-transparent
+# Enable Transparent Proxy support for IP-Filter systems (incl 3.0)
+# --enable-truncate
+# Use truncate() rather than unlink()
+
+post-patch:
+ @${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure
+
+pre-configure:
+ @${REINPLACE_CMD} -e 's|%%SQUID_UID%%|${SQUID_UID}|g' \
+ -e 's|%%SQUID_GID%%|${SQUID_GID}|g' ${WRKSRC}/src/cf.data.pre
+
+pre-install:
+ @${SED} -e 's|%%PREFIX%%|${PREFIX}|g' \
+ -e 's|%%SQUID_UID%%|${SQUID_UID}|g' ${FILESDIR}/squid.sh \
+ >${WRKDIR}/squid.sh
+
+pre-su-install:
+ @${SETENV} SQUID_USER=${SQUID_UID} SQUID_GROUP=${SQUID_GID} \
+ PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
post-install:
-# I don't think many people use the pinger nowadays, and if you
-# do you'll want squid in its own group so as to restrict access
-# to it.
-# cd ${WRKSRC}/src; make install-pinger
-.for file in client squid
- if [ -f ${PREFIX}/sbin/${file} ] ; then \
- ${STRIP_CMD} ${PREFIX}/sbin/${file} ; \
- fi
-.endfor
-.for file in cachemgr.cgi dnsserver pinger unlinkd
- if [ -f ${PREFIX}/libexec/${file} ] ; then \
- ${STRIP_CMD} ${PREFIX}/libexec/${file} ; \
- fi
-.endfor
- @if [ ! -d ${PREFIX}/squid/logs ]; then \
- ${MKDIR} ${PREFIX}/squid/logs; \
- ${CHOWN} nobody:nogroup ${PREFIX}/squid/logs; \
- fi
- @if [ ! -d ${PREFIX}/squid/cache ]; then \
- ${MKDIR} ${PREFIX}/squid/cache; \
- ${CHOWN} nobody:nogroup ${PREFIX}/squid/cache; \
- fi
- @if [ ! -f ${PREFIX}/etc/rc.d/squid.sh ]; then \
- ${ECHO} "Installing ${PREFIX}/etc/rc.d/squid.sh startup file."; \
- ${INSTALL_SCRIPT} -m 751 ${WRKSRC}/squid.sh ${PREFIX}/etc/rc.d/squid.sh; \
- fi
-
-.include <bsd.port.mk>
+.if defined(WITH_SQUID_PINGER)
+ cd ${WRKSRC}/src && make install-pinger
+ ${CHMOD} 4510 ${PREFIX}/libexec/squid/pinger
+ ${CHGRP} ${SQUID_GID} ${PREFIX}/libexec/squid/pinger
+.endif
+ ${INSTALL_SCRIPT} ${WRKDIR}/squid.sh ${PREFIX}/etc/rc.d/squid.sh
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+ cd ${WRKSRC} && ${INSTALL_DATA} ${docs} ${DOCSDIR}
+.endif
+ -cd ${PREFIX}/libexec/squid && ${STRIP_CMD} ${libexec}
+ -cd ${PREFIX}/sbin && ${STRIP_CMD} ${sbin}
+ @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+
+.include <bsd.port.post.mk>
diff --git a/www/squid24/distinfo b/www/squid24/distinfo
index 17dbc15ae9fa..08c4490dbe3a 100644
--- a/www/squid24/distinfo
+++ b/www/squid24/distinfo
@@ -1 +1,6 @@
MD5 (squid2.4/squid-2.4.STABLE7-src.tar.gz) = 3b91136b8ddcc37196716fa6e85a14b2
+SIZE (squid2.4/squid-2.4.STABLE7-src.tar.gz) = 1087532
+MD5 (squid2.4/squid-2.4.STABLE7-url_port.patch) = 06c240335e8624f509ba09bbb3da9e0e
+SIZE (squid2.4/squid-2.4.STABLE7-url_port.patch) = 796
+MD5 (squid2.4/squid-2.4.STABLE7-url_escape.patch) = e638eb8fadf1c66adcc808cc9f253286
+SIZE (squid2.4/squid-2.4.STABLE7-url_escape.patch) = 821
diff --git a/www/squid24/files/squid.sh b/www/squid24/files/squid.sh
index 20f9f6c6c23c..688111d7fc4e 100644
--- a/www/squid24/files/squid.sh
+++ b/www/squid24/files/squid.sh
@@ -1,26 +1,75 @@
#!/bin/sh
+#
+# $FreeBSD: /tmp/pcvs/ports/www/squid24/files/Attic/squid.sh,v 1.4 2004-02-18 12:25:09 sergei Exp $
+#
+# PROVIDE: squid
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: FreeBSD
+#
+# Note:
+# If you are running an rcNG-System (i.e. FreeBSD 5 and later or after
+# having installed the rc_subr-port on an earlier system) you must set
+# "squid_enable=YES" in either /etc/rc.conf, /etc/rc.conf.local or
+# /etc/rc.conf.d/squid to make this script actually do something. There
+# you can also set squid_chdir, squid_user, and squid_flags.
+#
+# Please see squid(8), rc.conf(5) and rc(8) for further details.
-PREFIX=%%PREFIX%%
+unset rcNG
+name="squid"
+command=%%PREFIX%%/sbin/squid
+extra_commands=reload
+reload_cmd="${command} -k reconfigure"
+stop_cmd="${command} -k shutdown"
+: ${squid_chdir:=%%PREFIX%%/squid/logs}
+: ${squid_user:=%%SQUID_UID%%}
+: ${squid_flags:="-D"}
+default_config=%%PREFIX%%/etc/squid/squid.conf
-case "$1" in
-start)
- if [ -x ${PREFIX}/sbin/squid -a -f ${PREFIX}/etc/squid/squid.conf ]; then
- (cd /${PREFIX}/squid/logs; ${PREFIX}/sbin/squid >/dev/null 2>&1 &) ; echo -n ' squid'
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr && rcNG=yes
+else
+ if [ -f %%PREFIX%%/etc/rc.subr ]; then
+ . %%PREFIX%%/etc/rc.subr && rcNG=yes
fi
- ;;
-stop)
- ${PREFIX}/sbin/squid -k shutdown 2>&1
- # Uncomment this if you'd like the system to (attempt to
- # wait for) squid to shut down cleanly
- #echo "Sleeping for 45 seconds to allow squid to shutdown.."
- #sleep 45
- ;;
-restart)
- ${PREFIX}/sbin/squid -k reconfigure
- ;;
-*)
- echo "Usage: `basename $0` {start|stop|restart}" >&2
- ;;
-esac
+fi
-exit 0
+if [ "${rcNG}" ]; then
+ rcvar=`set_rcvar`
+ load_rc_config ${name}
+ # check that squid's default configuration is present when
+ # squid_flags is not set. We assume that you specify at
+ # least the path to your non-default configuration with
+ # '-f /path/to/config.file' in squid_flags if you delete this file.
+ if [ -z "${squid_flags}" ]; then
+ required_files=${default_config}
+ fi
+ required_dirs=${squid_chdir}
+ run_rc_command "$1"
+else
+ case $1 in
+ start)
+ if [ -x "${command}" -a \
+ \( -f "${default_config}" -o "${squid_flags}" \) ]; then
+ echo -n ' squid'
+ (cd ${squid_chdir} && exec su -fm ${squid_user} -c \
+ "${command} ${squid_flags}")
+ fi
+ ;;
+ stop)
+ if [ -x "${command}" ]; then
+ echo -n ' squid'
+ ${stop_cmd}
+ while ps -xcU ${squid_user} | grep -q squid; do
+ sleep 2
+ done
+ fi
+ ;;
+ *)
+ echo "usage: `basename $0` {start|stop}" >&2
+ exit 64
+ ;;
+ esac
+ exit 0
+fi
diff --git a/www/squid24/pkg-descr b/www/squid24/pkg-descr
index a030d6c271b8..ab082ef11e4a 100644
--- a/www/squid24/pkg-descr
+++ b/www/squid24/pkg-descr
@@ -9,9 +9,16 @@ The Harvest home page is http://harvest.cs.colorado.edu/.
ARPA funding for the Harvest project has ended, the squid project has
continued development of the cache where Harvest finished.
-FreeBSD PORTER'S NOTES. To this moment, Squid is not well documented.
-But you aren't lost in space: there is a mailing list,
-<squid-users@squid-cache.org>, where you will find some support and help.
-We also _strongly_ suggest you to examine Web pages noted above.
+* This version of squid is no longer officially supported. *
+Please see this port's Makefile for a list of compilation options.
+
+*** UPDATE NOTICE ***
+Starting with Version 2.4.7_11 the default user:group changed from
+nobody:nogroup to squid:squid. You can restore the old behavior
+of this port by specifying SQUID_UID=nobody SQUID_GID=nogroup in
+your make environment. Helper applications are now installed to
+$PREFIX/libexec/squid instead of $PREFIX/libexec, too.
+
+You can find further information on the project's website at
WWW: http://www.squid-cache.org/
diff --git a/www/squid24/pkg-install b/www/squid24/pkg-install
index 82f6605be3a2..4020924da3f4 100644
--- a/www/squid24/pkg-install
+++ b/www/squid24/pkg-install
@@ -1,45 +1,105 @@
#!/bin/sh
+#
+# $FreeBSD: /tmp/pcvs/ports/www/squid24/Attic/pkg-install,v 1.8 2004-02-18 12:25:08 sergei Exp $
+#
-PKGNAME=$1
+PATH=/bin:/usr/bin:/usr/sbin
+pkgname=$1
+squid_base=${PKG_PREFIX:-/usr/local}/squid
+squid_confdir=${PKG_PREFIX:-/usr/local}/etc/squid
+squid_user=${SQUID_USER:=squid}
+squid_group=${SQUID_GROUP:=squid}
+squid_gid=3128
+squid_uid=3128
case $2 in
- PRE-INSTALL)
+PRE-INSTALL)
+ echo "===> Pre-installation configuration for ${pkgname}"
+ if ! pw groupshow ${squid_group} -q >/dev/null ; then
+ while pw groupshow -g ${squid_gid} -q >/dev/null; do
+ squid_gid=`expr ${squid_gid} + 1`
+ done
+ echo "There is no group '${squid_group}' on this system, so I will try to create it:"
+ if ! pw groupadd ${squid_group} -g ${squid_gid} -q ; then
+ echo "Failed to create group \"${squid_group}\"!" >&2
+ echo "Please create it manually." >&2
+ exit 1
+ else
+ echo "Group '${squid_group}' created successfully:"
+ fi
+ else
+ echo "I will use the existing group '${squid_group}':"
+ fi
+ pw groupshow ${squid_group}
+ if ! pw usershow ${squid_user} -q >/dev/null ; then
+ while pw usershow -u ${squid_uid} -q >/dev/null; do
+ squid_uid=`expr ${squid_uid} + 1`
+ done
+ echo "There is no account '${squid_user}' on this system, so I will try to create it:"
+ if ! pw useradd ${squid_user} -u ${squid_uid} -q \
+ -c "squid caching-proxy pseudo user" -g ${squid_group} \
+ -d "${squid_base}" -s "/sbin/nologin" -h - ; then
+ echo "Failed to create user '${squid_user}'!" >&2
+ echo "Please create it manually." >&2
+ exit 1
+ else
+ echo "User '${squid_user}' created successfully:"
+ fi
+ else
+ echo "I will use the existing user '${squid_user}':"
+ fi
+ pw usershow ${squid_user}
+ for dir in cache logs; do
+ if [ ! -d ${squid_base}/${dir} ]; then
+ echo "Creating ${squid_base}/${dir}..."
+ install -d -o ${squid_user} -g ${squid_group} \
+ -m 0750 ${squid_base}/${dir}
+ fi
+ done
+ if [ ! -d ${squid_confdir} ]; then
+ echo "Creating ${squid_confdir}..."
+ install -d -o root -g ${squid_group} \
+ -m 0750 ${squid_confdir}
+ fi
;;
- POST-INSTALL)
- echo "==> Post-installation configuration of ${PKGNAME}"
+POST-INSTALL)
+ for file in mime.conf squid.conf; do
+ if [ ! -f ${squid_confdir}/${file} \
+ -a -f ${squid_confdir}/${file}.default ]; then
+ echo "Creating ${file} from default..."
+ install -c -o root -g ${squid_group} -m 0640 \
+ ${squid_confdir}/${file}.default ${squid_confdir}/${file}
+ fi
+ done
+
+ echo "===> Post-installation informations for ${pkgname}"
+ echo ""
+ echo " o You can find the configuration files for this package"
+ echo " in the directory ${squid_confdir}."
echo ""
- echo " o you DO need running nameservice to start and run ${PKGNAME}"
+ echo " o A cache directory has been created in ${squid_base}/cache."
+ echo " Log files will be written to ${squid_base}/logs."
echo ""
- 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 " o The default configuration will deny everyone access to the"
+ echo " proxy service. Edit the \"http_access\" directives in"
+ echo " ${squid_confdir}/squid.conf to suit your needs."
echo ""
- echo " o Note that before you can run ${PKGNAME} you will"
- echo " need to initialise the cache directory."
- echo " You can do this by typing \"squid -z\"."
+ echo " o If you never ran squid on this system before, you need to"
+ echo " initialize the cache directory by running \"squid -z\""
+ echo " as 'root' or '${squid_user}' before starting squid."
echo ""
- echo "==> Press Enter to edit the ${PKGNAME} config file."
- echo " (The defaults are reasonable; and the file is well commented)"
tput md
- echo " You'd certainly like to pay attention to the"
- echo " ACTUAL locations of cache \"spool\", logfiles, pidfile!"
+ echo " *** UPDATE NOTICE ***"
+ echo ""
+ echo " Starting with version 2.4.7_11, all helper applications are"
+ echo " installed to ${PKG_PREFIX}/libexec/squid instead of"
+ echo " ${PKG_PREFIX}/libexec."
+ echo " Please check your squid.conf and update it if necessary."
tput me
- if [ -z "${PACKAGE_BUILDING}" ]; then read skip; fi
- chown root:wheel ${PREFIX:-/usr/local}/etc/squid/squid.conf*
- chmod 644 ${PREFIX:-/usr/local}/etc/squid/squid.conf*
- [ -f ${PREFIX:-/usr/local}/etc/squid/squid.conf ] || \
- cp -fp ${PREFIX:-/usr/local}/etc/squid/squid.conf.default \
- ${PREFIX:-/usr/local}/etc/squid/squid.conf
- [ -f ${PREFIX:-/usr/local}/etc/squid/mime.conf ] || \
- cp -fp ${PREFIX:-/usr/local}/etc/squid/mime.conf.default \
- ${PREFIX:-/usr/local}/etc/squid/mime.conf
- ${EDITOR:-vi} ${PREFIX:-/usr/local}/etc/squid/squid.conf \
- ${PREFIX:-/usr/local}/etc/squid/mime.conf
+ echo ""
;;
- *)
- echo "Unexpected Argument $2!!!"
- exit 1
+*)
+ exit 64
;;
esac
exit 0
-
diff --git a/www/squid24/pkg-plist b/www/squid24/pkg-plist
index 609737df8c64..1a2318947861 100644
--- a/www/squid24/pkg-plist
+++ b/www/squid24/pkg-plist
@@ -1,4 +1,4 @@
-etc/rc.d/squid.sh
+@comment $FreeBSD$
etc/squid/errors/ERR_ACCESS_DENIED
etc/squid/errors/ERR_CACHE_ACCESS_DENIED
etc/squid/errors/ERR_CACHE_MGR_ACCESS_DENIED
@@ -55,28 +55,5 @@ etc/squid/icons/anthony-text.gif
etc/squid/icons/anthony-unknown.gif
etc/squid/icons/anthony-xbm.gif
etc/squid/icons/anthony-xpm.gif
-etc/squid/mib.txt
-@unexec if cmp -s %D/etc/squid/mime.conf %D/etc/squid/mime.conf.default; then rm -f %D/etc/squid/mime.conf; fi
-etc/squid/mime.conf.default
-@exec [ -f %B/mime.conf ] || cp %B/%f %B/mime.conf
-@unexec if cmp -s %D/etc/squid/squid.conf %D/etc/squid/squid.conf.default; then rm -f %D/etc/squid/squid.conf; fi
-etc/squid/squid.conf.default
-@exec [ -f %B/squid.conf ] || cp %B/%f %B/squid.conf
-libexec/cachemgr.cgi
-libexec/diskd
-libexec/unlinkd
-sbin/RunAccel
-sbin/RunCache
-sbin/client
-sbin/squid
-@exec mkdir -p %D/etc/squid/errors
-@exec mkdir -p %D/squid/cache
-@exec chown nobody:nogroup %D/squid/cache
-@exec mkdir -p %D/squid/logs
-@exec chown nobody:nogroup %D/squid/logs
@dirrm etc/squid/icons
-@dirrm etc/squid/errors
-@dirrm etc/squid
-@dirrm squid/logs
-@dirrm squid/cache
-@dirrm squid
+@unexec rmdir -p %D/etc/squid/errors 2>/dev/null || true