From owner-freebsd-ports@FreeBSD.ORG Tue Nov 23 20:27:52 2004 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 16BCD16A4CE for ; Tue, 23 Nov 2004 20:27:52 +0000 (GMT) Received: from ha-smtp1.tiscali.nl (smtp-b2c.tiscali.nl [195.241.80.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E7A343D46 for ; Tue, 23 Nov 2004 20:27:51 +0000 (GMT) (envelope-from a.nooit@12move.nl) Received: from luckyluke (xs195-241-25-50.dial.12move.nl [195.241.25.50]) by ha-smtp1.tiscali.nl (Postfix) with SMTP id 6DD8785E993; Tue, 23 Nov 2004 21:27:49 +0100 (CET) From: "A. Nooitgedagt" To: "Kris Kennaway" Date: Tue, 23 Nov 2004 21:27:52 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <20041123181119.GB91215@xor.obsecurity.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Importance: Normal cc: freebsd-ports@freebsd.org Subject: RE: Pass variable to pkg-install X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2004 20:27:52 -0000 > -----Original Message----- > From: owner-freebsd-ports@freebsd.org > [mailto:owner-freebsd-ports@freebsd.org]On Behalf Of Kris Kennaway > Sent: dinsdag 23 november 2004 19:11 > To: A. Nooitgedagt > Cc: freebsd-ports@freebsd.org > Subject: Re: Pass variable to pkg-install > > > On Tue, Nov 23, 2004 at 11:44:22AM +0100, A. Nooitgedagt wrote: > > Actually, > > > > It does work to set variables in SCRIPTS_ENV ! > > I just shouldn't manipulate them in pkg-install I guess. I'm > still not sure > > how it works. > > > > This is what I have as a test in Makefile: > > > > " > > pre-fetch: > > @ ${SETENV} PKG_PREFIX=${PREFIX} \ > > ${SCRIPTS_ENV} USER=${USER} PG_USER=${PG_USER} GROUP=${GROUP} > > UID=${UID} GID=${GID} \ > > ${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL > > " > > > > I didn't find good docs about how a statement like that gets > translate or > > did I miss something. > > Any pointer? > > Be careful what you do here, because the pkg-install script is also > run when someone adds (or removes) your package with pkg_add, so it > needs to work properly in that case too (and it will not if you > customize the way that pkg-install is called) > > Kris Ouch, pkg_add doesn't read the makefile variables.... That complicates things even more. Would it be an option to create a config.sh on the fly while processing the Makefile (no interactive configure): http://www.freebsd.org/cgi/cvsweb.cgi/ports/net/cvsup-mirror/scripts/configu re script: --------------------------------- #! /bin/sh variables="USER GROUP UID GID" echo "" echo -n "Building the \"config.sh\" file ... " for var in ${variables}; do eval echo ${var}=\\\"\${${var}}\\\" done > ${WRKSRC}/config.sh echo "Done." --------------------------------- pkg-install: --------------------------------- . ${base}/config.sh || exit --------------------------------- Or something like that.... Would that be a good option or is there a less complicated example that would also work for pkg_add? Aldert