mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-01 08:20:11 +01:00
Adapt the meson post-installation script to handle the $DESTDIR variable supplied by user to specify the installation target directory. While at it, convert the script to shell because it seems simpler to me.
44 lines
1.3 KiB
Bash
Executable file
44 lines
1.3 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
datadir=$1
|
|
bindir=$2
|
|
pkgconfdir=$3
|
|
pkglibdir=$4
|
|
localstatedir=$5
|
|
|
|
[ -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" \
|
|
"${pkgconfdir}/conf.d" \
|
|
"${pkgconfdir}/VPN" \
|
|
"${localstatedir}/lib/NetworkManager"; do
|
|
mkdir -p "${DESTDIR}${dir}"
|
|
done
|
|
|
|
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
|
|
|
|
ln -f "${DESTDIR}${mandir}/man5/NetworkManager.conf.5" "${DESTDIR}${mandir}/man5/nm-system-settings.conf"
|
|
fi
|
|
|