diff options
Diffstat (limited to 'man/meson.build')
-rw-r--r-- | man/meson.build | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/man/meson.build b/man/meson.build new file mode 100644 index 0000000..88f34ef --- /dev/null +++ b/man/meson.build @@ -0,0 +1,48 @@ +# SPDX-License-Identifier: LGPL-2.1+ + +man_pages = [ + { + 'section': '1', + 'name': 'minecctl', + }, { + 'section': '5', + 'name': 'minecproxy.conf', + } +] + +xsltproc = find_program('xsltproc') + +xsl = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl' +xsl_test = run_command(xsltproc, '--nonet', xsl) +if xsl_test.returncode() != 0 + error('The DocBook XSL stylesheet for "@0@" was not found.'.format(xsl)) +endif + +xsltproc_flags = [ + '--nonet', + '--stringparam', 'man.output.quietly', '1', + '--stringparam', 'funcsynopsis.style', 'ansi', + '--stringparam', 'man.authors.section.enabled', '0', + '--stringparam', 'man.copyright.section.enabled', '0', +] + +xslt_cmd = [xsltproc, xsltproc_flags, '-o', '@OUTPUT0@', xsl, '@INPUT@'] + +foreach man_page: man_pages + section = man_page['section'] + name = man_page['name'] + xml_input = name + '.xml' + man_output = name + '.' + section + + page = custom_target( + man_output, + input: xml_input, + output: man_output, + command: xslt_cmd, + build_by_default: true, + install: true, + install_dir: join_paths(get_option('mandir'), 'man' + section), + ) +endforeach + + |