Skip site navigation (1)Skip section navigation (2)
Date:      9 Nov 2003 18:52:10 -0000
From:      Thomas-Martin Seck <tmseck@netcologne.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/59091: [PATCH] www/squid: major overhaul and update
Message-ID:  <20031109185210.21773.qmail@laurel.tmseck.homedns.org>
Resent-Message-ID: <200311091900.hA9J0cwe099101@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         59091
>Category:       ports
>Synopsis:       [PATCH] www/squid: major overhaul and update
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 09 11:00:38 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Thomas-Martin Seck
>Release:        FreeBSD 4.9-STABLE i386
>Organization:
private site
>Environment:
FreeBSD ports repository as of 11/9/2003

	
>Description:
	
This PR extends PR 58090.

The attached patch updates www/squid to the latest version as of 11/9/2003
(minus the errorpages patch, which is partly broken.  The non-broken part is
implemented as a FreeBSD patch).  Additionally, it improves the existing port
in various ways. I keep trying to get any feedback from the current maintainer
for more than six months now, unfortunately he has not given any yet so I
finally decided to file a PR.

Summary of changes:

- added tunables SQUID_{UID,GID} (following www/squidguard), defaulting to
  squid/squid

- added tunables for various helper applications

- let squid's STABLE-version number show up in PORTVERSION

- moved squid.sh to squid.sh.sample

- implemented a pkg-deinstall script; pkg_add and make install no longer
  behave differently. Moved all pkg-plist @exec-magic into pkg-(de)install.

- install the FAQ from squid-cache.org as additional documentation; since
  it get's rerolled once in a while ignore it in the distfile checks

- other minor cleanups

>How-To-Repeat:
	
>Fix:

	
Apply this patchset:


Index: projekte/FreeBSD/ports/www/squid/Makefile
diff -u projekte/FreeBSD/ports/www/squid/Makefile:1.1.1.1 projekte/FreeBSD/ports/www/squid/Makefile:1.5
--- projekte/FreeBSD/ports/www/squid/Makefile:1.1.1.1	Sun Nov  9 17:46:23 2003
+++ projekte/FreeBSD/ports/www/squid/Makefile	Sun Nov  9 19:38:52 2003
@@ -1,72 +1,141 @@
-# New ports collection makefile for:	squid24
+# New ports collection makefile for:	squid
 # Date created:		Tue Mar 27 14:56:08 CEST 2001
 # Whom:			Adrian Chadd <adrian@FreeBSD.org>
 #
 # $FreeBSD: ports/www/squid/Makefile,v 1.101 2003/07/27 08:45:10 adrian Exp $
 #
+# Tunables:
+# WITH_SQUID_PINGER: install the external icmp helper program (`pinger')
+#                    for hierarchy stats and selection (default: no)
+# WITH_SQUID_DNSSERVER: install the external dns helper program (`dnsserver')
+#                       (default: do not install)
+# WITHOUT_SQUID_UNLINKD: do not install and use an external unlink daemon
+#                        (default: install)
+# WITH_SQUID_DIGEST_AUTH: install support for digest authentication
+# WITH_SQUID_LDAP_AUTH: install external modules for authentication against
+#                       LDAP servers
+# SQUID_{U,G}ID: which user/group ID squid should run as (default: squid/squid)
 
 PORTNAME=	squid
-PORTVERSION=	2.5
-PORTREVISION=	4
+PORTVERSION=	2.5.4
+PORTREVISION=
 CATEGORIES=	www
-MASTER_SITES=	\
+
+MAINTAINER=	adrian@freebsd.org
+COMMENT=	The successful WWW proxy cache and accelerator
+
+MASTER_SITE_SUBDIR=	squid-2/STABLE
+MASTER_SITES=  \
 	ftp://ftp.squid-cache.org/pub/%SUBDIR%/ \
-	ftp://www.unimelb.edu.au/pub/cwis/servers/unix/squid/%SUBDIR%/ \
+	ftp://ftp.unimelb.edu.au/pub/cwis/servers/unix/squid/%SUBDIR%/ \
+	ftp://ftp.leo.org/pub/comp/general/infosys/www/servers/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/&,}
-MASTER_SITE_SUBDIR=	squid-2/STABLE
-DISTNAME=	squid-2.5.STABLE3
-EXTRACT_SUFX=	.tar.bz2
+DISTFILES=	squid-2.5.STABLE4.tar.gz
 DIST_SUBDIR=	squid2.5
-
+.if !defined(NOPORTDOCS)
+MASTER_SITES+=	http://www.squid-cache.org/Doc/FAQ/:doc
+DISTFILES+=	FAQ.tar.gz:doc
+IGNOREFILES+=	FAQ.tar.gz
+.endif
 PATCH_SITES=	http://www.squid-cache.org/Versions/v2/2.5/bugs/
