head	1.11;
access;
symbols
	RELEASE_5_3_0:1.10
	RELEASE_4_10_0:1.9
	RELEASE_5_2_1:1.7
	RELEASE_5_2_0:1.7
	RELEASE_4_9_0:1.7
	RELEASE_5_1_0:1.7
	RELEASE_4_8_0:1.7
	RELEASE_5_0_0:1.7
	RELEASE_4_7_0:1.7
	RELEASE_4_6_2:1.7
	RELEASE_4_6_1:1.7
	RELEASE_4_6_0:1.7
	RELEASE_5_0_DP1:1.7
	RELEASE_4_5_0:1.7
	RELEASE_4_4_0:1.7
	RELEASE_4_3_0:1.7
	RELEASE_4_2_0:1.6
	RELEASE_4_1_1:1.6
	RELEASE_4_1_0:1.6
	RELEASE_3_5_0:1.6
	RELEASE_4_0_0:1.6
	RELEASE_3_4_0:1.6
	RELEASE_3_3_0:1.6
	RELEASE_3_2_0:1.5
	RELEASE_3_1_0:1.5
	RELEASE_2_2_8:1.5
	RELEASE_3_0_0:1.5
	RELEASE_2_2_7:1.5
	RELEASE_2_2_6:1.5
	RELEASE_2_2_5:1.3
	RELEASE_2_2_1:1.3
	RELEASE_2_2_2:1.3
	squid_1_0b11:1.1.1.1
	SQUID:1.1.1;
locks; strict;
comment	@# @;


1.11
date	2004.12.19.02.21.05;	author linimon;	state dead;
branches;
next	1.10;

1.10
date	2004.05.02.22.38.35;	author pav;	state Exp;
branches;
next	1.9;

1.9
date	2004.03.23.17.12.47;	author sada;	state Exp;
branches;
next	1.8;

1.8
date	2004.02.18.12.25.08;	author sergei;	state Exp;
branches;
next	1.7;

1.7
date	2001.03.27.12.28.47;	author adrian;	state Exp;
branches;
next	1.6;

1.6
date	99.06.22.17.21.59;	author steve;	state Exp;
branches;
next	1.5;

1.5
date	97.12.20.10.34.32;	author peter;	state Exp;
branches;
next	1.4;

1.4
date	97.12.06.12.28.09;	author peter;	state Exp;
branches;
next	1.3;

1.3
date	96.11.06.16.37.23;	author peter;	state Exp;
branches;
next	1.2;

1.2
date	96.07.10.21.50.14;	author asami;	state Exp;
branches;
next	1.1;

1.1
date	96.06.03.02.21.13;	author asami;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	96.06.03.02.21.13;	author asami;	state Exp;
branches;
next	;


desc
@@


1.11
log
@As previously announced, remove www/squid24.  It is obsolete, no longer
supported, and has security problems.

Approved by:	former maintainer
@
text
@#!/bin/sh
#
# $FreeBSD: ports/www/squid24/pkg-install,v 1.10 2004/05/02 22:38:35 pav Exp $
#

PATH=/bin:/usr/bin:/usr/sbin
pkgname=$1
squid_base=${PKG_PREFIX:-/usr/local}/squid
squid_confdir=${PKG_PREFIX:-/usr/local}/etc/squid
if [ -x /usr/sbin/nologin ]; then
	nologin=/usr/sbin/nologin
else
	nologin=/sbin/nologin
