aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDrDaveD <2129743+DrDaveD@users.noreply.github.com>2019-07-04 03:01:19 -0500
committerNikolaus Rath <Nikolaus@rath.org>2019-07-04 09:02:30 +0100
commitbe8db96603631ea85bb82a39c77a5514cbc47348 (patch)
treebdf100b07123bdc340031442c88142a16788078f
parentf0c52798b761280583379ba267b0ecc1ea34bbfc (diff)
downloadlibfuse-be8db96603631ea85bb82a39c77a5514cbc47348.tar.gz
Add build option to skip steps requiring root permissions
-rw-r--r--meson_options.txt8
-rwxr-xr-xutil/install_helper.sh14
-rw-r--r--util/meson.build3
3 files changed, 16 insertions, 9 deletions
diff --git a/meson_options.txt b/meson_options.txt
index c08e38e..8950ff1 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -5,7 +5,11 @@ option('udevrulesdir', type : 'string', value : '',
description: 'Where to install udev rules (if empty, query pkg-config(1))')
option('utils', type : 'boolean', value : true,
- description: 'Wheter or not to build and install helper programs')
+ description: 'Whether or not to build and install helper programs')
option('examples', type : 'boolean', value : true,
- description: 'Wheter or not to build example programs') \ No newline at end of file
+ description: 'Whether or not to build example programs')
+
+option('useroot', type : 'boolean', value : true,
+ description: 'Set owner and setuid bits on installed files')
+
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')))