-PATCHFILES=	squid-2.5.STABLE3-deny_info.patch \
-		squid-2.5.STABLE3-cache_dir_doc.patch \
-		squid-2.5.STABLE3-devnull.patch \
-		squid-2.5.STABLE3-log_quote.patch \
-		squid-2.5.STABLE3-rfc_reference.patch \
-		squid-2.5.STABLE3-external_acl_ident.patch \
-		squid-2.5.STABLE3-gcc-3_3.patch \
-		squid-2.5.STABLE3-carpfactor.patch \
-		squid-2.5.STABLE3-neighbor_type_domain.patch \
-		squid-2.5.STABLE3-header_access_peer.patch \
-		squid-2.5.STABLE3-memwarnsbrk.patch \
-		squid-2.5.STABLE3-hostscomments.patch \
-		squid-2.5.STABLE3-store_check_cachable_stats.patch \
-		squid-2.5.STABLE3-cachePeerPingsSentsnmp.patch \
-		squid-2.5.STABLE3-minimum_retry_timeout.patch \
-		squid-2.5.STABLE3-tcp_reset_leak.patch \
-		squid-2.5.STABLE3-hostheader.patch \
-		squid-2.5.STABLE3-reply_body_max_size.patch \
-		squid-2.5.STABLE3-ie_refresh.patch \
-		squid-2.5.STABLE3-http_reply_access-denied.patch \
-		squid-2.5.STABLE3-SENT_PASV.patch \
-		squid-2.5.STABLE3-peer_digest_not_found_assertion.patch \
-		squid-2.5.STABLE3-round_robin_max_size.patch
-PATCH_DIST_STRIP=	-p1
+PATCHFILES=	squid-2.5.STABLE4-reconfigure_message.patch \
+		squid-2.5.STABLE4-digest_auth_pwchange.patch \
+		squid-2.5.STABLE4-redirect_login_space.patch \
+		squid-2.5.STABLE4-fqdnnegcache.patch \
+		pam_auth-2.2.patch \
+		squid-2.5.STABLE4_auth_param_doc.patch \
+		squid-2.5.STABLE4-error_load_text.patch \
+		squid-2.5.STABLE4-xpi_mime.patch \
+		squid-2.5.STABLE4-size_overflow.patch
+PATCH_DIST_STRIP= -p1
 
-MAINTAINER=	adrian@freebsd.org
-COMMENT=	The successful WWW proxy cache and accelerator
+WRKSRC=		${WRKDIR}/${PORTNAME}-2.5.STABLE4
 
 GNU_CONFIGURE=	yes
-USE_BZIP2=	yes
 USE_PERL5=	yes
 USE_REINPLACE=	yes
-# Follow the apache port's lead...
+
 CONFIGURE_ARGS=	--bindir=${PREFIX}/sbin  --sysconfdir=${PREFIX}/etc/squid \
 		--datadir=${PREFIX}/etc/squid \
 		--localstatedir=${PREFIX}/squid \
 		--enable-storeio="ufs diskd null" \
 		--enable-removal-policies="lru heap" \
-		--enable-auth=basic --enable-basic-auth-helpers="NCSA PAM YP" \
-		--enable-external-acl-helpers="ip_user unix_group" \
 		--enable-underscores
 
+STRIP=		# won't install scripts correctly otherwise.
 MAKEFILE=	Makefile
-MAN8=	pam_auth.8 squid_unix_group.8 squid.8
 
-# Some other configure options..
+SQUID_UID?=	squid
+SQUID_GID?=	squid
+
+MAN8=		squid.8
+
+docs=		QUICKSTART README RELEASENOTES.html doc/debug-sections.txt
+libexec=	cachemgr.cgi
+sbin=		squidclient squid
+
+# authentication methods and modules:
+
+auth_methods=	basic ntlm
+basic_auth=	NCSA PAM YP MSNT
+external_acl=	ip_user unix_group
+MAN8+=		pam_auth.8 squid_unix_group.8
+libexec+=	ip_user_check msnt_auth ntlm_auth ncsa_auth pam_auth \
+		squid_unix_group yp_auth
+
+.ifdef WITH_SQUID_DIGEST_AUTH
+auth_methods+=	digest
+CONFIGURE_ARGS+= --enable-digest-auth-helpers="password"
+libexec+=	digest_pw_auth
+PLIST_SUB+=	DIGEST_AUTH_HELPER=""
+.else
+PLIST_SUB+=	DIGEST_AUTH_HELPER="@comment "
+.endif
+
+.ifdef WITH_SQUID_LDAP_AUTH
+USE_OPENLDAP=	yes
+CONFIGURE_ENV+=	CFLAGS="${CFLAGS} -I${LOCALBASE}/include" \
+		LDFLAGS="-L${LOCALBASE}/lib"
+basic_auth+=	LDAP
+external_acl+=	ldap_group
+MAN8+=		squid_ldap_auth.8 squid_ldap_group.8
+libexec+=	squid_ldap_auth squid_ldap_group
+PLIST_SUB+=	LDAP_AUTH_HELPER=""
+.else
+PLIST_SUB+=	LDAP_AUTH_HELPER="@comment "
+.endif
+
+CONFIGURE_ARGS+= --enable-auth="${auth_methods}" \
+		 --enable-basic-auth-helpers="${basic_auth}" \
+		 --enable-external-acl-helpers="${external_acl}" \
+		 --enable-ntlm-auth-helpers="SMB"
+
+# Other external helper programs:
+
+.ifdef WITH_SQUID_DNSSERVER
+CONFIGURE_ARGS+= --disable-internal-dns
+PLIST_SUB+=	DNSSERVER=""
+libexec+=	dnsserver
+.else
+PLIST_SUB+=	DNSSERVER="@comment "
+.endif
+.ifdef WITH_SQUID_PINGER
+CONFIGURE_ARGS+= --enable-icmp
+PLIST_SUB+=	PINGER=""
+.else
+PLIST_SUB+=	PINGER="@comment "
+.endif
+.ifdef WITHOUT_SQUID_UNLINKD
+CONFIGURE_ARGS+= --disable-unlinkd
+PLIST_SUB+=	UNLINKD="@comment "
+.else
+libexec+=	unlinkd
+PLIST_SUB+=	UNLINKD=""
+.endif
+
+# 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.
@@ -79,8 +148,6 @@
 #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
