From ba77c9abaf8d2aef119ed5153b2353192effdb15 Mon Sep 17 00:00:00 2001 From: simonb Date: Sat, 21 Aug 1999 06:30:11 +0000 Subject: [PATCH] Don't chown installed files or directories if UNPRIVILEGED is defined. "make build" should now work as a non-root user (tested on Alpha). mtree spits out lots of warnings during "make distrib-dirs", but these are non-fatal. --- games/phantasia/Makefile | 6 +++++- gnu/usr.bin/ld.new/Makefile | 6 ++++-- share/lkm/Makefile | 6 +++++- share/zoneinfo/Makefile | 5 ++++- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/games/phantasia/Makefile b/games/phantasia/Makefile index 25b344a8a755..1b84a0caa23c 100644 --- a/games/phantasia/Makefile +++ b/games/phantasia/Makefile @@ -1,6 +1,8 @@ -# $NetBSD: Makefile,v 1.17 1998/12/06 09:06:46 dbj Exp $ +# $NetBSD: Makefile,v 1.18 1999/08/21 06:30:11 simonb Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 +.include # for UNPRIVILEGED + PROG= phantasia SRCS= fight.c gamesupport.c interplayer.c io.c main.c misc.c phantglobs.c @@ -25,7 +27,9 @@ setup.o: ${.CURDIR}/setup.c afterinstall: DESTDIR=${DESTDIR} ./setup -m ${.CURDIR}/monsters.asc +.if !defined(UNPRIVILEGED) chown games:games ${DESTDIR}/var/games/phantasia/* +.endif # Make Phantasia map. Change the map commands reflect your installation. # PLOTDEVICE is used for plotting the map. Change as appropriate. diff --git a/gnu/usr.bin/ld.new/Makefile b/gnu/usr.bin/ld.new/Makefile index 6422fbd94354..54c31e6e4875 100644 --- a/gnu/usr.bin/ld.new/Makefile +++ b/gnu/usr.bin/ld.new/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.14 1999/07/30 04:07:26 mycroft Exp $ +# $NetBSD: Makefile,v 1.15 1999/08/21 06:30:12 simonb Exp $ -# for OBJECT_FMT +# for OBJECT_FMT, UNPRIVILEGED .include .if (${OBJECT_FMT} == "ELF") || defined(BOOTSTRAP_ELF) @@ -125,7 +125,9 @@ ldemul-list.h: Makefile afterinstall: .if ${MKSHARE} != "no" (cd ldscripts ; pax -rw . ${DESTDIR}${SCRIPTDIR}) +.if !defined(UNPRIVILEGED) chown -R ${BINOWN}:${BINGRP} ${DESTDIR}${SCRIPTDIR} +.endif find ${DESTDIR}${SCRIPTDIR} -type f | xargs chmod a=rX find ${DESTDIR}${SCRIPTDIR} -type d | xargs chmod u=rwX,go=rX .endif diff --git a/share/lkm/Makefile b/share/lkm/Makefile index 5fbec68a258d..edeebb9a0c7f 100644 --- a/share/lkm/Makefile +++ b/share/lkm/Makefile @@ -1,14 +1,18 @@ # -# $NetBSD: Makefile,v 1.16 1999/02/14 10:53:06 lukem Exp $ +# $NetBSD: Makefile,v 1.17 1999/08/21 06:30:12 simonb Exp $ # +.include # for UNPRIVILEGED + STUFF= README syscall vfs misc MKOBJ= no install: find ${STUFF} -follow -name CVS -prune -o -type f -print | \ cpio -pdumL ${DESTDIR}${BINDIR}/lkm +.if !defined(UNPRIVILEGED) chown -R ${BINOWN}:${BINGRP} ${DESTDIR}${BINDIR}/lkm +.endif find ${DESTDIR}${BINDIR}/lkm -type f | xargs chmod a=rX find ${DESTDIR}${BINDIR}/lkm -type d | xargs chmod u=rwX,go=rX diff --git a/share/zoneinfo/Makefile b/share/zoneinfo/Makefile index 8ef32555b73b..a5bd042faa9a 100644 --- a/share/zoneinfo/Makefile +++ b/share/zoneinfo/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.21 1999/02/13 02:54:36 lukem Exp $ +# $NetBSD: Makefile,v 1.22 1999/08/21 06:30:12 simonb Exp $ .include @@ -77,8 +77,11 @@ right_posix: right_only other_two .if ${MKSHARE} != "no" afterinstall: ${DATA} ${REDO} ${ZIC} -y ${YEARISTYPE} -d ${TZDIR} -p ${POSIXRULES} +.if !defined(UNPRIVILEGED) chown -R ${BINOWN}:${BINGRP} ${TZDIR} +.endif find ${TZDIR} -type f | xargs chmod a=r + find ${TZDIR} -type d | xargs chmod u=rwX,go=rX .else afterinstall: .endif