Specifying the Working Directory

I have read The Handbook about Specifying the Working Directory, but am none the wiser. I have /usr/ports on the LAN, but I want the working directory somewhere local, possibly /tmp, but I can't figure out how to specify this. It looks like $WORKSRC is the thing I need to setup, but how?
 
Assuming this can be specified then it should go where everything else gets specified for building Ports: /etc/make.conf.
 
See ports(7):
Code:
     WRKDIRPREFIX      Where to create any temporary files.  Useful if
                       PORTSDIR is read-only (perhaps mounted from a CD-ROM).
 
/usr/ports/misc/heyu2/ is mounted on a remote host and I am trying to run
Code:
cd /usr/ports/misc/heyu2
make WRKDIRPREFIX=/tmp/heyu install
but it seems that the build requires the building of ports-mgmt/dialog4ports and this happens:-
Code:
root@tester:~ # mount
/dev/gpt/S03p2 on / (ufs, local, soft-updates)
....
192.168.1.2:/mnt/nas/Web-Server/usr/ports on /usr/ports (nfs, noatime, nfsv4acls)
.....
root@tester:~ # sh /mnt/projects/heyu/build
===> Building/installing dialog4ports as it is required for the config dialog
===>  Cleaning for dialog4ports-0.1.6
===>  License BSD2CLAUSE accepted by the user
===>   dialog4ports-0.1.6 depends on file: /usr/local/sbin/pkg - not found
===>  License BSD2CLAUSE accepted by the user
mkdir: /usr/ports/distfiles: Permission denied
*** Error code 1

Stop.

What am I doing wrong?
 
Your /usr/ports is essentially read-only, so downloaded distfiles cannot be saved to /usr/ports/distfiles. So you either make sure the distfiles are already there or you set DISTDIR to a writable directory. See ports(7):
Code:
     DISTDIR           Where to find/put distfiles, normally distfiles/ in
                       PORTSDIR.
 
Am I right in thinking these variables can be set globally in /etc/make.conf?

Would /var/tmp/ be a reasonable location to use?
 
Why not a shell environment variable.
set WRKDIRPREFIX=/tmp/heyu
Then anytime it encounters $WRKDIRPREFIX is goes to the variable provided.

I have done this with cross compiling base but not with any ports. A variable is a variable right? Many ways to skin a sheep.
set WRKSRC= Any source tree you want to use
 
Back
Top