@@ -106,11 +173,10 @@
 #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
+#  - Use Cache Digests - see http://www.squid-cache.org/Doc/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)
@@ -118,45 +184,65 @@
 # (--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
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure
-	@${REINPLACE_CMD} -e 's|/etc|${PREFIX}/etc|g' ${WRKSRC}/doc/squid.8
+	@${REINPLACE_CMD} -e 's|/etc/squid/|${PREFIX}/etc/squid/|g' ${WRKSRC}/doc/squid.8
+.if !defined(NOPORTDOCS)
+	@cd ${WRKSRC} && ${PATCH} ${PATCH_ARGS} <${FILESDIR}/FAQ.html.patch
+.endif
+
+pre-configure:
+.if defined(PACKAGE_BUILDING) || defined(BATCH)
+	@${ECHO} ""; \
+	${ECHO} "This port has the following tunables:"; \
+	${ECHO} ""; \
+	${ECHO} "     SQUID_UID (default: ${SQUID_UID})"; \
+	${ECHO} "     SQUID_GID (default: ${SQUID_GID})"; \
+	${ECHO} "     WITH_SQUID_PINGER - install the external icmp helper program (default: no)"; \
+	${ECHO} "     WITH_SQUID_DNSSERVER - install the external dns helper program (default: no)"; \
+	${ECHO} "     WITHOUT_SQUID_UNLINKD - do not install and use an external unlink daemon"; \
+	${ECHO} "                             (default: install)"; \
+	${ECHO} "     WITH_SQUID_DIGEST_AUTH - install support for digest authentication"; \
+	${ECHO} "     WITH_SQUID_LDAP_AUTH - install external modules for authentication against"; \
+	${ECHO} "                            LDAP servers"; \
+	${ECHO} ""; \
+	${ECHO} "Hit Ctrl-C within 10 seconds to abort."; \
+	${ECHO} ""; \
+	sleep 10
+.endif
+	@${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.sample >${WRKSRC}/squid.sh.sample
+	@env SQUID_UID=${SQUID_UID} SQUID_GID=${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 sbin_file in client squid
-	if [ -f ${PREFIX}/sbin/${sbin_file} ] ; then \
-		${STRIP_CMD} ${PREFIX}/sbin/${sbin_file} ; \
-	fi
+.ifdef WITH_SQUID_PINGER
+	cd ${WRKSRC}; make install-pinger; \
+	${STRIP_CMD} ${PREFIX}/libexec/pinger; \
+	${CHMOD} 4710 ${PREFIX}/libexec/pinger; \
+	${CHGRP} ${SQUID_GID} ${PREFIX}/libexec/pinger
+.endif
+.for dir in libexec sbin
+.for file in ${${dir}}
+	${STRIP_CMD} ${PREFIX}/${dir}/${file}
+.endfor
 .endfor
-.for libexec_file in cachemgr.cgi dnsserver pinger unlinkd
-	if [ -f ${PREFIX}/libexec/${libexec_file} ] ; then \
-		${STRIP_CMD} ${PREFIX}/libexec/${libexec_file} ; \
-	fi
+	${INSTALL_SCRIPT} ${WRKSRC}/squid.sh.sample ${PREFIX}/etc/rc.d
+.if !defined(NOPORTDOCS)
+	${MKDIR} ${DOCSDIR}
+	${INSTALL_DATA} ${WRKDIR}/FAQ*.html ${DOCSDIR}
+.for file in ${docs}
+	${INSTALL_MAN} ${WRKSRC}/${file} ${DOCSDIR}
 .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 ${FILESDIR}/squid.sh ${PREFIX}/etc/rc.d/squid.sh; \
-	fi
+.endif
+	@env PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
 
 .include <bsd.port.mk>
Index: projekte/FreeBSD/ports/www/squid/distinfo
diff -u projekte/FreeBSD/ports/www/squid/distinfo:1.1.1.1 projekte/FreeBSD/ports/www/squid/distinfo:1.1.1.2
--- projekte/FreeBSD/ports/www/squid/distinfo:1.1.1.1	Sun Nov  9 17:46:23 2003
+++ projekte/FreeBSD/ports/www/squid/distinfo	Sun Nov  9 17:48:19 2003
@@ -1,24 +1,11 @@
-MD5 (squid2.5/squid-2.5.STABLE3.tar.bz2) = ed5eb7835d00fdecc7dd7c1837542df2
-MD5 (squid2.5/squid-2.5.STABLE3-deny_info.patch) = fd6d2d1a5a75b06e86b743f51866c861
-MD5 (squid2.5/squid-2.5.STABLE3-cache_dir_doc.patch) = e7f6d2bd28430e10999b12001cbb4cae
-MD5 (squid2.5/squid-2.5.STABLE3-devnull.patch) = a31d669461e2893996f27b5d10ab06b9
-MD5 (squid2.5/squid-2.5.STABLE3-log_quote.patch) = 9e391cbb39226abc89281cd4138ddb98
-MD5 (squid2.5/squid-2.5.STABLE3-rfc_reference.patch) = 48996215282d80caf3b5cbbbdb7965b7
-MD5 (squid2.5/squid-2.5.STABLE3-external_acl_ident.patch) = a7ab2152b202bf9941ee8200f20b3032
-MD5 (squid2.5/squid-2.5.STABLE3-gcc-3_3.patch) = 49195dd7f3745c0f54c0ca07068b2d67
-MD5 (squid2.5/squid-2.5.STABLE3-carpfactor.patch) = ac2a5f8304b29951ee3579cce10a6ea6
-MD5 (squid2.5/squid-2.5.STABLE3-neighbor_type_domain.patch) = 3edd72ec42e0b49b36096a6a8fff6b2a
-MD5 (squid2.5/squid-2.5.STABLE3-header_access_peer.patch) = 5015f95e0db20ddcb25082a92f8861a8
-MD5 (squid2.5/squid-2.5.STABLE3-memwarnsbrk.patch) = 47cc7566f9584c6f8c764afcb95ce636
-MD5 (squid2.5/squid-2.5.STABLE3-hostscomments.patch) = dabea14824e5b3d48b211c933471036a
-MD5 (squid2.5/squid-2.5.STABLE3-store_check_cachable_stats.patch) = 04477bf0722026a67bbd6954b02c9374
-MD5 (squid2.5/squid-2.5.STABLE3-cachePeerPingsSentsnmp.patch) = b0ecd095062a21d72b15a817f4e821b5
-MD5 (squid2.5/squid-2.5.STABLE3-minimum_retry_timeout.patch) = b265b000b2f5d48a385f68c6d987cbea
-MD5 (squid2.5/squid-2.5.STABLE3-tcp_reset_leak.patch) = 49c5aeb54467e7cbf44edd2271006bb3
-MD5 (squid2.5/squid-2.5.STABLE3-hostheader.patch) = b786122d2353e1e607d1d02e18a86b61
-MD5 (squid2.5/squid-2.5.STABLE3-reply_body_max_size.patch) = f869e793478ad6c3c706424d0236dcaa
-MD5 (squid2.5/squid-2.5.STABLE3-ie_refresh.patch) = 82bfba0cde950541c6aef5e8b52db010
-MD5 (squid2.5/squid-2.5.STABLE3-http_reply_access-denied.patch) = 2abe9bd50e6561251dfd96d2583d15bc
-MD5 (squid2.5/squid-2.5.STABLE3-SENT_PASV.patch) = c394ec388054b1f86d419006250400bd
-MD5 (squid2.5/squid-2.5.STABLE3-peer_digest_not_found_assertion.patch) = f071e6e3ba5a56ce5d0350d7528b597c
-MD5 (squid2.5/squid-2.5.STABLE3-round_robin_max_size.patch) = 081a220c874765395394baa4482a8913
+MD5 (squid2.5/squid-2.5.STABLE4.tar.gz) = e1ffa9ff3bdf40919089bd2693ea599b
+MD5 (squid2.5/squid-2.5.STABLE4-reconfigure_message.patch) = a746143deab8b609730660916a297618
+MD5 (squid2.5/squid-2.5.STABLE4-digest_auth_pwchange.patch) = e5020f5b87a92c4d9621ce25403d691b
+MD5 (squid2.5/squid-2.5.STABLE4-redirect_login_space.patch) = 2374ed6dae7ef57c009e2428284d6b65
+MD5 (squid2.5/squid-2.5.STABLE4-fqdnnegcache.patch) = ae1b7cce41ca403ebd7115d4506b0c25
+MD5 (squid2.5/pam_auth-2.2.patch) = 3037a67d8f4b85cd7d51cb2dd5b4e8b8
+MD5 (squid2.5/squid-2.5.STABLE4_auth_param_doc.patch) = 3b35c424db58c71c541563cd5ae39d15
+MD5 (squid2.5/squid-2.5.STABLE4-error_load_text.patch) = 3935a3005d125f55cd78b228eba20647
+MD5 (squid2.5/squid-2.5.STABLE4-xpi_mime.patch) = 1143fb9244690a24450c3c9ce6105da4
+MD5 (squid2.5/squid-2.5.STABLE4-size_overflow.patch) = 7cd2d6b1ebbd86aa143fa5a57156d6ce
+MD5 (squid2.5/FAQ.tar.gz) = IGNORE
Index: projekte/FreeBSD/ports/www/squid/pkg-deinstall
diff -u /dev/null projekte/FreeBSD/ports/www/squid/pkg-deinstall:1.1.1.1
--- /dev/null	Sun Nov  9 19:39:45 2003
+++ projekte/FreeBSD/ports/www/squid/pkg-deinstall	Sun Nov  9 17:48:20 2003
@@ -0,0 +1,41 @@
+#! /bin/sh
+#
+# $FreeBSD$
+#
+
+PATH=/bin:/usr/bin:/usr/sbin:${PKG_PREFIX:-/usr/local}/sbin
+pkgname=$1
+
+case $2 in
+	DEINSTALL)
+	if ps -axc | grep -q squid; then
+		echo "It seems squid is still running. I will try to shut it down:"
+		squid -k shutdown
+		while ps -axc | grep -q squid; do
+			sleep 5
+		done
+		if ps -axc | grep -q squid; then
+			echo "could not stop squid -- aborting the deinstallation process!"
+			exit 1
+		fi
+	fi
+	echo "squid is not running, starting the deinstallation..."
+	;;
+	POST-DEINSTALL)
+	echo "==> post-deinstallation information for ${pkgname}"
+	echo ""
+	echo "    Please note that ${pkgname} was not completely removed"
+	echo "    from this system."
+	echo ""
+	echo "    The cache and log directories, squid's user account,"
+	echo "    and any modified configuration files have been preserved"
+	echo "    in case you want to install an updated version of squid"
+	echo "    on this system. You must remove them manually if you do"
+	echo "    not want to use squid any longer."
+	echo ""
+	;;
+	*)
+	exit 64
+	;;
+esac
+exit 0
Index: projekte/FreeBSD/ports/www/squid/pkg-install
diff -u projekte/FreeBSD/ports/www/squid/pkg-install:1.1.1.1 projekte/FreeBSD/ports/www/squid/pkg-install:1.1.1.2
--- projekte/FreeBSD/ports/www/squid/pkg-install:1.1.1.1	Sun Nov  9 17:46:23 2003
+++ projekte/FreeBSD/ports/www/squid/pkg-install	Sun Nov  9 17:48:20 2003
@@ -1,44 +1,84 @@
 #!/bin/sh
