aboutsummaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2021-08-22 13:09:30 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2021-09-04 16:01:29 -0500
commitd6622a1156929294b909d08273fd227c7d817bb9 (patch)
tree29df9fc3ecae9e72e467effc91f3985eafaccd82 /man
parent92004a2ed65045b7ca79063dda8fc5b4ac761606 (diff)
add meson build files
Closes #116. Closes #171. Closes #172. Closes #175.
Diffstat (limited to 'man')
-rw-r--r--man/meson.build34
-rwxr-xr-xman/meson_man_links.sh20
2 files changed, 54 insertions, 0 deletions
diff --git a/man/meson.build b/man/meson.build
new file mode 100644
index 00000000..37617ca6
--- /dev/null
+++ b/man/meson.build
@@ -0,0 +1,34 @@
+man3 = [
+ 'einfo.3',
+ 'rc_config.3',
+ 'rc_deptree.3',
+ 'rc_find_pids.3',
+ 'rc_plugin_hook.3',
+ 'rc_runlevel.3',
+ 'rc_service.3',
+ 'rc_stringlist.3',
+ ]
+
+man8 = [
+ 'openrc.8',
+ 'openrc-run.8',
+ 'rc-service.8',
+ 'rc-status.8',
+ 'rc-update.8',
+ 'start-stop-daemon.8',
+ 'supervise-daemon.8',
+ ]
+
+if os == 'Linux'
+ man8 = man8 + [
+ 'rc-sstat.8',
+ 'openrc-init.8',
+ 'openrc-shutdown.8',
+ ]
+endif
+
+install_data(man3,
+ install_dir : get_option('mandir') / 'man3')
+install_data(man8,
+ install_dir : get_option('mandir') / 'man8')
+meson.add_install_script('meson_man_links.sh', get_option('mandir'), man3 + man8)
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