Subject: Re: pkgsrc: WRKDIR / NFS-mounted pkgsrc
To: Florian Stoehr <netbsd@wolfnode.de>
From: Greg A. Woods <woods@weird.com>
List: netbsd-users
Date: 12/22/2004 15:17:36
[ On Wednesday, December 22, 2004 at 12:11:39 (+0100), Florian Stoehr wrote: ]
> Subject: pkgsrc: WRKDIR / NFS-mounted pkgsrc
>
> I need to run pkgsrc build from various machines and architectures in 
> parallel.

Since each of my machines might have a different filesystem on which I
want to do package builds, I use a common WRKOBJDIR that is a symlink
which can be re-directed on each build machine as desired:

	WRKOBJDIR =	/var/package-obj

In fact I modified pkgsrc/mk/bsd.pkg.defaults.mk to do this so that I
don't have to worry about setting it in /etc/mk.conf on each build
machine:

	WRKOBJDIR?=	/var/package-obj
	# build here instead of in pkgsrc
	# Possible: any path you like (can be a symlink)
	# Note: must remain constant for all hosts sharing pkgsrc
	# Default: /var/package-obj

This makes is possible to have the "work" symlinks created in the source
tree and then still have them work on every machine that mounts the
source tree (though the symlinks do of course have to be created with
the mount in read-write mode, but once created the tree can be mounted
read-only if desired, though read-only pkgsrc is not nearly so necessary
as it is for the main system source tree where product files can very
easily be created in the wrong place if anything goes wrong)

There's no need for any of the ugly OBJMACHINE or OBJHOSTNAME nonsense
with pkgsrc since there's no possibility of cross-compiling packages.
I.e. everything's far more flexible if pkgsrc modules contain just one
single plain "work" symlink in each module that point to/through the
same directory/symlink in /var on each build host.

(sadly the PKGSRC_LOCKTYPE mechanism depends unnecessarily on
OBJHOSTNAME, but I don't use it anyway :-)

-- 
						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>