+#
+# $FreeBSD$
+#
 
-PKGNAME=$1
+PATH=/bin:/usr/bin:/usr/sbin
+pkgname=$1
+squid_base=${PKG_PREFIX:-/usr/local}/squid
+squid_conf=${PKG_PREFIX:-/usr/local}/etc/squid
+squid_user=${SQUID_UID:=squid}
+squid_group=${SQUID_GID:=squid}
 
 case $2 in
-    PRE-INSTALL)
+	PRE-INSTALL)
+	echo "==> Pre-installation configuration for ${pkgname}"
+	# XXX: Check whether pw really exists (pre 2.2.8 Systems)?
+	if ! pw groupshow ${squid_group} >/dev/null 2>&1; then
+		echo "There is no group \"${squid_group}\" on this system, so I will try to create one:"
+		pw groupadd ${squid_group}
+	else
+		echo "I will use the existing group \"${squid_group}\"."
+	fi
+	if ! pw usershow ${squid_user} >/dev/null 2>&1; then
+		echo "There is no account \"${squid_user}\" on this system, so I will try to create it:"
+		pw useradd ${squid_user} -c "squid caching-proxy pseudo user" -g ${squid_group} -d "${squid_base}" -s "/sbin/nologin" -h -
+		echo "Success! The \"${squid_user}\" account has been created with the following settings:"
+		pw usershow ${squid_user}
+	else
+		echo "I will use the existing account \"${squid_user}\"."
+		tput md
+		echo ""
+		echo "PLEASE NOTICE: An already present account will be used for squid."
+		echo "This might be a security risk, please check this account's privileges"
+		echo "carefully before starting squid!"
+		echo ""
+		tput me
+		if [ -z "${PACKAGE_BUILDING}" ]; then
+			sleep 10
+		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_conf} ]; then
+		echo "Creating ${squid_conf}..."
+		install -d -o root -g ${squid_group} -m 0750 ${squid_conf}
+	fi
 	;;
