summaryrefslogtreecommitdiff
path: root/util/install_helper.sh
blob: 30f6227b9e96495c7e75991d53fad925359af208 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
#
# Don't call this script. It is used internally by the Meson
# build system. Thank you for your cooperation.
#

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
# to DESTDIR (if specified).

if [ -z "${DESTDIR}" ]; then
    # Prevent warnings about uninitialized variable
    DESTDIR=""
else
    # Get rid of duplicate slash
    DESTDIR="${DESTDIR%/}"
fi

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
    fi
fi

install -D -m 644 "${MESON_SOURCE_ROOT}/util/udev.rules" \
        "${DESTDIR}${udevrulesdir}/99-fuse3.rules"

install -D -m 755 "${MESON_SOURCE_ROOT}/util/init_script" \
        "${DESTDIR}${sysconfdir}/init.d/fuse3"


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 ${sysconfdir}/init.d/fuse3 init script"
fi