Subject: Re: pkgsrc as non-root?
To: None <tech-pkg@NetBSD.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 09/27/2003 21:22:04
I have done some pkgsrc builds and installs as a normal user. Here is my
mk.conf.

I set MAKECONF to this ~/mk.conf so it is used.

SU_CMD= sh -c
PKG_DBDIR=${HOME}/var/db/pkg
LOCALBASE=${HOME}/pkg
BINOWN=reed
BINGRP=users
ROOT_USER=reed
ROOT_GROUP=users
PKG_TOOLS_BIN=${HOME}/pkg/sbin
SHAREOWN=reed
SHAREGRP=users
#INSTALL_DATA=install -c -o ${BINOWN} -g ${BINGRP} -m 444
CHOWN=true
CHGRP=true
WRKOBJDIR=             ${HOME}/tmp   # build here instead of in pkgsrc
OBJHOSTNAME=           yes               # use work.`hostname`
VARBASE=        ${HOME}/var

Here is an example of what I installed (this was in July on this system):

reed@www:~$ ~/pkg/sbin/pkg_info
bison-1.875nb1      GNU yacc(1) replacement
digest-20021220     Message digest wrapper utility
libtool-base-1.4.20010614nb14 Generic shared library support script (the
script itself)
m4-1.4              GNU version of Unix m4 macro-processor
mit-krb5-1.3        MIT Kerberos 5 authentication system
openldap-2.0.27nb3  Lightweight directory access protocol server and
client pack
pth-2.0.0           GNU Portable Thread library
readline-4.3pl5     GNU library that can recall and edit previous input
samba-3.0.0beta3    SMB/CIFS protocol server suite for UNIX (v3)
autoconf-2.57       Generates automatic source code configuration scripts

As an example of problems ...

In July, I suggested ...  It may be useful to have a few more variables
for chmod permissions, for example:

I wasn't sure what to name them, so I suggest some generics like:

MODE0500?=      0700

The reason: I am doing pkgsrc without any superuser privileges. And some
pkgsrc builds (like samba) will change permissions and then later the
non-root user can't place new files or remove files without manually
making them writable again.

(Some mode variables are defined in bsd.own.mk.)


   Jeremy C. Reed
   http://bsd.reedmedia.net/