Subject: proposed fix for problem when installing in unprivileged mode: opinions needed
To: Packages Technical List NetBSD Discussion <tech-pkg@netbsd.org>
From: Georg Schwarz <georg.schwarz@freenet.de>
List: tech-pkg
Date: 10/03/2006 10:58:44
For packages that do not provide their own install routine but  
instead rely on bmake's, installation fails because bmake tries to  
install things as root (cf. definition of BINGRP, BINOWN, etc. in  
share/mk/bsd.own.mk). One example of such a package is net/host. The  
reason is that pkgsrc's mk/unprivileged.mk does set the necessary  
variables, but pkgsrc fails to pass them to make at install time, so  
the defaults are used.
I'd like to suggest the following patch:

--- pkgsrc/mk/bsd.pkg.mk.orig   2006-10-03 10:38:16.000000000 +0200
+++ pkgsrc/mk/bsd.pkg.mk        2006-10-03 10:48:30.000000000 +0200
@@ -305,6 +305,10 @@
                 BSD_INSTALL_GAME=$ 
{INSTALL_GAME:Q}                      \
                 BSD_INSTALL_GAME_DATA=$ 
{INSTALL_GAME_DATA:Q}            \
                 BSD_INSTALL_GAME_DIR=${INSTALL_GAME_DIR:Q}
+.for _VAR in BINGRP BINOWN GAMEGRP GAMEOWN MANGRP MANOWN  
SHAREGRP      \
+               SHAREOWN BINMODE NONBINMODE
+INSTALL_MACROS+=       ${_VAR}=${${_VAR}:Q}
+.endfor
MAKE_ENV+=     ${INSTALL_MACROS}
SCRIPTS_ENV+=  ${INSTALL_MACROS}


What do you think of it?

Another thought is whether the variables (as set in pkgsrc's mk/ 
unprivileged.mk) are the correct and sufficient ones when comparing  
with what is defined in share/mk/bsd.own.mk.


-- 
Georg Schwarz    http://home.pages.de/~schwarz/
georg.schwarz@freenet.de  +49 178 8545053