From be8db96603631ea85bb82a39c77a5514cbc47348 Mon Sep 17 00:00:00 2001 From: DrDaveD <2129743+DrDaveD@users.noreply.github.com> Date: Thu, 4 Jul 2019 03:01:19 -0500 Subject: Add build option to skip steps requiring root permissions --- util/install_helper.sh | 14 ++++++++------ util/meson.build | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'util') diff --git a/util/install_helper.sh b/util/install_helper.sh index 688b245..30f6227 100755 --- a/util/install_helper.sh +++ b/util/install_helper.sh @@ -9,6 +9,7 @@ set -e sysconfdir="$1" bindir="$2" udevrulesdir="$3" +useroot="$4" # Both sysconfdir and bindir are absolute paths (since they are joined # with --prefix in meson.build), but need to be interpreted relative @@ -22,16 +23,17 @@ else DESTDIR="${DESTDIR%/}" fi -chown root:root "${DESTDIR}${bindir}/fusermount3" -chmod u+s "${DESTDIR}${bindir}/fusermount3" - install -D -m 644 "${MESON_SOURCE_ROOT}/util/fuse.conf" \ "${DESTDIR}${sysconfdir}/fuse.conf" +if $useroot; then + chown root:root "${DESTDIR}${bindir}/fusermount3" + chmod u+s "${DESTDIR}${bindir}/fusermount3" -if test ! -e "${DESTDIR}/dev/fuse"; then - mkdir -p "${DESTDIR}/dev" - mknod "${DESTDIR}/dev/fuse" -m 0666 c 10 229 + if test ! -e "${DESTDIR}/dev/fuse"; then + mkdir -p "${DESTDIR}/dev" + mknod "${DESTDIR}/dev/fuse" -m 0666 c 10 229 + fi fi install -D -m 644 "${MESON_SOURCE_ROOT}/util/udev.rules" \ diff --git a/util/meson.build b/util/meson.build index aa0e734..5c8f1b5 100644 --- a/util/meson.build +++ b/util/meson.build @@ -23,6 +23,7 @@ endif meson.add_install_script('install_helper.sh', join_paths(get_option('prefix'), get_option('sysconfdir')), join_paths(get_option('prefix'), get_option('bindir')), - udevrulesdir) + udevrulesdir, + '@0@'.format(get_option('useroot'))) -- cgit v1.2.1