From owner-freebsd-questions@FreeBSD.ORG Wed Jul 16 06:46:05 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4288B37B401 for ; Wed, 16 Jul 2003 06:46:05 -0700 (PDT) Received: from catflap.home.slightlystrange.org (pc4-cmbg1-4-cust87.cmbg.cable.ntl.com [80.6.127.87]) by mx1.FreeBSD.org (Postfix) with ESMTP id 370CC43FB1 for ; Wed, 16 Jul 2003 06:46:04 -0700 (PDT) (envelope-from danielby@slightlystrange.org) Received: from danielby by catflap.home.slightlystrange.org with local (Exim 4.20) id 19cmba-000Nnu-O1 for freebsd-questions@freebsd.org; Wed, 16 Jul 2003 14:46:02 +0100 Date: Wed, 16 Jul 2003 14:46:02 +0100 From: Daniel Bye To: freebsd-questions@freebsd.org Message-ID: <20030716134602.GB82301@catflap.home.slightlystrange.org> Mail-Followup-To: freebsd-questions@freebsd.org References: <20030716120304.GA44094@pm514-9.comsys.ntu-kpi.kiev.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NDin8bjvE/0mNLFQ" Content-Disposition: inline In-Reply-To: <20030716120304.GA44094@pm514-9.comsys.ntu-kpi.kiev.ua> User-Agent: Mutt/1.4.1i Sender: Daniel Bye Subject: Re: How an arbitrary user can install ports in own home dir? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: dan@slightlystrange.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2003 13:46:05 -0000 --NDin8bjvE/0mNLFQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 16, 2003 at 03:03:04PM +0300, Andrey Simonenko wrote: > Hello all, >=20 > How an arbitrary user (without root credentials) can install ports > in own home dir? >=20 > How I tried to do this: >=20 > I created ~/local/ports, place Mk, Tools, Templates there. This step isn't necessary. Well, it might be, but only if you don't have r-x access on /usr/ports and descendents. > I defined in .cshrc: >=20 > setenv PORTSDIR ~/local/ports Don't bother with setting PORTSDIR, unless you don't have r-x access on the ports tree. All the framework is there already, so there is little value in duplicating it. > setenv PREFIX ~/local > setenv PKG_DBDIR ~/local/var/db You also need to define: DISTDIR - where to find/download distfiles (if you don't have write access on the system-wide ports distfiles directory) DESTDIR - where to install the port, once built (relative to ${PREFIX}) WRKDIR - where the distfiles are unpacked, if you don't have write access to the port's directory under /usr/ports/* With these variables defined, either in your shell's environment (from, as you have done, your login dotfiles) of on the make commandline, ports can be installed exaclty as normal (i.e. cd /usr/ports/ftp/wget && make all install clean) For more options, read the variable definitions in /usr/ports/Mk/bsd.ports.mk. > But when I install any ports I'm asked to enter root password. > This is from the bsd.port.mk: >=20 > .if ${UID} !=3D 0 && defined(_${target:U}_SUSEQ) > [skip] > @echo "=3D=3D=3D> Switching to root credentials for '${target}' target" > @cd ${.CURDIR} && \ > ${SU} root -c "${MAKE} ${__softMAKEFLAGS} ${_${target:U}_SUSEQ}" > @echo "=3D=3D=3D> Returning to user credentials" >=20 > If I give correct root's password, then a port is installed to ~/local > and a package is registered in ~/local/var/db. Hmm, don't know what this means. With the correct set of variables defined, I have not yet been asked to provide the root password... >=20 > Questions: >=20 > 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. I guess by defining the right environment for the build to happen in. > 2. How to tell make(1) to use ~/local/etc/make.conf file > (use another file, than /etc/make.conf)? It seems (from `man 5 make.conf') that make.conf is included from the Makefile of the target you are building. If you want to use a different one, I guess you will need to edit the part of the Makefile that pulls in /etc/make.conf. Can't find a way to specify an alternative. Of course, none of this is guaranteed to be "correct", but "it works for me", so naturally, YMMV ;-) HTH Dan --=20 Daniel Bye PGP Key: ftp://ftp.slightlystrange.org/pgpkey/dan.asc PGP Key fingerprint: 3B9D 8BBB EB03 BA83 5DB4 3B88 86FC F03A 90A1 BE8F _ ASCII ribbon campaign ( ) - against HTML, vCards and X - proprietary attachments in e-mail / \ --NDin8bjvE/0mNLFQ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQE/FVcahvzwOpChvo8RAmyyAJ0eKtMnmPi4KPXKgzWVrkVNVYVSBQCgl9d4 bkn9QIdWC+kNCDoypY6ULgQ= =yJo7 -----END PGP SIGNATURE----- --NDin8bjvE/0mNLFQ--