3 # This is lame, I know, but meson has no other include mechanism
6 # TODO: add regeneration rule:
7 # python3 tools/make-man-rules.py --meson man/*xml > man/rules/meson.build
9 xsltproc = find_program('xsltproc')
13 '--stringparam', 'man.output.quietly', '1',
14 '--stringparam', 'funcsynopsis.style', 'ansi',
15 '--stringparam', 'man.authors.section.enabled', '0',
16 '--stringparam', 'man.copyright.section.enabled', '0',
17 '--stringparam', 'systemd.version', '@0@'.format(meson.project_version()),
19 '@0@:@1@'.format(meson.current_build_dir(), meson.current_source_dir())]
21 custom_man_xsl = files('custom-man.xsl')
22 custom_html_xsl = files('custom-man.xsl')
23 custom_entities_ent = files('custom-entities.ent')
25 foreach tuple : manpages
33 man = stem + '.' + section
37 foreach alias : aliases
38 manaliases += [alias + '.' + section]
39 htmlaliases += [alias + '.html']
42 mandirn = get_option('mandir') + '/man' + section
44 install = condition == '' or conf.get(condition, 0) == 1
49 output : [man] + manaliases,
50 command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_man_xsl, '@INPUT@'],
52 install_dir : mandirn)
57 output : [html] + htmlaliases,
58 command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_html_xsl, '@INPUT@'])
61 message('Skipping @0@.@1@ because @2@ is @3@'.format(stem, section, condition, install))
65 ############################################################
67 source_xml_files = files()
68 foreach tuple : manpages
69 source_xml_files += files(tuple[0] + '.xml')
72 systemd_directives_xml = custom_target(
73 'systemd.directives.xml',
74 input : source_xml_files,
75 output : 'systemd.directives.xml',
76 command : [make_directive_index_py, '@OUTPUT@'] + source_xml_files)
78 nonindex_xml_files = source_xml_files + [systemd_directives_xml]
79 systemd_index_xml = custom_target(
81 input : nonindex_xml_files,
82 output : 'systemd.index.xml',
83 command : [make_man_index_py, '@OUTPUT@'] + nonindex_xml_files)
85 foreach tuple : [['systemd.directives', '7', systemd_directives_xml],
86 ['systemd.index', '7', systemd_index_xml]]
92 man = stem + '.' + section
94 mandirn = get_option('mandir') + '/man' + section
100 command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_man_xsl, '@INPUT@'],
102 install_dir : mandirn)
108 command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_html_xsl, '@INPUT@'])