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

2003-07-21 Thread Andrey Simonenko
On Wed, 16 Jul 2003 13:46:34 + (UTC) in lucky.freebsd.questions, Daniel Bye wrote:

First of all thank you for your help, all what you said is correct.

Next see below.

 
 On Wed, Jul 16, 2003 at 03:03:04PM +0300, Andrey Simonenko wrote:
 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.
 
 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 have to maintain own ports collection, because /usr/ports on
target server is very outdated.

 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.
 
 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...

I think that something is broken in bsd.port.mk, because on another
machine with old /usr/ports I _can_ install ports under in my home
directory (using the method I described in my original message and
additionally defining NO_MTREE=yes in environment).

But with current ports collection that error about ``Switching to
root...'' always appeared.  On my system bsd.port.mk has 1.456 version.

I suppose that this error was introduced in bsd.port.mk version 1.455.

Which version of bsd.port.mk is installed on your system?
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


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

2003-07-16 Thread Daniel Bye
On Wed, Jul 16, 2003 at 03:03:04PM +0300, Andrey Simonenko wrote:
 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.

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:
 
 setenvPORTSDIR~/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.

 setenvPREFIX  ~/local
 setenvPKG_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:
 
 .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.

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...

 
 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.

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

-- 
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 / \


pgp0.pgp
Description: PGP signature