fi
: ${squid_user:=squid}
: ${squid_group:=squid}
squid_gid=100
squid_uid=100
# Try to catch the case where the $squid_user might have been created with an
# id greater than or equal 3128. The valid exception is "nobody".
nobody_uid=65534
nobody_gid=65534
squid_oldgid=3128
squid_olduid=3128
unset wrong_id
case $2 in
PRE-INSTALL)
	echo "===> Pre-installation configuration for ${pkgname}"
	if ! pw groupshow ${squid_group} -q >/dev/null ; then
		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}':"
		current_gid=`pw groupshow ${squid_group}|cut -f 3 -d :`
		if [ ${current_gid} -ge ${squid_oldgid} \
		    -a ${current_gid} -ne ${nobody_gid} ]; then
			wrong_id=1
		fi	
	fi
	pw groupshow ${squid_group}

	if ! pw usershow ${squid_user} -q >/dev/null ; then
		echo "There is no account '${squid_user}' on this system, so I will try to create it:"
		if ! pw useradd -q -n ${squid_user} \
		    -u ${squid_uid} -g ${squid_group} \
	  	    -c "squid caching-proxy pseudo user" \
		    -d "${squid_base}" -s "${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}':"
		current_uid=`id -u ${squid_user}`
		if [ ${current_uid} -ge ${squid_olduid} \
		    -a ${current_uid} -ne ${nobody_uid} ];
		then
			wrong_id=1
		fi
	fi
	pw usershow ${squid_user}
	if [ "${wrong_id}" ]; then
		echo ""
		echo " * NOTICE *"
		echo ""
		echo "The squid pseudo-user's uid and/or gid have been found"
		echo "to be greater than or equal 3128."
		echo ""
		echo "This is not a problem as such, but violates the FreeBSD"
		echo "ports' principle that a ports must not claim a uid greater"
		echo "than 999."
		echo ""
		echo "Since version 2.5.4_11, the squid user is thus created"
		echo "with an id of ${squid_uid}:${squid_gid} while earlier versions of this"
		echo "port used the first unused uid/gid greater than or"
		echo "equal 3128."
		echo ""
		echo "If you want to change the existing squid user's id, run"
		echo "'make changeuser' after the installation has completed."
		echo "If you installed this port via a package, issue the"
		echo "following commands as root:"
		echo ""
		echo "pw userdel -u ${current_uid}"
		echo "pw groupadd -n ${squid_group} -g ${squid_gid}"
		echo "pw useradd -n ${squid_user} -u ${squid_uid} \\"
		echo "    -c \"squid caching-proxy pseudo user\" \\"
		echo "    -g ${squid_group} -d ${squid_base} -s /sbin/nologin \\"
		echo "    -h -"
		echo "find -H ${PKG_PREFIX} -user ${current_uid} -exec chown ${squid_user} {} \\;"
		echo "find -H ${PKG_PREFIX} -group ${current_gid} -exec chgrp ${squid_group} {} \\;"
		echo ""
		echo "In case you have installed third party software for squid"
		echo "like squidGuard, you should additionally run:"
		echo "find -H /var -user ${current_uid} -exec chown ${squid_user} {} \\;"
		echo "find -H /var -group ${current_gid} -exec chgrp ${squid_group} {} \\;"
		echo ""
		if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
			sleep 30
		fi
	fi
	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)
	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 A cache directory has been created in ${squid_base}/cache."
	echo "       Log files will be written to ${squid_base}/logs."
	echo ""
	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 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 ""
	tput md
	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
	echo ""
	if [ -f /etc/rc.subr ]; then
		echo "     Please note that ${PKG_PREFIX}/etc/rc.d/squid.sh"
		echo "     will not start squid automatically on this system."
		echo "     You need to set squid_enable=yes in either"
		echo "     /etc/rc.conf, /etc/rc.conf.local or /etc/rc.conf.d/squid"
		echo "     See ${PKG_PREFIX}/etc/rc.d/squid.sh for more"
		echo "     configuration options."
		echo ""
	fi
	;;
*)
	exit 64
	;;
esac
exit 0
@


1.10
log
@Infrastructural synchronization with www/squid and misc fixes:
- fix CONFLICTS glob
- reinstate LATEST_LINK and name it squid24
- correct CFLAGS/LDFLAGS handling
- remove SQUID_SSL, it does no longer compile
- prefer /bin/sh's features over external programs
- reduce the number of variables in pkg-{de,}install
- no longer hardcode the path to nologin(8)
- inform about squid.sh's rcNG-ness when /etc/rc.subr is present
  at installation time
- other miscellaneous fixes
- schedule removal for the 31st October 2004
- bump PORTREVISION

PR:		ports/66142
Submitted by:	Thomas-Martin Seck <tmseck@@netcologne.de> (maintainer)
@
text
@d3 1
a3 1
# $FreeBSD: ports/www/squid24/pkg-install,v 1.9 2004/03/23 17:12:47 sada Exp $
@


1.9
log
@PR: ports/63652
Synchronize with www/squid.
@
text
@d3 1
a3 1
# $FreeBSD: ports/www/squid24/pkg-install,v 1.8 2004/02/18 12:25:08 sergei Exp $
d10 7
a16 2
squid_user=${SQUID_USER:=squid}
squid_group=${SQUID_GROUP:=squid}
d50 5
a54 3
		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
d158 9
@


1.8
log
@- 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
@
text
@d3 1
a3 1
# $FreeBSD: ports/www/squid/pkg-install,v 1.9 2004/01/16 21:18:20 sergei Exp $
d12 9
a20 3
squid_gid=3128
squid_uid=3128

a24 3
		while pw groupshow -g ${squid_gid} -q >/dev/null; do
			squid_gid=`expr ${squid_gid} + 1`
		done
d35 5
d42 1
a43 3
		while pw usershow -u ${squid_uid} -q >/dev/null; do
			squid_uid=`expr ${squid_uid} + 1`
		done
d56 6
d64 39
@


1.7
log
@PR:		26059

Update the squid-2.4 port to actually _be_ squid-2.4 . Phew.
This port builds, installs, packages, pkg_delete's cleanly.

I'm going to run it through some more linting and tidying up before
I'm completely done with it.

Differences from squid22/squid23 :

* install-pinger isn't built. I'll tackle this later, possibly by creating
  a squid user/group. I don't like having suid binaries installed,
  even more so when 99% of the users of this port won't even enable
  ICMP pinging.

