Add lang/perl5 early, but not specifically as part of BULK_PREREQ, so that
[pkgsrc.git] / mk / unprivileged.mk
1 # $NetBSD: unprivileged.mk,v 1.2 2005/08/22 17:13:28 reed Exp $
2 #
3 # Ease configuration of unprivileged (non-root) builds.
4 #
5 # UNPRIVILEGED          If set to 'yes', enable unprivileged builds.
6 #                       Disabled by default.
7 #
8 # UNPRIVILEGED_GROUP    Specifies the group name (or gid) that will be used
9 #                       to install files.  Guessed if empty.
10 #
11 # UNPRIVILEGED_USER     Specifies the user name (or uid) that will be used
12 #                       to install files.  Guessed if empty.
13
14 .if defined(UNPRIVILEGED) && !empty(UNPRIVILEGED:M[Yy][Ee][Ss])
15
16 # Guess which user/group has to be used.
17 .  if !defined(UNPRIVILEGED_USER) || empty(UNPRIVILEGED_USER)
18 UNPRIVILEGED_USER!=     ${ID} -n -u
19 .  endif
20 .  if !defined(UNPRIVILEGED_GROUP) || empty(UNPRIVILEGED_GROUP)
21 UNPRIVILEGED_GROUP!=    ${ID} -n -g
22 .  endif
23
24 # Override super-user account.
25 ROOT_GROUP=             ${UNPRIVILEGED_GROUP}
26 ROOT_USER=              ${UNPRIVILEGED_USER}
27
28 # Override user/group pairs used to install files.
29 BINGRP=                 ${UNPRIVILEGED_GROUP}
30 BINOWN=                 ${UNPRIVILEGED_USER}
31 GAMEGRP=                ${UNPRIVILEGED_GROUP}
32 GAMEOWN=                ${UNPRIVILEGED_USER}
33 MANGRP=                 ${UNPRIVILEGED_GROUP}
34 MANOWN=                 ${UNPRIVILEGED_USER}
35 SHAREGRP=               ${UNPRIVILEGED_GROUP}
36 SHAREOWN=               ${UNPRIVILEGED_USER}
37
38 # Override installation modes.  As a regular user, we may have problems
39 # when overwriting files if they are not writable.
40 BINMODE=                755
41 NONBINMODE=             644
42
43 # mtree is useless as a regular user because it won't set directory
44 # ownerships correctly.
45 NO_MTREE=               yes
46
47 # As a regular user, creation of other users and groups won't work, so
48 # disable this step by default.
49 PKG_CREATE_USERGROUP=   NO
50
51 # Override commands that won't work as a regular user.
52 CHGRP=                  ${TRUE}
53 CHOWN=                  ${TRUE}
54 SU_CMD=                 ${SH} -c
55
56 # Do not attempt to modify /etc/shells as a regular user.
57 PKG_REGISTER_SHELLS=    NO
58
59 .endif