How an arbitrary user can install ports in own home dir?

Andrey Simonenko simon at comsys.ntu-kpi.kiev.ua
Wed Jul 16 05:04:15 PDT 2003


Hello all,

How an arbitrary user (without root credentials) can install ports
in own home dir?

How I tried to do this:

I created ~/local/ports, place Mk, Tools, Templates there.

I defined in .cshrc:

setenv	PORTSDIR	~/local/ports
setenv	PREFIX		~/local
setenv	PKG_DBDIR	~/local/var/db

But when I install any ports I'm asked to enter root password.
This is from the bsd.port.mk:

.if ${UID} != 0 && defined(_${target:U}_SUSEQ)
[skip]
	@echo "===>  Switching to root credentials for '${target}' target"
	@cd ${.CURDIR} && \
		${SU} root -c "${MAKE} ${__softMAKEFLAGS} ${_${target:U}_SUSEQ}"
	@echo "===>  Returning to user credentials"

If I give correct root's password, then a port is installed to ~/local
and a package is registered in ~/local/var/db.

Questions:

1.	Is there any way to tell ports system not to ask me root's
	password?  I guess that there should be a way to do it,
	whithout patching Mk/* files.

2.	How to tell make(1) to use ~/local/etc/make.conf file
	(use another file, than /etc/make.conf)?


More information about the freebsd-questions mailing list