Is there a way to tell a port to install to another location

Well the title really says it all, but I would like to install lang/go from ports but I would like to have it's destination directory prefix to be /opt/go instead of the default /usr/local is there a flag that can be specified in the make install clean command or some special knob to put for it in /etc/make.conf or maybe /usr/local/etc/pkgtools.conf ( I don't remember seeing anything like it in pkgtools.conf, but in case I missed it...) The reason for wanting this is, there are ALOT of go packages that aren't managed in ports, I would like to install Go to /opt/go/ as it would make it extremely easy to prune out the crufty modules by simply rm -r /opt/go/ then portupgrade -fcv lang/go to start over fresh. At least until FreeBSD Ports gets some port maintainers from the Go Team. Anyways, any thoughts? :D
 
For the benefit of anyone coming to this thread wondering what the solution was:
Code:
 .if ${.CURDIR:M*/lang/go}
     PREFIX=/opt
 .endif
I put that into /etc/make.conf and make install clean installed nicely to /opt/go.
 
Be careful with mixing two different PREFIX locations. The LOCALBASE directory is used for searching existing installed software when compiling a port. If the lang/go port was a dependency for another port you would like to install under OPT you would have to set LOCALBASE to /opt and that in turn would possibly require more dependencies installed under /opt. It could get really complicated fast.
 
Back
Top