Subject: Re: pkgsrc php4 install fails mysteriously
To: None <netbsd-help@netbsd.org>
From: James K. Lowden <jklowden@schemamania.org>
List: netbsd-help
Date: 12/18/2002 08:32:31
On Wed, 18 Dec 2002 10:53:53 +0100, Alistair Crooks
<agc@wasabisystems.com> wrote:
> On Tue, Dec 17, 2002 at 11:34:52PM -0500, James K. Lowden wrote:
> > The build builds, and a lot of stuff installs, and then:
> > 
> > [quote]
> > =====================================================================
> > ==== You may wish to customize the following files for php-4.2.3:
> > 
> >         /usr/pkg/etc/php.ini
> > =====================================================================
> > ==== Unexpected argument: 
> > *** Error code 1
> > [end quote]
> 
> If you try doing the install as
> 
> 	make install PKG_DEBUG_LEVEL=2
> 
> it will show you all that you need to know

Alistair, 

Thank you!  Indeed it did show me what's wrong.  It looks like a script is
catenated that shouldn't be.  

The end of "make install" invokes:

	/usr/pkgsrc/www/php4/work/.INSTALL \
		php-4.2.3 POST-INSTALL

and the POST-INSTALL section posts the above message.  Then comes the
oddness.  Here's the body of the script, starting at line 480:

[quote]
# end of install
#! /bin/sh
#
# $NetBSD: INSTALL,v 1.1 2001/11/01 02:18:38 zuntum Exp $

PKGNAME=$1
STAGE=$2

CAT="/bin/cat"
CHMOD="/bin/chmod"
CP="/bin/cp"

SAMPLECONFDIR=${PKG_PREFIX}/share/examples/php
CONFDIR="@PHP_CONFDIR@"
CONFFILES="php.ini"

case ${STAGE} in
[... end quote]

The debug output clearly shows $1 and $2 are not defined:

+ PKGNAME=
+ STAGE=
+ CAT=/bin/cat
+ CHMOD=/bin/chmod

Because $STAGE is empty (because $2 is empty), the switch falls to the
bottom, producing the unobvious "Unexpected argument" error.  

I can trim the tail off the script myself, if the that's the workaround. 
Should I file a PR?  How about cc'ing tech-pkg?

Should you be so inclined, you can view the whole situation at:

http://www.equatejobs.com/php4/

The "make install PKG_DEBUG_LEVEL=2" output is in: 

http://www.equatejobs.com/php4/make_install_debug2_output.txt

Thanks again for the help.  

--jkl