-    POST-INSTALL)
-	echo "==> Post-installation configuration of ${PKGNAME}"
+	POST-INSTALL)
+	# Install default configuration files:
+	for file in mime.conf squid.conf; do
+	if [ -f ${squid_conf}/${file}.default -a ! -f ${squid_conf}/${file} ]; then
+		echo "Creating ${file}..."
+		cp ${squid_conf}/${file}.default ${squid_conf}/${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_conf}."
+	echo "      A sample startup script was installed to ${PREFIX}/etc/rc.d/."
 	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 Note that if you run squid for the first time on this"
+	echo "      system, you will need to initialize the cache directory."
+	echo "      You can do this by running \"squid -z\" as root."
 	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 The default configuration will deny everyone access to the"
+	echo "      proxy service. Edit the \"http_access\" directives in"
+	echo "      ${PKG_PREFIX}/etc/squid/squid.conf to suit your needs."
 	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!"
-	tput me
-	if [ -z "${PACKAGE_BUILDING}" ]; then read skip; fi
-	chown root:wheel ${PREFIX}/etc/squid/squid.conf*
-	chmod 644 ${PREFIX}/etc/squid/squid.conf*
-	[ -f ${PREFIX}/etc/squid/squid.conf ] || \
-		cp -fp	${PREFIX}/etc/squid/squid.conf.default \
-			${PREFIX}/etc/squid/squid.conf
-	[ -f ${PREFIX}/etc/squid/mime.conf ] || \
-		cp -fp	${PREFIX}/etc/squid/mime.conf.default \
-			${PREFIX}/etc/squid/mime.conf
-	${EDITOR:-vi} ${PREFIX}/etc/squid/squid.conf \
-		      ${PREFIX}/etc/squid/mime.conf
 	;;
