summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam>2008-03-04 06:45:33 +0000
committerjlam <jlam>2008-03-04 06:45:33 +0000
commit8c867a5e42c67e144fe038f341114b66ccf5f327 (patch)
tree53927b9cc2c07e26be3e7581f09a05ed030ac452 /mk
parent4a2affba67d2a941bfe6d5e015a63fc017b7f8f8 (diff)
downloadpkgsrc-8c867a5e42c67e144fe038f341114b66ccf5f327.tar.gz
+ Conditionally add GAMES_USER and GAMES_GROUP to the platform *.mk
files. These variables are currently usable if ${SETGIDGAME} == yes. These variables should be used when describing ownership of files and directories to the pkginstall framework, e.g. SPECIAL_PERMS= bin/foogame ${GAMES_USER} ${GAMES_GROUP} 2555 + Rename SETGID_GAME_PERMS to SETGID_GAMES_PERMS because the default group name is "games". + Define SETGID_GAMES_PERMS in terms of GAMES_USER and GAMES_GROUP so that these names are protected from the normal flow of unprivileged.mk. This fixes the +INSTALL scripts in "user-destdir" packages to correctly refer to the games:games instead of the user:group of the user that built the packages.
Diffstat (limited to 'mk')
-rw-r--r--mk/pkginstall/bsd.pkginstall.mk10
-rw-r--r--mk/platform/AIX.mk8
-rw-r--r--mk/platform/BSDOS.mk8
-rw-r--r--mk/platform/Darwin.mk8
-rw-r--r--mk/platform/DragonFly.mk8
-rw-r--r--mk/platform/FreeBSD.mk8
-rw-r--r--mk/platform/IRIX.mk8
-rw-r--r--mk/platform/Interix.mk8
-rw-r--r--mk/platform/Linux.mk8
-rw-r--r--mk/platform/NetBSD.mk8
-rw-r--r--mk/platform/OpenBSD.mk8
-rw-r--r--mk/platform/SunOS.mk8
-rw-r--r--mk/platform/UnixWare.mk8
-rw-r--r--mk/unprivileged.mk11
14 files changed, 75 insertions, 42 deletions
diff --git a/mk/pkginstall/bsd.pkginstall.mk b/mk/pkginstall/bsd.pkginstall.mk
index 75c691400c8..4fa046604b1 100644
--- a/mk/pkginstall/bsd.pkginstall.mk
+++ b/mk/pkginstall/bsd.pkginstall.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkginstall.mk,v 1.44 2008/03/04 05:55:42 jlam Exp $
+# $NetBSD: bsd.pkginstall.mk,v 1.45 2008/03/04 06:45:33 jlam Exp $
#
# This Makefile fragment is included by bsd.pkg.mk and implements the
# common INSTALL/DEINSTALL scripts framework. To use the pkginstall
@@ -50,7 +50,7 @@ _PKG_VARS.pkginstall+= \
FONTS_DIRS.ttf FONTS_DIRS.type1 FONTS_DIRS.x11 \
_SYS_VARS.pkginstall= \
SETUID_ROOT_PERMS \
- SETGID_GAME_PERMS \
+ SETGID_GAMES_PERMS \
SHLIB_TYPE \
LDCONFIG_ADD_CMD \
LDCONFIG_REMOVE_CMD
@@ -363,16 +363,16 @@ su-create-usergroup: ${_INSTALL_USERGROUP_UNPACKER}
#
# SPECIAL_PERMS+= /path/to/suidroot ${SETUID_ROOT_PERMS}
#
-# SETGID_GAME_PERMS is a convenience definition to note an executable is
+# SETGID_GAMES_PERMS is a convenience definition to note an executable is
# meant to be setgid-game, and should be used as follows:
#
-# SPECIAL_PERMS+= /path/to/sgidgame ${SETGID_GAME_PERMS}
+# SPECIAL_PERMS+= /path/to/sgidgame ${SETGID_GAMES_PERMS}
#
# Keywords: setuid setgid st_mode perms
#
SPECIAL_PERMS?= # empty
SETUID_ROOT_PERMS?= ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 4511
-SETGID_GAME_PERMS?= ${GAMEOWN} ${GAMEGRP} ${GAMEMODE}
+SETGID_GAMES_PERMS?= ${GAMES_USER} ${GAMES_GROUP} ${GAMEMODE}
_INSTALL_PERMS_FILE= ${_PKGINSTALL_DIR}/perms
_INSTALL_PERMS_DATAFILE= ${_PKGINSTALL_DIR}/perms-data
diff --git a/mk/platform/AIX.mk b/mk/platform/AIX.mk
index 2d455db4d6c..6b85d89b2f0 100644
--- a/mk/platform/AIX.mk
+++ b/mk/platform/AIX.mk
@@ -1,4 +1,4 @@
-# $NetBSD: AIX.mk,v 1.29 2007/10/19 13:41:34 rillig Exp $
+# $NetBSD: AIX.mk,v 1.30 2008/03/04 06:45:34 jlam Exp $
#
# Variable definitions for the AIX operating system.
@@ -81,8 +81,10 @@ SERIAL_DEVICES?= /dev/tty0 \
# BINOWN, BINGRP and BINMODE as per defaults/mk.conf).
# FIXME: Adjust to work on this system and enable the lines below.
#.if !(empty(SETGIDGAME:M[yY][eE][sS]))
-#GAMEOWN= games
-#GAMEGRP= games
+#GAMES_USER= games
+#GAMES_GROUP= games
+#GAMEOWN= ${GAMES_USER}
+#GAMEGRP= ${GAMES_GROUP}
#GAMEMODE= 2555
#GAMEDIRMODE= 0775
#.endif
diff --git a/mk/platform/BSDOS.mk b/mk/platform/BSDOS.mk
index 2a893662521..d96a0e0fa67 100644
--- a/mk/platform/BSDOS.mk
+++ b/mk/platform/BSDOS.mk
@@ -1,4 +1,4 @@
-# $NetBSD: BSDOS.mk,v 1.23 2007/10/19 13:41:34 rillig Exp $
+# $NetBSD: BSDOS.mk,v 1.24 2008/03/04 06:45:34 jlam Exp $
#
# Variable definitions for the BSD/OS operating system.
@@ -89,8 +89,10 @@ PKG_CREATE_USERGROUP= NO # until it works
# BINOWN, BINGRP and BINMODE as per defaults/mk.conf).
# FIXME: Adjust to work on this system and enable the lines below.
#.if !(empty(SETGIDGAME:M[yY][eE][sS]))
-#GAMEOWN= games
-#GAMEGRP= games
+#GAMES_USER= games
+#GAMES_GROUP= games
+#GAMEOWN= ${GAMES_USER}
+#GAMEGRP= ${GAMES_GROUP}
#GAMEMODE= 2555
#GAMEDIRMODE= 0775
#.endif
diff --git a/mk/platform/Darwin.mk b/mk/platform/Darwin.mk
index 47511370161..0d2d07fba03 100644
--- a/mk/platform/Darwin.mk
+++ b/mk/platform/Darwin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: Darwin.mk,v 1.30 2008/02/17 11:45:14 yyamano Exp $
+# $NetBSD: Darwin.mk,v 1.31 2008/03/04 06:45:34 jlam Exp $
#
# Variable definitions for the Darwin operating system.
@@ -118,8 +118,10 @@ CONFIGURE_ENV+= ac_cv_func_poll=no
# BINOWN, BINGRP and BINMODE as per defaults/mk.conf).
# FIXME: Adjust to work on this system and enable the lines below.
#.if !(empty(SETGIDGAME:M[yY][eE][sS]))
-#GAMEOWN= games
-#GAMEGRP= games
+#GAMES_USER= games
+#GAMES_GROUP= games
+#GAMEOWN= ${GAMES_USER}
+#GAMEGRP= ${GAMES_GROUP}
#GAMEMODE= 2555
#GAMEDIRMODE= 0775
#.endif
diff --git a/mk/platform/DragonFly.mk b/mk/platform/DragonFly.mk
index 076e01ef74a..487774203cd 100644
--- a/mk/platform/DragonFly.mk
+++ b/mk/platform/DragonFly.mk
@@ -1,4 +1,4 @@
-# $NetBSD: DragonFly.mk,v 1.35 2008/01/16 14:03:31 joerg Exp $
+# $NetBSD: DragonFly.mk,v 1.36 2008/03/04 06:45:34 jlam Exp $
#
# Variable definitions for the DragonFly operating system.
@@ -89,8 +89,10 @@ _OPSYS_MAX_CMDLEN_CMD= /sbin/sysctl -n kern.argmax
# Set the group and mode to meaningful values in that case (defaults to
# BINOWN, BINGRP and BINMODE as per defaults/mk.conf).
.if !(empty(SETGIDGAME:M[yY][eE][sS]))
-GAMEOWN= games
-GAMEGRP= games
+GAMES_USER= games
+GAMES_GROUP= games
+GAMEOWN= ${GAMES_USER}
+GAMEGRP= ${GAMES_GROUP}
GAMEMODE= 2555
GAMEDIRMODE= 0775
.endif
diff --git a/mk/platform/FreeBSD.mk b/mk/platform/FreeBSD.mk
index 0948d8bdba5..ee039414aa0 100644
--- a/mk/platform/FreeBSD.mk
+++ b/mk/platform/FreeBSD.mk
@@ -1,4 +1,4 @@
-# $NetBSD: FreeBSD.mk,v 1.23 2007/10/19 13:41:35 rillig Exp $
+# $NetBSD: FreeBSD.mk,v 1.24 2008/03/04 06:45:34 jlam Exp $
#
# Variable definitions for the FreeBSD operating system.
@@ -89,8 +89,10 @@ _OPSYS_MAX_CMDLEN_CMD= /sbin/sysctl -n kern.argmax
# Set the group and mode to meaningful values in that case (defaults to
# BINOWN, BINGRP and BINMODE as per defaults/mk.conf).
.if !(empty(SETGIDGAME:M[yY][eE][sS]))
-GAMEOWN= games
-GAMEGRP= games
+GAMES_USER= games
+GAMES_GROUP= games
+GAMEOWN= ${GAMES_USER}
+GAMEGRP= ${GAMES_GROUP}
GAMEMODE= 2555
GAMEDIRMODE= 0775
.endif
diff --git a/mk/platform/IRIX.mk b/mk/platform/IRIX.mk
index 51d9b63eb47..fc2f334ac78 100644
--- a/mk/platform/IRIX.mk
+++ b/mk/platform/IRIX.mk
@@ -1,4 +1,4 @@
-# $NetBSD: IRIX.mk,v 1.33 2008/02/21 04:23:58 tnn Exp $
+# $NetBSD: IRIX.mk,v 1.34 2008/03/04 06:45:34 jlam Exp $
#
# Variable definitions for the IRIX operating system.
@@ -115,8 +115,10 @@ _OPSYS_MAX_CMDLEN_CMD= /usr/sbin/sysconf ARG_MAX
# BINOWN, BINGRP and BINMODE as per defaults/mk.conf).
# FIXME: Adjust to work on this system and enable the lines below.
#.if !(empty(SETGIDGAME:M[yY][eE][sS]))
-#GAMEOWN= games
-#GAMEGRP= games
+#GAMES_USER= games
+#GAMES_GROUP= games
+#GAMEOWN= ${GAMES_USER}
+#GAMEGRP= ${GAMES_GROUP}
#GAMEMODE= 2555
#GAMEDIRMODE= 0775
#.endif
diff --git a/mk/platform/Interix.mk b/mk/platform/Interix.mk
index 546525c8c5b..6cb36b83e32 100644
--- a/mk/platform/Interix.mk
+++ b/mk/platform/Interix.mk
@@ -1,4 +1,4 @@
-# $NetBSD: Interix.mk,v 1.55 2008/02/21 04:23:58 tnn Exp $
+# $NetBSD: Interix.mk,v 1.56 2008/03/04 06:45:34 jlam Exp $
#
# Variable definitions for the Interix operating system.
@@ -170,8 +170,10 @@ _OPSYS_MAX_CMDLEN_CMD= ${ECHO} 262144
# BINOWN, BINGRP and BINMODE as per defaults/mk.conf).
# FIXME: Adjust to work on this system and enable the lines below.
#.if !(empty(SETGIDGAME:M[yY][eE][sS]))
-#GAMEOWN= games
-#GAMEGRP= games
+#GAMES_USER= games
+#GAMES_GROUP= games
+#GAMEOWN= ${GAMES_USER}
+#GAMEGRP= ${GAMES_GROUP}
#GAMEMODE= 2555
#GAMEDIRMODE= 0775
#.endif
diff --git a/mk/platform/Linux.mk b/mk/platform/Linux.mk
index d82e36895fc..3322244052e 100644
--- a/mk/platform/Linux.mk
+++ b/mk/platform/Linux.mk
@@ -1,4 +1,4 @@
-# $NetBSD: Linux.mk,v 1.32 2008/01/12 22:44:10 joerg Exp $
+# $NetBSD: Linux.mk,v 1.33 2008/03/04 06:45:34 jlam Exp $
#
# Variable definitions for the Linux operating system.
@@ -87,8 +87,10 @@ _STRIPFLAG_INSTALL?= ${_INSTALL_UNSTRIPPED:D:U-s} # install(1) option to strip
# BINOWN, BINGRP and BINMODE as per defaults/mk.conf).
# FIXME: Adjust to work on this system and enable the lines below.
#.if !(empty(SETGIDGAME:M[yY][eE][sS]))
-#GAMEOWN= games
-#GAMEGRP= games
+#GAMES_USER= games
+#GAMES_GROUP= games
+#GAMEOWN= ${GAMES_USER}
+#GAMEGRP= ${GAMES_GROUP}
#GAMEMODE= 2555
#GAMEDIRMODE= 0775
#.endif
diff --git a/mk/platform/NetBSD.mk b/mk/platform/NetBSD.mk
index cb41236fbf0..d264c9551dc 100644
--- a/mk/platform/NetBSD.mk
+++ b/mk/platform/NetBSD.mk
@@ -1,4 +1,4 @@
-# $NetBSD: NetBSD.mk,v 1.28 2008/01/16 14:03:31 joerg Exp $
+# $NetBSD: NetBSD.mk,v 1.29 2008/03/04 06:45:34 jlam Exp $
#
# Variable definitions for the NetBSD operating system.
@@ -153,8 +153,10 @@ _OPSYS_MAX_CMDLEN_CMD= /sbin/sysctl -n kern.argmax
# Set the group and mode to meaningful values in that case (defaults to
# BINOWN, BINGRP and BINMODE as per defaults/mk.conf).
.if !(empty(SETGIDGAME:M[yY][eE][sS]))
-GAMEOWN= games
-GAMEGRP= games
+GAMES_USER= games
+GAMES_GROUP= games
+GAMEOWN= ${GAMES_USER}
+GAMEGRP= ${GAMES_GROUP}
GAMEMODE= 2555
GAMEDIRMODE= 0775
.endif
diff --git a/mk/platform/OpenBSD.mk b/mk/platform/OpenBSD.mk
index 9589b599bb5..964a5151eb4 100644
--- a/mk/platform/OpenBSD.mk
+++ b/mk/platform/OpenBSD.mk
@@ -1,4 +1,4 @@
-# $NetBSD: OpenBSD.mk,v 1.27 2007/10/19 13:41:35 rillig Exp $
+# $NetBSD: OpenBSD.mk,v 1.28 2008/03/04 06:45:34 jlam Exp $
#
# Variable definitions for the OpenBSD operating system.
@@ -105,8 +105,10 @@ _OPSYS_MAX_CMDLEN_CMD= /sbin/sysctl -n kern.argmax
# BINOWN, BINGRP and BINMODE as per defaults/mk.conf).
# FIXME: Adjust to work on this system and enable the lines below.
#.if !(empty(SETGIDGAME:M[yY][eE][sS]))
-#GAMEOWN= games
-#GAMEGRP= games
+#GAMES_USER= games
+#GAMES_GROUP= games
+#GAMEOWN= ${GAMES_USER}
+#GAMEGRP= ${GAMES_GROUP}
#GAMEMODE= 2555
#GAMEDIRMODE= 0775
#.endif
diff --git a/mk/platform/SunOS.mk b/mk/platform/SunOS.mk
index 246194deafe..7a94c6164a1 100644
--- a/mk/platform/SunOS.mk
+++ b/mk/platform/SunOS.mk
@@ -1,4 +1,4 @@
-# $NetBSD: SunOS.mk,v 1.33 2007/11/20 17:49:49 rillig Exp $
+# $NetBSD: SunOS.mk,v 1.34 2008/03/04 06:45:34 jlam Exp $
#
# Variable definitions for the SunOS/Solaris operating system.
@@ -95,8 +95,10 @@ PKG_TOOLS_BIN?= ${LOCALBASE}/sbin
# BINOWN, BINGRP and BINMODE as per defaults/mk.conf).
# FIXME: Adjust to work on this system and enable the lines below.
#.if !(empty(SETGIDGAME:M[yY][eE][sS]))
-#GAMEOWN= games
-#GAMEGRP= games
+#GAMES_USER= games
+#GAMES_GROUP= games
+#GAMEOWN= ${GAMES_USER}
+#GAMEGRP= ${GAMES_GROUP}
#GAMEMODE= 2555
#GAMEDIRMODE= 0775
#.endif
diff --git a/mk/platform/UnixWare.mk b/mk/platform/UnixWare.mk
index fb6433ab720..05f50248caa 100644
--- a/mk/platform/UnixWare.mk
+++ b/mk/platform/UnixWare.mk
@@ -1,4 +1,4 @@
-# $NetBSD: UnixWare.mk,v 1.26 2007/10/19 13:41:35 rillig Exp $
+# $NetBSD: UnixWare.mk,v 1.27 2008/03/04 06:45:34 jlam Exp $
#
# Variable definitions for the UnixWare 7 operating system.
@@ -87,8 +87,10 @@ PKG_TOOLS_BIN?= ${LOCALBASE}/sbin
# BINOWN, BINGRP and BINMODE as per defaults/mk.conf).
# FIXME: Adjust to work on this system and enable the lines below.
#.if !(empty(SETGIDGAME:M[yY][eE][sS]))
-#GAMEOWN= games
-#GAMEGRP= games
+#GAMES_USER= games
+#GAMES_GROUP= games
+#GAMEOWN= ${GAMES_USER}
+#GAMEGRP= ${GAMES_GROUP}
#GAMEMODE= 2555
#GAMEDIRMODE= 0775
#.endif
diff --git a/mk/unprivileged.mk b/mk/unprivileged.mk
index 09f3c846937..46ff74b4bd2 100644
--- a/mk/unprivileged.mk
+++ b/mk/unprivileged.mk
@@ -1,4 +1,4 @@
-# $NetBSD: unprivileged.mk,v 1.15 2008/02/01 08:54:53 rillig Exp $
+# $NetBSD: unprivileged.mk,v 1.16 2008/03/04 06:45:33 jlam Exp $
#
# This file collects definitions that are useful when using pkgsrc as an
# unprivileged (non-root) user. It is included automatically by the
@@ -170,6 +170,15 @@ PKG_USERS_VARS?= # empty
PKG_GROUPS_VARS?= # empty
BUILD_DEFS+= ${PKG_USERS_VARS} ${PKG_GROUPS_VARS}
+.if defined(SETGIDGAME) && !empty(SETGIDGAME:M[yY][eE][sS])
+. if defined(GAMES_USER)
+PKG_USERS_VARS+= GAMES_USER
+. endif
+. if defined(GAMES_GROUP)
+PKG_GROUPS_VARS+= GAMES_GROUP
+. endif
+.endif
+
# Override per-package custom users and groups, except for groups listed
# in UNPRIVILEGED_GROUPS.
. for _var_ in ${PKG_USERS_VARS}