From owner-freebsd-ports@FreeBSD.ORG Fri Sep 3 00:34:43 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 24AE016A4CF for ; Fri, 3 Sep 2004 00:34:43 +0000 (GMT) Received: from daphne.michaelchaney.com (mail.michaelchaney.com [207.65.84.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9D59143D31 for ; Fri, 3 Sep 2004 00:34:42 +0000 (GMT) (envelope-from bandix@home.funnyvalentine.net) Received: from adsl-065-007-237-012.sip.bna.bellsouth.net (home.funnyvalentine.net) [65.7.237.12] by daphne.michaelchaney.com with esmtp (Exim 4.20 #1 (FreeBSD)) id 1C321A-000OPT-50; Thu, 02 Sep 2004 19:33:28 -0500 Received: from home.funnyvalentine.net (jvlfzegx2ud5rc09@dallben [127.0.0.1]) i830XQrH005481; Thu, 2 Sep 2004 19:33:26 -0500 (CDT) (envelope-from bandix@home.funnyvalentine.net) Received: (from bandix@localhost) by home.funnyvalentine.net (8.12.10/8.12.10/Submit) id i830XQDG005480; Thu, 2 Sep 2004 19:33:26 -0500 (CDT) (envelope-from bandix) Date: Thu, 2 Sep 2004 19:33:26 -0500 From: "Brandon D. Valentine" To: Mike Message-ID: <20040903003326.GA211@brandon.dvalentine.com> References: <19DD9455-FCF9-11D8-B720-00039312D914@fillmore-labs.com> <1094148684.78074.18.camel@torres> <20040902181730.GC3801@odin.ac.hmc.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040902181730.GC3801@odin.ac.hmc.edu> User-Agent: Mutt/1.5.6i X-MailScanner-Information: Please see http://www.michaelchaney.com/mail/spam.php for more information X-MailScanner: Found to be clean X-MailScanner-SpamCheck: not spam, SpamAssassin (score=-2.501, required 3.5, BAYES_00 -4.90, OPT_HEADER 2.40) X-MailScanner-From: bandix@home.funnyvalentine.net cc: freebsd-ports@freebsd.org Subject: Re: PREFIX "cleverness" 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: Fri, 03 Sep 2004 00:34:43 -0000 On Thu, Sep 02, 2004 at 11:17:30AM -0700, Brooks Davis wrote: > Due to the hardcoding of LOCALBASE in dependencies, I think you will > have a hard time getting this sort of thing to work with ports unless > you also create a symlink farm and point LOCALBASE to it. You might > actually consider using NetBSD's pkgsrc. It has a lot less packages, > but is supports installations of many current packages in a more xhier > compatable fasion using the pkgviews concept. Mike, Brooks is right, NetBSD pkgsrc is far better suited to this than FreeBSD ports at present. But, pkgsrc has far fewer packages than ports, so there's a definite advantage to using ports if you can. There are ways to do this using ports, but it will require a fair bit of "cleverness" on your part. If you want to use the ports system an approach to consider is a port building wrapper that does something along the lines of the following quick hack (in csh because I'm quicker at prototyping in csh than sh): ### quick and dirty porthier script... ### usage: porthier portpath ### i.e. porthier /usr/ports/multimedia/xmms ### ### uses the full path because I'm lazy and don't want to muck about ### with finding the pkgorigin to recursively call this script # check for installed run-deps under /software # we'll let ports take care of the build-deps in LOCALBASE set deplist = `make -C $1 run-depends-list` foreach dep ($deplist) set depname = `make -C $dep -V UNIQUENAME` if (! -e /software/$depname) exec $0 $dep end # make symlink farm # we put this into a seperate loop as we don't want the symlink # cleanup from a dependency install to wipe out symlinks we may need cd /usr/local foreach dep ($deplist) set depname = `make -C $dep -V UNIQUENAME` /usr/src/contrib/binutils/symlink-tree /software/$depname end # let's get our install on set pname = `make -C $1 -V UNIQUENAME` make -C $1 PREFIX=/software/$pname install clean # clean up them links foreach dep ($deplist) set depname = `make -C $dep -V UNIQUENAME` cd /software/$depname && find -d . f -exec rm -d "/usr/local/{}" \; end Consider that under the BSD license, particularly the giant all caps disclaimer that says I'm not responsible for any of it, because it's probably crap and I've not tested it. It *should*, maybe _mostly_ work, kinda. Feel free to shit all over it if you think it's horribly broken. You'd obviously want to add a ton more error checking, perhaps some argument list processing so it'll accept more than one argument, etc. but that should be enough for you to get the idea. The key is to automate management (both creation and deletion) of the symlink farm you're going to need under /usr/local. I also don't know enough about xhier to know how much automagic is involved in setting up the user shell environment, but I would assume you're doing the appropriate ld hackery to make sure shared libraries work under this /software scheme. Also, beware the duplicate LATEST_LINK/UNIQUENAMEs still in the tree. Alternately, just use NetBSD pkgsrc and pkgviews. It works quite well on FreeBSD. HTH, Brandon D. Valentine -- brandon@dvalentine.com http://www.geekpunk.net Pseudo-Random Googlism: presidency is ending in triumph after successfully negotiating the terms of entry for 10 candidate members