Subject: pkg/10899: Fix to cddbd to allow non-interactive builds
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jchacon@genuity.net>
List: netbsd-bugs
Date: 08/26/2000 23:46:16
>Number:         10899
>Category:       pkg
>Synopsis:       pkgsrc/audio/cddbd is currently marked non-interactive.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 26 23:47:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     James Chacon
>Release:        sup'd sources as of 08-25-00
>Organization:
>Environment:
System: NetBSD quix 1.5_ALPHA NetBSD 1.5_ALPHA (QUIX) #0: Mon Jul 10 20:31:02 EDT 2000 root@quix:/usr/src/sys/arch/i386/compile/QUIX i386


>Description:

pkgsrc/audio/cddbd is currently non-buildable in batch mode due to the
following 2 lines in the Makefile:

IS_INTERACTIVE=        yes
NO_PACKAGE=    too interactive

The only reason this occurs is due to having to specify the path to the cddbd
access file. 

>How-To-Repeat:

Build pkgsrc/audio/cddbd. It stops and asks questions.

>Fix:

The supplied patches below will fix this. This adds a new var to mk.conf 
(CDDBD_ACCESS) and patches Makefile, files/patch-sum and adds patches/patch-ad.
I've tested builds with $CDDBD_ACCESS set and not set and both compile cleanly
and give the expected results for the access file location. Watch the tabs
on patch-ad when copying this around as the original source has hard tabs
and patch will bail if those get converted back to spaces.

--------------------------------------------------------------------------------
pkgsrc/mk/mk.conf.example:

Index: mk.conf.example
===================================================================
RCS file: /usr/local/cvs/pkgsrc/mk/mk.conf.example,v
retrieving revision 1.4
retrieving revision 1.1.1.1.2.3
diff -u -r1.4 -r1.1.1.1.2.3
--- mk.conf.example	2000/08/15 06:27:37	1.4
+++ mk.conf.example	2000/08/27 06:38:51	1.1.1.1.2.3
@@ -277,6 +277,12 @@
 # Possible: defined, not defined
 # Default: not defined
 
+#CDDBD_ACCESS=
+# Used in cddbd to determine where to install cddbd access file dir.
+# If not defined it will default to: ${PREFIX}/share/xmcd/cddbd
+# Possible: not defined, DIR
+# Default: not defined
+
 #DEFAULT_IRC_SERVER=
 # Used in ircII to set the default irc server. 
 # Possible: see the list at

--------------------------------------------------------------------------------
/usr/local/cvs/pkgsrc/audio/cddbd/Makefile:

Index: Makefile
===================================================================
RCS file: /usr/local/cvs/pkgsrc/audio/cddbd/Makefile,v
retrieving revision 1.1
retrieving revision 1.1.1.1.2.3
diff -u -r1.1 -r1.1.1.1.2.3
--- Makefile	2000/07/10 04:47:30	1.1
+++ Makefile	2000/08/27 04:44:25	1.1.1.1.2.3
@@ -13,12 +13,10 @@
 MAINTAINER=	bjn@visi.com
 HOMEPAGE=	http://www.moonsoft.com/software.html
 
-IS_INTERACTIVE=	yes
-NO_PACKAGE=	too interactive
 MAKEFILE=	makefile
 
 do-configure:
-	@( cd ${WRKSRC} && BASEDIR=${PREFIX}/share sh config.sh )
+	@( cd ${WRKSRC} && BASEDIR=${PREFIX}/share CDDBD_ACCESS=${CDDBD_ACCESS} sh config.sh )
 
 do-install:
 	@( cd ${WRKSRC} && INSTALL=${INSTALL} BINDIR=${PREFIX}/bin \

--------------------------------------------------------------------------------
/usr/local/cvs/pkgsrc/audio/cddbd/files/patch-sum:

Index: patch-sum
===================================================================
RCS file: /usr/local/cvs/pkgsrc/audio/cddbd/files/patch-sum,v
retrieving revision 1.1
retrieving revision 1.1.1.1.2.4
diff -u -r1.1 -r1.1.1.1.2.4
--- patch-sum	2000/07/10 04:47:30	1.1
+++ patch-sum	2000/08/27 06:38:04	1.1.1.1.2.4
@@ -3,3 +3,4 @@
 MD5 (patch-aa) = 51e70bc45a5ed5486db780bdc274b158
 MD5 (patch-ab) = 41db571fdfb510e718cb1c1e6d1becfa
 MD5 (patch-ac) = a013e8caf2d80259eb0007aa0ebe361c
+MD5 (patch-ad) = 3017dae3c828405f3c4fc677ad7e1d4c

--------------------------------------------------------------------------------
/usr/local/cvs/pkgsrc/audio/cddbd/patches/patch-ad:

$NetBSD$

--- config.sh.orig	Sun Aug 27 02:33:48 2000
+++ config.sh	Sun Aug 27 02:34:25 2000
@@ -144,23 +144,11 @@
 	BASEDIR=`echo $BASEDIR | sed 's/\/\//\//g'`
 fi
 
-ACCESS=${BASEDIR}/xmcd/cddbd
-
-while :
-do
-	if getstr "\nEnter the path to the cddbd access file dir\n[${ACCESS}]"
-	then
-		if [ -d `dirname "$ANS"` ]
-		then
-			ACCESS=$ANS
-			break
-		else
-			$ECHO "Error: $ANS does not exist."
-		fi
-	else
-		break
-	fi
-done
+if [ "$CDDBD_ACCESS" != "" ]; then
+       ACCESS=$CDDBD_ACCESS
+else
+        ACCESS=${BASEDIR}/xmcd/cddbd
+fi
 
 echo
 
>Release-Note:
>Audit-Trail:
>Unformatted:
                 A simple patch fixes this.