Subject: pkg/13971: www/squid package fails to install with custom configurations
To: None <gnats-bugs@gnats.netbsd.org>
From: None <dave@dtsp.co.nz>
List: netbsd-bugs
Date: 09/16/2001 11:51:14
>Number:         13971
>Category:       pkg
>Synopsis:       www/squid package fails to install with custom configurations
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 16 04:45:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     David Sainty
>Release:        13/9/2001
>Organization:
Dynamic Technology Services and Products Ltd (NZ)
>Environment:
System: NetBSD tequila.dave.dtsp.co.nz 1.5X NetBSD 1.5X (TEQUILA) #0: Sun Sep 2 16:38:59 NZST 2001 dave@tequila.dave.dtsp.co.nz:/vol/tequila/userB/u2/NetBSD-current/src/sys/arch/i386/compile/TEQUILA i386
Architecture: i386
Machine: i386
>Description:
	The Squid package supports selecting cusom configuration options (in
	/etc/mk.conf).  However the package is not very forgiving when this
	feature is used to select a configuration other than the standard.

>How-To-Repeat:
	The package will fail with an error during installation if the
	following is used.

	echo "SQUID_CONFIGURE_ARGS=" >> /etc/mk.conf

>Fix:
The following patch corrects for the presence of the --disable-unlinkd option,
or the absence of the --enable-icmp option.

--- Makefile.orig	Sun Aug 26 22:48:19 2001
+++ Makefile	Sun Sep 16 23:39:57 2001
@@ -57,6 +57,14 @@
 	@${INSTALL_DATA_DIR} ${PREFIX}/share/squid/errors
 	@${INSTALL_DATA_DIR} ${PREFIX}/share/squid/icons
 	@(							\
+	config="${SQUID_CONFIGURE_ARGS:S/\\/\\\\/g:S/"/\\"/g}";	\
+	case "$$config" in					\
+		*--enable-icmp*) ${ECHO} libexec/pinger;;	\
+	esac;							\
+	case "$$config" in					\
+		*--disable-unlinkd*) ;;				\
+		*) ${ECHO} libexec/unlinkd;;			\
+	esac;							\
 	cd ${WRKSRC}/errors/English;				\
 	ls ERR_* | ${SED} -e 's@^@share/squid/errors/@';		\
 	${ECHO} "@dirrm share/squid/errors";			\
@@ -68,7 +76,10 @@
 	) >>${PLIST_SRC}
 
 post-install:
-	cd ${WRKSRC}/src; ${MAKE} install-pinger
+	@config="${SQUID_CONFIGURE_ARGS:S/\\/\\\\/g:S/"/\\"/g}";	\
+	case "$$config" in \
+		*--enable-icmp*) cd ${WRKSRC}/src; ${MAKE} install-pinger;; \
+	esac
 	${INSTALL_SCRIPT} ${WRKDIR}/squid.sh ${PREFIX}/etc/rc.d/squid
 	@${SETENV} ${MAKE_ENV} ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL
 
--- pkg/PLIST.orig	Sun Aug 26 22:48:20 2001
+++ pkg/PLIST	Sun Sep 16 20:42:29 2001
@@ -4,8 +4,6 @@
 etc/squid/squid.conf.default
 @unexec rmdir %D/etc/squid 2>/dev/null || true
 libexec/cachemgr.cgi
-libexec/pinger
-libexec/unlinkd
 sbin/RunAccel
 sbin/RunCache
 sbin/client
>Release-Note:
>Audit-Trail:
>Unformatted: