[BACK]Return to unprivileged.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / mk

File: [cvs.NetBSD.org] / pkgsrc / mk / unprivileged.mk (download)

Revision 1.2, Mon Aug 22 17:13:28 2005 UTC (15 years, 2 months ago) by reed
Branch: MAIN
CVS Tags: pkgsrc-2005Q3-base, pkgsrc-2005Q3
Changes since 1.1: +5 -2 lines

Do not attempt to modify /etc/shells as a regular user.

Also set PKG_CREATE_USERGROUP with = instead of ?=.

# $NetBSD: unprivileged.mk,v 1.2 2005/08/22 17:13:28 reed Exp $
#
# Ease configuration of unprivileged (non-root) builds.
#
# UNPRIVILEGED		If set to 'yes', enable unprivileged builds.
#			Disabled by default.
#
# UNPRIVILEGED_GROUP	Specifies the group name (or gid) that will be used
#			to install files.  Guessed if empty.
#
# UNPRIVILEGED_USER	Specifies the user name (or uid) that will be used
#			to install files.  Guessed if empty.

.if defined(UNPRIVILEGED) && !empty(UNPRIVILEGED:M[Yy][Ee][Ss])

# Guess which user/group has to be used.
.  if !defined(UNPRIVILEGED_USER) || empty(UNPRIVILEGED_USER)
UNPRIVILEGED_USER!=	${ID} -n -u
.  endif
.  if !defined(UNPRIVILEGED_GROUP) || empty(UNPRIVILEGED_GROUP)
UNPRIVILEGED_GROUP!=	${ID} -n -g
.  endif

# Override super-user account.
ROOT_GROUP=		${UNPRIVILEGED_GROUP}
ROOT_USER=		${UNPRIVILEGED_USER}

# Override user/group pairs used to install files.
BINGRP=			${UNPRIVILEGED_GROUP}
BINOWN=			${UNPRIVILEGED_USER}
GAMEGRP=		${UNPRIVILEGED_GROUP}
GAMEOWN=		${UNPRIVILEGED_USER}
MANGRP=			${UNPRIVILEGED_GROUP}
MANOWN=			${UNPRIVILEGED_USER}
SHAREGRP=		${UNPRIVILEGED_GROUP}
SHAREOWN=		${UNPRIVILEGED_USER}

# Override installation modes.  As a regular user, we may have problems
# when overwriting files if they are not writable.
BINMODE=		755
NONBINMODE=		644

# mtree is useless as a regular user because it won't set directory
# ownerships correctly.
NO_MTREE=		# defined

# As a regular user, creation of other users and groups won't work, so
# disable this step by default.
PKG_CREATE_USERGROUP=	NO

# Override commands that won't work as a regular user.
CHGRP=			${TRUE}
CHOWN=			${TRUE}
SU_CMD=			${SH} -c

# Do not attempt to modify /etc/shells as a regular user.
PKG_REGISTER_SHELLS=	NO

.endif