* I've enabled the lru and heap replacement policies. LRU is used by
  default, the beauty here is that the user can choose one or the other
  without needing a recompile.

* I've enabled ufs (sync), diskd (async) and null (no caching, only proxying).
  This again lets users choose what they want without needing a recompile.
  The default is still a 100mb cache in /usr/local/squid/cache/ running
  ufs. I would change it to diskd but if the user hasn't tweaked their
  sysV shm/msg parameters sufficiently they'll just be puzzled when squid
  gives mysterious sysV errors (and if they load it up enough to have UFS
  become an issue, they'd be better off reading the squid FAQ anyhow..)
@
text
@d2 3
d6 8
a13 1
PKGNAME=$1
d16 48
a63 1
    PRE-INSTALL)
d65 14
a78 2
    POST-INSTALL)
	echo "==> Post-installation configuration of ${PKGNAME}"
d80 2
a81 1
	echo "    o you DO need running nameservice to start and run ${PKGNAME}"
d83 3
a85 3
	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."
d87 3
a89 3
	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\"."
a90 2
	echo "==> Press Enter to edit the ${PKGNAME} config file."
	echo "    (The defaults are reasonable; and the file is well commented)"
d92 6
a97 2
	echo "    You'd certainly like to pay attention to the"
	echo "    ACTUAL locations of cache \"spool\", logfiles, pidfile!"
d99 1
a99 11
	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
d101 2
a102 3
    *)
	echo "Unexpected Argument $2!!!"
	exit 1
a105 1

@


1.6
log
@Don't require interaction on install while PACKAGE_BUILDING.
@
text
@d17 4
@


1.5
log
@Unteach pkg/INSTALL about the fictitious mib.txt.default too. :-]
@
text
@d23 1
a23 1
	read skip
@


1.4
log
@Initial squid 1.2beta8 port.  As the squid www page says:
"We are currently in a beta-test period for Squid-1.2. If you like
seeing Squid coredump frequently, please join us!"

"This is BETA software. Do not run this on your production systems.
Logfile formats are subject (and likely) to change at any time without
warning.

Here is a brief list of the major features of this version:
   HTTP/1.1 persisitent connections.
   Lower VM usage; in-transit objects are not held fully in memory.
   Totally independent swap directories.
   Customizable error texts.
   FTP supported internally; no more ftpget.
   Asynchronous disk operations (optional, requires pthreads library).
   Internal icons for FTP and gopher directories.
   snprintf() used everywhere instead of sprintf().
   ...and many more!
"
As well, there is support for using MD5 or SHA hashes of URL's in the
cache index for space (and speed?) savings, SNMP support, poll(2) is
used by default, etc.

Please see  http://squid.nlanr.net/Squid/1.2.beta/  before using.
@
text
@d32 2
a33 4
	[ -f ${PREFIX:-/usr/local}/etc/squid/mib.txt ] || \
		cp -fp	${PREFIX:-/usr/local}/etc/squid/mib.txt.default \
			${PREFIX:-/usr/local}/etc/squid/mib.txt
	${EDITOR:-vi} ${PREFIX:-/usr/local}/etc/squid/squid.conf
@


1.3
log
@Update from squid-1.0.0 to 1.0.20.  There are a large number of bug fixes
and stability measures.

This port installs in a "FreeBSD-native" tree (like apache) rather than
with a mini hierarchy under /usr/local/squid/{bin,etc,cache,logs,...}

(the default behavior seems to have changed between 1.0.0 and 1.0.20)

Also, build a rc.d/squid.sh script.
@
text
@d29 6
@


1.2
log
@Upgrade from 1.0 beta11 to 1.0 release.

Submitted by:	Andrew Stesin <stesin@@elvisti.kiev.ua>
@
text
@a11 4
	echo "    o add the following line to /etc/rc.local to start"
	echo "      ${PKGNAME} automatically:"
	echo ""
	echo "		(cd /tmp; exec ${PREFIX:-/usr/local}/bin/RunCache) &"
d24 6
a29 6
	chown root:wheel ${PREFIX:-/usr/local}/etc/squid.conf*
	chmod 644 ${PREFIX:-/usr/local}/etc/squid.conf*
	[ -f ${PREFIX:-/usr/local}/etc/squid.conf ] || \
		cp -fp	${PREFIX:-/usr/local}/etc/squid.conf.default \
			${PREFIX:-/usr/local}/etc/squid.conf
	${EDITOR:-vi} ${PREFIX:-/usr/local}/etc/squid.conf
@


1.1
log
@Initial revision
@
text
@d23 4
a26 2
	echo "    You'd probably like to pay attention to the"
	echo "    ACTUAL locations of BOTH cache \"spool\" AND logfiles."
d30 3
@


1.1.1.1
log
@A post-harvest www cache proxy.

Submitted by:	Andrew V. Stesin <stesin@@elvisti.kiev.ua> and Peter Stubbs <PETERS@@staidan.qld.edu.au>
@
text
@@