-    *)
-	echo "Unexpected Argument $2!!!"
-	exit 1
+	*)
+	exit 64
 	;;
 esac
 exit 0
Index: projekte/FreeBSD/ports/www/squid/pkg-plist
diff -u projekte/FreeBSD/ports/www/squid/pkg-plist:1.1.1.1 projekte/FreeBSD/ports/www/squid/pkg-plist:1.1.1.2
--- projekte/FreeBSD/ports/www/squid/pkg-plist:1.1.1.1	Sun Nov  9 17:46:23 2003
+++ projekte/FreeBSD/ports/www/squid/pkg-plist	Sun Nov  9 17:48:20 2003
@@ -1,4 +1,5 @@
-etc/rc.d/squid.sh
+@unexec rm -f %D/etc/rc.d/squid.sh
+etc/rc.d/squid.sh.sample
 etc/squid/icons/anthony-binhex.gif
 etc/squid/icons/anthony-bomb.gif
 etc/squid/icons/anthony-box.gif
@@ -461,6 +462,30 @@
 etc/squid/errors/Korean/ERR_URN_RESOLVE
 etc/squid/errors/Korean/ERR_WRITE_ERROR
 etc/squid/errors/Korean/ERR_ZERO_SIZE_OBJECT
+etc/squid/errors/Lithuanian/ERR_ACCESS_DENIED
+etc/squid/errors/Lithuanian/ERR_CACHE_ACCESS_DENIED
+etc/squid/errors/Lithuanian/ERR_CACHE_MGR_ACCESS_DENIED
+etc/squid/errors/Lithuanian/ERR_CANNOT_FORWARD
+etc/squid/errors/Lithuanian/ERR_CONNECT_FAIL
+etc/squid/errors/Lithuanian/ERR_DNS_FAIL
+etc/squid/errors/Lithuanian/ERR_FORWARDING_DENIED
+etc/squid/errors/Lithuanian/ERR_FTP_DISABLED
+etc/squid/errors/Lithuanian/ERR_FTP_FAILURE
+etc/squid/errors/Lithuanian/ERR_FTP_PUT_CREATED
+etc/squid/errors/Lithuanian/ERR_FTP_PUT_ERROR
+etc/squid/errors/Lithuanian/ERR_FTP_PUT_MODIFIED
+etc/squid/errors/Lithuanian/ERR_INVALID_REQ
+etc/squid/errors/Lithuanian/ERR_INVALID_URL
+etc/squid/errors/Lithuanian/ERR_LIFETIME_EXP
+etc/squid/errors/Lithuanian/ERR_NO_RELAY
+etc/squid/errors/Lithuanian/ERR_ONLY_IF_CACHED_MISS
+etc/squid/errors/Lithuanian/ERR_READ_ERROR
+etc/squid/errors/Lithuanian/ERR_READ_TIMEOUT
+etc/squid/errors/Lithuanian/ERR_SOCKET_FAILURE
+etc/squid/errors/Lithuanian/ERR_UNSUP_REQ
+etc/squid/errors/Lithuanian/ERR_URN_RESOLVE
+etc/squid/errors/Lithuanian/ERR_WRITE_ERROR
+etc/squid/errors/Lithuanian/ERR_ZERO_SIZE_OBJECT
 etc/squid/errors/Polish/ERR_ACCESS_DENIED
 etc/squid/errors/Polish/ERR_CACHE_ACCESS_DENIED
 etc/squid/errors/Polish/ERR_CACHE_MGR_ACCESS_DENIED
