openrc/man/meson_man_links.sh
William Hubbs d6622a1156 add meson build files
Closes #116.
Closes #171.
Closes #172.
Closes #175.
2021-09-04 16:01:29 -05:00

21 lines
396 B
Bash
Executable File

#!/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