Bug 61315 - [Maintainer update] www/squid: massive (mostly infrastructural) update
Summary: [Maintainer update] www/squid: massive (mostly infrastructural) update
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Sergei Kolobov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-13 15:10 UTC by Thomas-Martin Seck
Modified: 2004-01-16 21:52 UTC (History)
0 users

See Also:


Attachments
file.diff (63.51 KB, patch)
2004-01-13 15:10 UTC, Thomas-Martin Seck
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas-Martin Seck 2004-01-13 15:10:18 UTC
At last, the massive overhaul I have been sitting on for months now:
(sorry, it's a huge patch, but it's been tested to compile and install on
4.9-STABLE and 5.2-RELEASE)

- configure squid to run under a dedicated "squid" user by default; make use
  of SQUID_{UID,GID} which other squid-related ports already implemented.
  The user/group will be created on the fly if they do not already exist.
- introduce WITH_SQUID_LDAP_AUTH to pull in the necessary bits to compile and
  use the ldap_auth helper
- install some more authentication helper applications by default
- install helper applications to ${PREFIX}/libexec/squid instead of
  ${PREFIX}/libexec, add notes about it in pkg-install and pkg-descr
- cleanup the pre-installation tasks and move them from Makefile and pkg-plist
  into the pkg-install script; make 'make install' and 'pkg_add' actually do
  the same thing
- introduce a pkg-deinstall script
- make squid.sh rcNG compatible (when either /etc/rc_subr or
  ${PREFIX}/etc/rc_subr is present, the first one will be used, otherwise the
  script will work as a "rc classic" script so no additional dependency on
  the rc_subr port should be needed)
- some Makefile cleanups:
  + the squid installation procedure now correctly strips binaries, so there
    is no need to do this manually anymore
  + generate those parts of pkg-plist dynamically that may be affected by user
    set tunables (currently the localized error pages and helper applications)
  + document the available configuration options in a slightly different style
  + remove some obsolete variable declarations and comments
  + utilize PORTDOCS, honor NOPORTDOCS
- add CONFLICTS
- add another vendor patch, see
  http://www.squid-cache.org/bugs/show_bug.cgi?id=890 for a thorough
  explanation of what has been fixed.
- since we can no longer take the presence of Lithuanian error pages for
  granted, wrap the workaround for the errorpages.patch with '.if exists()'
- bump PORTREVISION

Fix: Here's the patch:
Comment 1 Thomas-Martin Seck 2004-01-14 16:49:21 UTC
A minor update to this monster patch (I knew I'd overlook something,
hopefully there are no other bogons left):

- correct indentation in squid.sh
- make squid_chdir, squid_flags, and squid_user overridable via the
  environment or one of the rcNG configuration files instead of
  hardcoding them. Default squid_flags to "-D", the DNS test does
  not make much sense anymore (IIRC it is no longer turned on in squid-3).

Index: files/squid.sh
===================================================================
RCS file: /usr/local/cvsroot/projekte/FreeBSD/ports/www/squid/files/squid.sh,v
retrieving revision 1.2
diff -u -r1.2 squid.sh
--- files/squid.sh	14 Jan 2004 15:33:47 -0000	1.2
+++ files/squid.sh	14 Jan 2004 16:45:35 -0000
@@ -12,8 +12,7 @@
 # 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 specify additional commandline options for squid using
-# "squid_flags=".
+# you can also set squid_chdir, squid_user, and squid_flags.
 #
 # Please see squid(8), rc.conf(5) and rc(8) for further details.
 
@@ -23,8 +22,9 @@
 extra_commands=reload
 reload_cmd="${command} -k reconfigure"
 stop_cmd="${command} -k shutdown"
-squid_chdir=%%PREFIX%%/squid/logs
-squid_user=%%SQUID_UID%%
+: ${squid_chdir:=%%PREFIX%%/squid/logs}
+: ${squid_user:=%%SQUID_UID%%}
+: ${squid_flags:="-D"}
 default_config=%%PREFIX%%/etc/squid/squid.conf
 
 if [ -f /etc/rc.subr ]; then
@@ -48,9 +48,6 @@
 	required_dirs=${squid_chdir}
 	run_rc_command "$1"
 else
-	# Configure squid_flags directly in the non-rcNG case; see
-	# squid(8) for a list of available options:
-	squid_flags=""
 	case $1 in
 	start)
 		if [ -x "${command}" -a \
@@ -62,11 +59,11 @@
 		;;
 	stop)
 		if [ -x "${command}" ]; then
-		echo -n ' squid'
-		${stop_cmd}
-		while ps -xcU ${squid_user} | grep -q squid; do
-			sleep 2
-		done
+			echo -n ' squid'
+			${stop_cmd}
+			while ps -xcU ${squid_user} | grep -q squid; do
+				sleep 2
+			done
 		fi
 		;;
 		*)
Comment 2 Thomas-Martin Seck 2004-01-15 12:28:23 UTC
The http_workarounds patch has been rerolled:

Index: distinfo
===================================================================
RCS file: /usr/local/cvsroot/projekte/FreeBSD/ports/www/squid/distinfo,v
retrieving revision 1.3
diff -u -r1.3 distinfo
--- distinfo	12 Jan 2004 15:55:40 -0000	1.3
+++ distinfo	15 Jan 2004 12:24:14 -0000
@@ -33,4 +33,4 @@
 MD5 (squid2.5/squid-2.5.STABLE4-partial_reload.patch) = 6d8fa663f46ffc2272b7d18a0b6eea34
 MD5 (squid2.5/squid-2.5.STABLE4-ldap_tls.patch) = dcd6b4ec46e252833a54c4bfd155c284
 MD5 (squid2.5/squid-2.5.STABLE4-ldap_group_bufsize.patch) = e42207a45232ca739a64f2ac3901263c
-MD5 (squid2.5/squid-2.5.STABLE4-http_workarounds.patch) = 861fd5946ac86db9b107c04fe22b2675
+MD5 (squid2.5/squid-2.5.STABLE4-http_workarounds.patch) = 69d958d5120116de3e5efd2b9e30c3ac
Comment 3 Sergei Kolobov freebsd_committer freebsd_triage 2004-01-16 09:55:17 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sergei

Take.
Comment 4 Sergei Kolobov freebsd_committer freebsd_triage 2004-01-16 21:52:07 UTC
State Changed
From-To: open->closed

Committed, thanks!