@@ -812,26 +837,61 @@
 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/msntauth.conf %D/etc/squid/msntauth.conf.default; then rm -f %D/etc/squid/msntauth.conf; fi
+etc/squid/msntauth.conf.default
 @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
+%%DIGEST_AUTH_HELPER%%libexec/digest_pw_auth
 libexec/ip_user_check
-libexec/yp_auth
-libexec/pam_auth
+%%LDAP_AUTH_HELPER%%libexec/squid_ldap_auth
+%%LDAP_AUTH_HELPER%%libexec/squid_ldap_group
+libexec/msnt_auth
 libexec/ncsa_auth
+libexec/ntlm_auth
+libexec/pam_auth
+libexec/yp_auth
 libexec/squid_unix_group
+%%DNSSERVER%%libexec/dnsserver
+%%PINGER%%libexec/pinger
+%%UNLINKD%%libexec/unlinkd
 sbin/RunAccel
 sbin/RunCache
 sbin/squidclient
 sbin/squid
-@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
+%%PORTDOCS%%%%DOCSDIR%%/FAQ.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-1.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-2.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-3.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-4.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-5.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-6.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-7.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-8.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-9.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-10.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-11.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-12.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-13.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-14.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-15.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-16.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-17.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-18.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-19.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-20.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-21.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-22.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-23.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-24.html
+%%PORTDOCS%%%%DOCSDIR%%/FAQ-25.html
+%%PORTDOCS%%%%DOCSDIR%%/QUICKSTART
+%%PORTDOCS%%%%DOCSDIR%%/README
+%%PORTDOCS%%%%DOCSDIR%%/RELEASENOTES.html
+%%PORTDOCS%%%%DOCSDIR%%/debug-sections.txt
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
+@dirrm etc/squid/icons
 @dirrm etc/squid/errors/Bulgarian
 @dirrm etc/squid/errors/Catalan
 @dirrm etc/squid/errors/Czech
@@ -847,6 +907,7 @@
 @dirrm etc/squid/errors/Italian
 @dirrm etc/squid/errors/Japanese
 @dirrm etc/squid/errors/Korean
+@dirrm etc/squid/errors/Lithuanian
 @dirrm etc/squid/errors/Polish
 @dirrm etc/squid/errors/Portuguese
 @dirrm etc/squid/errors/Romanian
@@ -859,9 +920,8 @@
 @dirrm etc/squid/errors/Swedish
 @dirrm etc/squid/errors/Traditional_Chinese
 @dirrm etc/squid/errors/Turkish
