aboutsummaryrefslogtreecommitdiff
path: root/man/meson_man_links.sh
diff options
context:
space:
mode:
Diffstat (limited to 'man/meson_man_links.sh')
-rwxr-xr-xman/meson_man_links.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/man/meson_man_links.sh b/man/meson_man_links.sh
new file mode 100755
index 00000000..17c21a99
--- /dev/null
+++ b/man/meson_man_links.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+get_links() {
+ sed -e 's/ ,//g' \
+ -e '/^\.Sh NAME$/,/\.Sh/ s/\.Nm //p' \
+ -n ${MESON_SOURCE_ROOT}/man/${1}
+}
+
+MANDIR="$1"
+shift
+for man in $@; do
+ prefix=${man%%.*}
+ suffix=${man#*.}
+ links=$(get_links ${man})
+ for link in ${links}; do
+ if [ "${link}" != "${prefix}" ]; then
+ ln -sf ${man} ${MESON_INSTALL_DESTDIR_PREFIX}/${MANDIR}/man${suffix}/${link}.${suffix}
+ fi
+ done
+done