|
|
5a9041 |
From 1c8caf9fd542da587aa91a0dd7cc79f20925ab12 Mon Sep 17 00:00:00 2001
|
|
|
5a9041 |
From: Dave Dykstra <2129743+DrDaveD@users.noreply.github.com>
|
|
|
5a9041 |
Date: Fri, 24 May 2019 10:38:24 -0500
|
|
|
5a9041 |
Subject: [PATCH 1/3] skip install parts that require root when non-root
|
|
|
5a9041 |
|
|
|
5a9041 |
---
|
|
|
5a9041 |
util/install_helper.sh | 13 +++++++------
|
|
|
5a9041 |
1 file changed, 7 insertions(+), 6 deletions(-)
|
|
|
5a9041 |
|
|
|
5a9041 |
diff --git a/util/install_helper.sh b/util/install_helper.sh
|
|
|
5a9041 |
index 688b2450..061b16b0 100755
|
|
|
5a9041 |
--- a/util/install_helper.sh
|
|
|
5a9041 |
+++ b/util/install_helper.sh
|
|
|
5a9041 |
@@ -22,16 +22,17 @@ else
|
|
|
5a9041 |
DESTDIR="${DESTDIR%/}"
|
|
|
5a9041 |
fi
|
|
|
5a9041 |
|
|
|
5a9041 |
-chown root:root "${DESTDIR}${bindir}/fusermount3"
|
|
|
5a9041 |
-chmod u+s "${DESTDIR}${bindir}/fusermount3"
|
|
|
5a9041 |
-
|
|
|
5a9041 |
install -D -m 644 "${MESON_SOURCE_ROOT}/util/fuse.conf" \
|
|
|
5a9041 |
"${DESTDIR}${sysconfdir}/fuse.conf"
|
|
|
5a9041 |
|
|
|
5a9041 |
+if [ `id -u` = 0 ]; then
|
|
|
5a9041 |
+ chown root:root "${DESTDIR}${bindir}/fusermount3"
|
|
|
5a9041 |
+ chmod u+s "${DESTDIR}${bindir}/fusermount3"
|
|
|
5a9041 |
|
|
|
5a9041 |
-if test ! -e "${DESTDIR}/dev/fuse"; then
|
|
|
5a9041 |
- mkdir -p "${DESTDIR}/dev"
|
|
|
5a9041 |
- mknod "${DESTDIR}/dev/fuse" -m 0666 c 10 229
|
|
|
5a9041 |
+ if test ! -e "${DESTDIR}/dev/fuse"; then
|
|
|
5a9041 |
+ mkdir -p "${DESTDIR}/dev"
|
|
|
5a9041 |
+ mknod "${DESTDIR}/dev/fuse" -m 0666 c 10 229
|
|
|
5a9041 |
+ fi
|
|
|
5a9041 |
fi
|
|
|
5a9041 |
|
|
|
5a9041 |
install -D -m 644 "${MESON_SOURCE_ROOT}/util/udev.rules" \
|
|
|
5a9041 |
|
|
|
5a9041 |
From 67ec3873e0eaddb5ebafed0f9f81f29e944e91ee Mon Sep 17 00:00:00 2001
|
|
|
5a9041 |
From: Dave Dykstra <2129743+DrDaveD@users.noreply.github.com>
|
|
|
5a9041 |
Date: Wed, 3 Jul 2019 13:32:12 -0500
|
|
|
5a9041 |
Subject: [PATCH 2/3] add no-root configure option
|
|
|
5a9041 |
|
|
|
5a9041 |
---
|
|
|
5a9041 |
meson_options.txt | 8 ++++++--
|
|
|
5a9041 |
util/install_helper.sh | 3 ++-
|
|
|
5a9041 |
util/meson.build | 10 +++++++++-
|
|
|
5a9041 |
3 files changed, 17 insertions(+), 4 deletions(-)
|
|
|
5a9041 |
|
|
|
5a9041 |
diff --git a/meson_options.txt b/meson_options.txt
|
|
|
5a9041 |
index c08e38e4..c88b32d8 100644
|
|
|
5a9041 |
--- a/meson_options.txt
|
|
|
5a9041 |
+++ b/meson_options.txt
|
|
|
5a9041 |
@@ -5,7 +5,11 @@ option('udevrulesdir', type : 'string', value : '',
|
|
|
5a9041 |
description: 'Where to install udev rules (if empty, query pkg-config(1))')
|
|
|
5a9041 |
|
|
|
5a9041 |
option('utils', type : 'boolean', value : true,
|
|
|
5a9041 |
- description: 'Wheter or not to build and install helper programs')
|
|
|
5a9041 |
+ description: 'Whether or not to build and install helper programs')
|
|
|
5a9041 |
|
|
|
5a9041 |
option('examples', type : 'boolean', value : true,
|
|
|
5a9041 |
- description: 'Wheter or not to build example programs')
|
|
|
5a9041 |
\ No newline at end of file
|
|
|
5a9041 |
+ description: 'Whether or not to build example programs')
|
|
|
5a9041 |
+
|
|
|
5a9041 |
+option('no-root', type : 'boolean', value : false,
|
|
|
5a9041 |
+ description: 'Install files without root permissions')
|
|
|
5a9041 |
+
|
|
|
5a9041 |
diff --git a/util/install_helper.sh b/util/install_helper.sh
|
|
|
5a9041 |
index 061b16b0..30f6227b 100755
|
|
|
5a9041 |
--- a/util/install_helper.sh
|
|
|
5a9041 |
+++ b/util/install_helper.sh
|
|
|
5a9041 |
@@ -9,6 +9,7 @@ set -e
|
|
|
5a9041 |
sysconfdir="$1"
|
|
|
5a9041 |
bindir="$2"
|
|
|
5a9041 |
udevrulesdir="$3"
|
|
|
5a9041 |
+useroot="$4"
|
|
|
5a9041 |
|
|
|
5a9041 |
# Both sysconfdir and bindir are absolute paths (since they are joined
|
|
|
5a9041 |
# with --prefix in meson.build), but need to be interpreted relative
|
|
|
5a9041 |
@@ -25,7 +26,7 @@ fi
|
|
|
5a9041 |
install -D -m 644 "${MESON_SOURCE_ROOT}/util/fuse.conf" \
|
|
|
5a9041 |
"${DESTDIR}${sysconfdir}/fuse.conf"
|
|
|
5a9041 |
|
|
|
5a9041 |
-if [ `id -u` = 0 ]; then
|
|
|
5a9041 |
+if $useroot; then
|
|
|
5a9041 |
chown root:root "${DESTDIR}${bindir}/fusermount3"
|
|
|
5a9041 |
chmod u+s "${DESTDIR}${bindir}/fusermount3"
|
|
|
5a9041 |
|
|
|
5a9041 |
diff --git a/util/meson.build b/util/meson.build
|
|
|
5a9041 |
index aa0e734a..d273ca8e 100644
|
|
|
5a9041 |
--- a/util/meson.build
|
|
|
5a9041 |
+++ b/util/meson.build
|
|
|
5a9041 |
@@ -20,9 +20,17 @@ if udevrulesdir == ''
|
|
|
5a9041 |
udevrulesdir = join_paths(udev.get_pkgconfig_variable('udevdir'), 'rules.d')
|
|
|
5a9041 |
endif
|
|
|
5a9041 |
|
|
|
5a9041 |
+noroot = get_option('no-root')
|
|
|
5a9041 |
+if noroot
|
|
|
5a9041 |
+ useroot = 'false'
|
|
|
5a9041 |
+else
|
|
|
5a9041 |
+ useroot = 'true'
|
|
|
5a9041 |
+endif
|
|
|
5a9041 |
+
|
|
|
5a9041 |
meson.add_install_script('install_helper.sh',
|
|
|
5a9041 |
join_paths(get_option('prefix'), get_option('sysconfdir')),
|
|
|
5a9041 |
join_paths(get_option('prefix'), get_option('bindir')),
|
|
|
5a9041 |
- udevrulesdir)
|
|
|
5a9041 |
+ udevrulesdir,
|
|
|
5a9041 |
+ useroot)
|
|
|
5a9041 |
|
|
|
5a9041 |
|
|
|
5a9041 |
|
|
|
5a9041 |
From 12cf86c8a512a50766e088c3fcca532883ad1e5f Mon Sep 17 00:00:00 2001
|
|
|
5a9041 |
From: Dave Dykstra <2129743+DrDaveD@users.noreply.github.com>
|
|
|
5a9041 |
Date: Wed, 3 Jul 2019 17:25:50 -0500
|
|
|
5a9041 |
Subject: [PATCH 3/3] make the option useroot instead of no-root
|
|
|
5a9041 |
|
|
|
5a9041 |
---
|
|
|
5a9041 |
meson_options.txt | 4 ++--
|
|
|
5a9041 |
util/meson.build | 9 +--------
|
|
|
5a9041 |
2 files changed, 3 insertions(+), 10 deletions(-)
|
|
|
5a9041 |
|
|
|
5a9041 |
diff --git a/meson_options.txt b/meson_options.txt
|
|
|
5a9041 |
index c88b32d8..e778254c 100644
|
|
|
5a9041 |
--- a/meson_options.txt
|
|
|
5a9041 |
+++ b/meson_options.txt
|
|
|
5a9041 |
@@ -10,6 +10,6 @@ option('utils', type : 'boolean', value : true,
|
|
|
5a9041 |
option('examples', type : 'boolean', value : true,
|
|
|
5a9041 |
description: 'Whether or not to build example programs')
|
|
|
5a9041 |
|
|
|
5a9041 |
-option('no-root', type : 'boolean', value : false,
|
|
|
5a9041 |
- description: 'Install files without root permissions')
|
|
|
5a9041 |
+option('useroot', type : 'boolean', value : true,
|
|
|
5a9041 |
+ description: 'Set owner and setuid bits on installed file')
|
|
|
5a9041 |
|
|
|
5a9041 |
diff --git a/util/meson.build b/util/meson.build
|
|
|
5a9041 |
index d273ca8e..5c8f1b58 100644
|
|
|
5a9041 |
--- a/util/meson.build
|
|
|
5a9041 |
+++ b/util/meson.build
|
|
|
5a9041 |
@@ -20,17 +20,10 @@ if udevrulesdir == ''
|
|
|
5a9041 |
udevrulesdir = join_paths(udev.get_pkgconfig_variable('udevdir'), 'rules.d')
|
|
|
5a9041 |
endif
|
|
|
5a9041 |
|
|
|
5a9041 |
-noroot = get_option('no-root')
|
|
|
5a9041 |
-if noroot
|
|
|
5a9041 |
- useroot = 'false'
|
|
|
5a9041 |
-else
|
|
|
5a9041 |
- useroot = 'true'
|
|
|
5a9041 |
-endif
|
|
|
5a9041 |
-
|
|
|
5a9041 |
meson.add_install_script('install_helper.sh',
|
|
|
5a9041 |
join_paths(get_option('prefix'), get_option('sysconfdir')),
|
|
|
5a9041 |
join_paths(get_option('prefix'), get_option('bindir')),
|
|
|
5a9041 |
udevrulesdir,
|
|
|
5a9041 |
- useroot)
|
|
|
5a9041 |
+ '@0@'.format(get_option('useroot')))
|
|
|
5a9041 |
|
|
|
5a9041 |
|