From d709f319232ae40302b7cd73ab945c3d76be01f3 Mon Sep 17 00:00:00 2001 From: Nikolaus Rath Date: Fri, 31 Aug 2018 13:38:26 +0200 Subject: Do not hardcode /etc/fuse.conf path. --- util/install_helper.sh | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'util/install_helper.sh') diff --git a/util/install_helper.sh b/util/install_helper.sh index 48a8927..688b245 100755 --- a/util/install_helper.sh +++ b/util/install_helper.sh @@ -9,10 +9,25 @@ set -e sysconfdir="$1" bindir="$2" udevrulesdir="$3" -prefix="${MESON_INSTALL_DESTDIR_PREFIX}" -chown root:root "${prefix}/${bindir}/fusermount3" -chmod u+s "${prefix}/${bindir}/fusermount3" +# Both sysconfdir and bindir are absolute paths (since they are joined +# with --prefix in meson.build), but need to be interpreted relative +# to DESTDIR (if specified). + +if [ -z "${DESTDIR}" ]; then + # Prevent warnings about uninitialized variable + DESTDIR="" +else + # Get rid of duplicate slash + 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 test ! -e "${DESTDIR}/dev/fuse"; then mkdir -p "${DESTDIR}/dev" @@ -20,19 +35,17 @@ if test ! -e "${DESTDIR}/dev/fuse"; then fi install -D -m 644 "${MESON_SOURCE_ROOT}/util/udev.rules" \ - "${DESTDIR}/${udevrulesdir}/99-fuse3.rules" + "${DESTDIR}${udevrulesdir}/99-fuse3.rules" install -D -m 755 "${MESON_SOURCE_ROOT}/util/init_script" \ - "${DESTDIR}/etc/init.d/fuse3" + "${DESTDIR}${sysconfdir}/init.d/fuse3" -install -D -m 644 "${MESON_SOURCE_ROOT}/util/fuse.conf" \ - "${DESTDIR}/etc/fuse.conf" if test -x /usr/sbin/update-rc.d && test -z "${DESTDIR}"; then /usr/sbin/update-rc.d fuse3 start 34 S . start 41 0 6 . || /bin/true else echo "== FURTHER ACTION REQUIRED ==" - echo "Make sure that your init system will start the ${DESTDIR}/etc/init.d/fuse3 init script" + echo "Make sure that your init system will start the ${sysconfdir}/init.d/fuse3 init script" fi -- cgit v1.2.3