meson-post-install.sh 1.35 KB
Newer Older
1 2 3 4 5 6
#!/bin/sh

datadir=$1
bindir=$2
pkgconfdir=$3
pkglibdir=$4
7
pkgstatedir=$5
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

[ -n "$DESTDIR" ] && DESTDIR=${DESTDIR%%/}/

if [ -f "${DESTDIR}${datadir}/bash-completion/completions/nmcli-completion" ]; then
    mv "${DESTDIR}${datadir}/bash-completion/completions/nmcli-completion" \
       "${DESTDIR}${datadir}/bash-completion/completions/nmcli"
fi

if [ -x "${DESTDIR}${bindir}/nmtui" ]; then
    for alias in nmtui-connect nmtui-edit nmtui-hostname; do
        ln -sf nmtui "${DESTDIR}${bindir}/$alias"
    done
fi

for dir in "${pkgconfdir}/conf.d" \
           "${pkgconfdir}/system-connections" \
           "${pkgconfdir}/dispatcher.d/no-wait.d" \
           "${pkgconfdir}/dispatcher.d/pre-down.d" \
           "${pkgconfdir}/dispatcher.d/pre-up.d" \
           "${pkgconfdir}/dnsmasq.d" \
           "${pkgconfdir}/dnsmasq-shared.d" \
29 30
           "${pkglibdir}/conf.d" \
           "${pkglibdir}/VPN"; do
31
    mkdir -p "${DESTDIR}${dir}"
32
    chmod 0755 "${DESTDIR}${dir}"
33 34
done

35 36 37
mkdir -p "${DESTDIR}${pkgstatedir}"
chmod 0700 "${DESTDIR}${pkgstatedir}"

38 39 40 41 42 43 44
if [ "$6" = install_docs ]; then
    mandir=$7

    for alias in nmtui-connect nmtui-edit nmtui-hostname; do
        ln -f "${DESTDIR}${mandir}/man1/nmtui.1" "${DESTDIR}${mandir}/man1/${alias}.1"
    done

45
    ln -f "${DESTDIR}${mandir}/man5/NetworkManager.conf.5" "${DESTDIR}${mandir}/man5/nm-system-settings.conf.5"
46 47
fi