-@dirrm etc/squid/icons
-@dirrm etc/squid/errors
-@dirrm etc/squid
-@dirrm squid/logs
-@dirrm squid/cache
-@dirrm squid
+@unexec rmdir %D/etc/squid/errors 2>/dev/null || true
+@unexec rmdir %D/etc/squid 2>/dev/null || true
+@unexec rmdir %D/squid/logs 2>/dev/null || true
+@unexec rmdir %D/squid/cache 2>/dev/null || true
+@unexec rmdir %D/squid 2>/dev/null || true
Index: projekte/FreeBSD/ports/www/squid/files/FAQ.html.patch
diff -u /dev/null projekte/FreeBSD/ports/www/squid/files/FAQ.html.patch:1.1.1.1
--- /dev/null	Sun Nov  9 19:39:45 2003
+++ projekte/FreeBSD/ports/www/squid/files/FAQ.html.patch	Sun Nov  9 17:48:20 2003
@@ -0,0 +1,19 @@
+--- ../FAQ.html.orig	Sat Mar 15 16:45:25 2003
++++ ../FAQ.html		Sat Mar 15 16:47:30 2003
+@@ -16,11 +16,11 @@
+ Object Cache software.</EM>
+ <HR>
+ <P>You can download the FAQ as
+-<A HREF="FAQ.pdf">PDF</A>, 
+-<A HREF="FAQ.ps.gz">compressed Postscript</A>, 
+-<A HREF="FAQ.txt">plain text</A>,
+-<A HREF="FAQ.sgml">linuxdoc SGML source</A> or as a
+-<A HREF="FAQ.tar.gz">compressed tar of HTML</A>.
++<A HREF="http://www.squid-cache.org/Doc/FAQ/FAQ.pdf">PDF</A>, 
++<A HREF="http://www.squid-cache.org/Doc/FAQ/FAQ.ps.gz">compressed Postscript</A>, 
++<A HREF="http://www.squid-cache.org/Doc/FAQ/FAQ.txt">plain text</A>,
++<A HREF="http://www.squid-cache.org/Doc/FAQ/FAQ.sgml">linuxdoc SGML source</A> or as a
++<A HREF="http://www.squid-cache.org/Doc/FAQ/FAQ.tar.gz">compressed tar of HTML</A>.
+ <P>
+ <H2><A NAME="toc1">1.</A> <A HREF="FAQ-1.html">About Squid, this FAQ, and other Squid information resources</A></H2>
+ 
Index: projekte/FreeBSD/ports/www/squid/files/patch-errors-German
diff -u /dev/null projekte/FreeBSD/ports/www/squid/files/patch-errors-German:1.1.1.1
--- /dev/null	Sun Nov  9 19:39:46 2003
+++ projekte/FreeBSD/ports/www/squid/files/patch-errors-German	Sun Nov  9 17:48:20 2003
@@ -0,0 +1,10 @@
+--- errors/German/ERR_DNS_FAIL.orig	Wed Aug 28 23:07:42 2002
++++ errors/German/ERR_DNS_FAIL	Sun Nov  9 16:05:06 2003
+@@ -3,6 +3,7 @@
+ <TITLE>FEHLER: Der angeforderte URL konnte nicht geholt werden</TITLE>
+ <STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
+ </HEAD><BODY>
++<H1>FEHLER</H1>
+ <H2>Der angeforderte URL konnte nicht geholt werden</H2>
+ <HR noshade size="1px">
+ <P>
Index: projekte/FreeBSD/ports/www/squid/files/patch-src-cf.data.pre
diff -u /dev/null projekte/FreeBSD/ports/www/squid/files/patch-src-cf.data.pre:1.1.1.1
--- /dev/null	Sun Nov  9 19:39:46 2003
+++ projekte/FreeBSD/ports/www/squid/files/patch-src-cf.data.pre	Sun Nov  9 17:48:20 2003
@@ -0,0 +1,20 @@
+--- src/cf.data.pre.orig	Thu May  1 14:07:51 2003
++++ src/cf.data.pre	Thu May  1 14:13:12 2003
+@@ -2325,7 +2325,7 @@
+ 
+ NAME: cache_effective_user
+ TYPE: string
+-DEFAULT: nobody
++DEFAULT: %%SQUID_UID%%
+ LOC: Config.effectiveUser
+ DOC_NONE
+ 
+@@ -2337,7 +2337,7 @@
+ 
+ 	If you start Squid as root, it will change its effective/real
+ 	UID/GID to the UID/GID specified below.  The default is to
+-	change to UID to nobody.  If you define cache_effective_user,
++	change to UID to %%SQUID_UID%%.  If you define cache_effective_user,
+ 	but not cache_effective_group, Squid sets the GID the
+ 	effective user's default group ID (taken from the password
+ 	file).
Index: projekte/FreeBSD/ports/www/squid/files/squid.sh
diff -u projekte/FreeBSD/ports/www/squid/files/squid.sh:1.1.1.1 projekte/FreeBSD/ports/www/squid/files/squid.sh:removed
--- projekte/FreeBSD/ports/www/squid/files/squid.sh:1.1.1.1	Sun Nov  9 17:46:23 2003
+++ projekte/FreeBSD/ports/www/squid/files/squid.sh	Sun Nov  9 19:39:46 2003
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
-    echo "$0: Cannot determine the PREFIX" >&2
-    exit 1
-fi
-
-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'
-	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 
-	;;
-*)
-	echo "Usage: `basename $0` {start|stop}" >&2
-	;;
-esac
-
-exit 0
Index: projekte/FreeBSD/ports/www/squid/files/squid.sh.sample
diff -u /dev/null projekte/FreeBSD/ports/www/squid/files/squid.sh.sample:1.1.1.1
--- /dev/null	Sun Nov  9 19:39:46 2003
+++ projekte/FreeBSD/ports/www/squid/files/squid.sh.sample	Sun Nov  9 17:48:20 2003
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+PREFIX=%%PREFIX%%
+
+squid_conf=${PREFIX}/etc/squid/squid.conf
+squid_logdir=${PREFIX}/squid/logs
+# See squid(8) for a list of possible options:
+squid_opts=""
+squid_user=%%SQUID_UID%%
+
+case $1 in
+	start)
+	if [ -x ${PREFIX}/sbin/squid -a -f ${squid_conf} ]; then
+		echo -n ' squid'
+		(cd ${squid_logdir} && exec su -fm ${squid_user} -c "{PREFIX}/sbin/squid -f ${squid_conf} ${squid_opts}")
+	fi
+	;;
+	stop)
+	if [ -x ${PREFIX}/sbin/squid ]; then
+		echo -n ' squid'
+		${PREFIX}/sbin/squid -k shutdown
+		# Uncomment this if you'd like the system to attempt to
+		# wait for squid to shut down cleanly:
+		#while ps -axc | grep -q squid; do
+		#	sleep 5
+		#done
+	fi
+	;;
+	*)
+	echo "Usage: `basename $0` {start|stop}" >&2
+	exit 64
+	;;
+esac
+exit 0
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031109185210.21773.qmail>