# SPDX-License-Identifier: GPL-2 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