From: Alexander Barton Date: Tue, 31 Dec 2013 16:30:36 +0000 (+0100) Subject: Make USER configurable on make command line X-Git-Url: https://arthur.ath.cx/gitweb/?a=commitdiff_plain;h=2e5c0694344078b92650565322e767a6f2075ca8;p=ax-linux.git Make USER configurable on make command line The default is to use the group of the PREFIX directory, if it exists, or the primary group of the user running make otherwise. --- diff --git a/Makefile.ax b/Makefile.ax index 71a566d..aa91fb2 100644 --- a/Makefile.ax +++ b/Makefile.ax @@ -11,7 +11,9 @@ AX_SILENT ?= @ PREFIX ?= /usr/local -GROUP ?= staff + +USER ?= $(shell id -un) +GROUP ?= $(shell stat --format=%G $(DESTDIR)$(PREFIX) 2>/dev/null || id -gn) $(SUBDIRS): $(MAKE) -C $@ diff --git a/btrfs/mksnapshot/Makefile b/btrfs/mksnapshot/Makefile index 098f093..9be1b6a 100644 --- a/btrfs/mksnapshot/Makefile +++ b/btrfs/mksnapshot/Makefile @@ -11,13 +11,13 @@ all: btrfs-mksnapshot install-local: btrfs-mksnapshot - install -d -o root -g $(GROUP) -m 755 \ + install -d -o $(USER) -g $(GROUP) -m 755 \ $(DESTDIR)$(PREFIX)/sbin - install -p -o root -g $(GROUP) -m 755 btrfs-mksnapshot \ + install -p -o $(USER) -g $(GROUP) -m 755 btrfs-mksnapshot \ $(DESTDIR)$(PREFIX)/sbin/btrfs-mksnapshot - install -d -o root -g root -m 755 \ + install -d -o $(USER) -g $(GROUP) -m 755 \ $(DESTDIR)/etc/apt/apt.conf.d - install -p -o root -g root -m 644 06btrfs-mksnapshot \ + install -p -o $(USER) -g $(GROUP) -m 644 06btrfs-mksnapshot \ $(DESTDIR)/etc/apt/apt.conf.d/06btrfs-mksnapshot include ../../Makefile.ax