2020-12-23 22:21:36 +01:00
|
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
2020-01-14 10:42:24 +01:00
|
|
|
|
2018-09-14 17:41:09 +02:00
|
|
|
common_ent_file = configure_file(
|
2019-08-28 10:40:46 +02:00
|
|
|
input: 'common.ent.in',
|
|
|
|
|
output: '@BASENAME@',
|
2019-11-21 15:27:21 +01:00
|
|
|
configuration: data_conf,
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
xsltproc_options = [
|
|
|
|
|
xsltproc,
|
|
|
|
|
'--output', '@OUTPUT@',
|
|
|
|
|
'--path', meson.current_build_dir(),
|
|
|
|
|
'--xinclude',
|
|
|
|
|
'--nonet',
|
|
|
|
|
'--stringparam', 'man.output.quietly', '1',
|
|
|
|
|
'--stringparam', 'funcsynopsis.style', 'ansi',
|
|
|
|
|
'--stringparam', 'man.th.extra1.suppress', '1',
|
|
|
|
|
'--stringparam', 'man.authors.section.enabled', '0',
|
|
|
|
|
'--stringparam', 'man.copyright.section.enabled', '0',
|
2018-10-18 12:50:20 +02:00
|
|
|
'--stringparam', 'man.th.title.max.length', '30',
|
2017-11-25 11:39:06 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
docbook_xls = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl'
|
|
|
|
|
|
|
|
|
|
mans_xmls = []
|
|
|
|
|
|
|
|
|
|
mans = [
|
|
|
|
|
['NetworkManager', '8'],
|
2021-03-16 14:30:58 +01:00
|
|
|
['NetworkManager-dispatcher', '8'],
|
2022-03-02 11:05:45 +01:00
|
|
|
['NetworkManager-wait-online.service', '8'],
|
2017-11-25 11:39:06 +01:00
|
|
|
['NetworkManager.conf', '5'],
|
|
|
|
|
['nm-online', '1'],
|
|
|
|
|
['nmcli-examples', '7'],
|
|
|
|
|
['nmcli', '1'],
|
2018-09-22 09:17:07 +02:00
|
|
|
['nmtui', '1'],
|
|
|
|
|
['nm-initrd-generator', '8'],
|
2017-11-25 11:39:06 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
if enable_ovs
|
|
|
|
|
mans += [['nm-openvswitch', '7']]
|
|
|
|
|
endif
|
|
|
|
|
|
2020-12-03 18:12:21 +01:00
|
|
|
if enable_nm_cloud_setup
|
|
|
|
|
mans += [['nm-cloud-setup', '8']]
|
|
|
|
|
endif
|
|
|
|
|
|
2017-11-25 11:39:06 +01:00
|
|
|
foreach man: mans
|
|
|
|
|
input = man[0] + '.xml'
|
|
|
|
|
content_files += join_paths(meson.current_source_dir(), input)
|
|
|
|
|
|
|
|
|
|
output = '@0@.@1@'.format(man[0], man[1])
|
|
|
|
|
|
|
|
|
|
custom_target(
|
|
|
|
|
output,
|
|
|
|
|
input: input,
|
|
|
|
|
output: output,
|
|
|
|
|
command: xsltproc_options + [docbook_xls, '@INPUT@'],
|
2018-09-14 17:41:09 +02:00
|
|
|
depend_files: common_ent_file,
|
2017-11-25 11:39:06 +01:00
|
|
|
install: true,
|
2018-10-18 12:50:20 +02:00
|
|
|
install_dir: join_paths(nm_mandir, 'man' + man[1]),
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
|
|
if enable_introspection
|
2020-06-09 18:53:47 +02:00
|
|
|
|
|
|
|
|
name = 'dbus'
|
|
|
|
|
nm_settings_docs_xml_dbus = custom_target(
|
|
|
|
|
'nm-settings-docs-' + name + '.xml',
|
man nm-setting-*: proper format for gtkdoc constants
Gtkdoc comments are used, among other things, to generate the various
nm-setting-* manual pages. When a constant is referenced in a gtkdoc
comment (i.e. `%NM_IP_TUNNEL_MODE_IPIP`) it is expanded to show the C name
and the value (i.e. `NM_IP_TUNNEL_MODE_IPIP (1)`). To generate the
nm-setting-* manual pages, we don't use gtkdoc, but we process this data
with the custom script tools/generate-docs-nm-settings-docs-gir.py.
This script was expanding the constants in the same way than gtkdoc.
Showing the constants in that way in nm-setting-* manual pages makes
little sense, because users are not going to use the C identifiers.
Let's show them with a more appropriate format.
Additionally, the different nm-setting-* pages might require different
formats than the other. For example, for nm-setting-nmcli a format like
`"ipip" (1)` is prefered, but for nm-setting-dbus it's better
`1 (ipip)`. Let's generate different nm-settings-docs-gir-*.xml files for
nmcli, dbus, keyfile and ifcfg-rh, using the right format for each one.
2023-09-07 08:33:22 +02:00
|
|
|
input: [nm_settings_docs_xml_gir[name], nm_property_infos_xml[name]],
|
2020-06-09 18:53:47 +02:00
|
|
|
output: 'nm-settings-docs-' + name + '.xml',
|
|
|
|
|
command: [
|
|
|
|
|
python.path(),
|
2020-06-09 23:22:34 +02:00
|
|
|
join_paths(meson.source_root(), 'tools', 'generate-docs-nm-settings-docs-merge.py'),
|
2020-06-09 18:53:47 +02:00
|
|
|
'@OUTPUT@',
|
|
|
|
|
nm_property_infos_xml[name],
|
man nm-setting-*: proper format for gtkdoc constants
Gtkdoc comments are used, among other things, to generate the various
nm-setting-* manual pages. When a constant is referenced in a gtkdoc
comment (i.e. `%NM_IP_TUNNEL_MODE_IPIP`) it is expanded to show the C name
and the value (i.e. `NM_IP_TUNNEL_MODE_IPIP (1)`). To generate the
nm-setting-* manual pages, we don't use gtkdoc, but we process this data
with the custom script tools/generate-docs-nm-settings-docs-gir.py.
This script was expanding the constants in the same way than gtkdoc.
Showing the constants in that way in nm-setting-* manual pages makes
little sense, because users are not going to use the C identifiers.
Let's show them with a more appropriate format.
Additionally, the different nm-setting-* pages might require different
formats than the other. For example, for nm-setting-nmcli a format like
`"ipip" (1)` is prefered, but for nm-setting-dbus it's better
`1 (ipip)`. Let's generate different nm-settings-docs-gir-*.xml files for
nmcli, dbus, keyfile and ifcfg-rh, using the right format for each one.
2023-09-07 08:33:22 +02:00
|
|
|
nm_settings_docs_xml_gir[name],
|
2020-06-09 18:53:47 +02:00
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
name = 'nmcli'
|
|
|
|
|
nm_settings_docs_xml_nmcli = custom_target(
|
|
|
|
|
'nm-settings-docs-' + name + '.xml',
|
man nm-setting-*: proper format for gtkdoc constants
Gtkdoc comments are used, among other things, to generate the various
nm-setting-* manual pages. When a constant is referenced in a gtkdoc
comment (i.e. `%NM_IP_TUNNEL_MODE_IPIP`) it is expanded to show the C name
and the value (i.e. `NM_IP_TUNNEL_MODE_IPIP (1)`). To generate the
nm-setting-* manual pages, we don't use gtkdoc, but we process this data
with the custom script tools/generate-docs-nm-settings-docs-gir.py.
This script was expanding the constants in the same way than gtkdoc.
Showing the constants in that way in nm-setting-* manual pages makes
little sense, because users are not going to use the C identifiers.
Let's show them with a more appropriate format.
Additionally, the different nm-setting-* pages might require different
formats than the other. For example, for nm-setting-nmcli a format like
`"ipip" (1)` is prefered, but for nm-setting-dbus it's better
`1 (ipip)`. Let's generate different nm-settings-docs-gir-*.xml files for
nmcli, dbus, keyfile and ifcfg-rh, using the right format for each one.
2023-09-07 08:33:22 +02:00
|
|
|
input: [nm_settings_docs_xml_gir[name], nm_property_infos_xml[name]],
|
2020-06-09 18:53:47 +02:00
|
|
|
output: 'nm-settings-docs-' + name + '.xml',
|
|
|
|
|
command: [
|
|
|
|
|
python.path(),
|
2020-06-09 23:22:34 +02:00
|
|
|
join_paths(meson.source_root(), 'tools', 'generate-docs-nm-settings-docs-merge.py'),
|
docs: fix build with meson
Fix the following build error with meson:
/usr/bin/python3 /home/bgalvani/work/NetworkManager/tools/generate-docs-nm-settings-docs-merge.py man/nm-settings-docs-nmcli.xml --only-from-first clients/cli/generate-docs-nm-settings-nmcli.xml libnm/nm-propery-infos-nmcli.xml libnm/nm-settings-docs-gir.xml
Traceback (most recent call last):
File "/home/bgalvani/work/NetworkManager/tools/generate-docs-nm-settings-docs-merge.py", line 120, in <module>
xml_roots = list([ET.parse(f).getroot() for f in gl_input_files])
File "/home/bgalvani/work/NetworkManager/tools/generate-docs-nm-settings-docs-merge.py", line 120, in <listcomp>
xml_roots = list([ET.parse(f).getroot() for f in gl_input_files])
File "/usr/lib64/python3.8/xml/etree/ElementTree.py", line 1202, in parse
tree.parse(source, parser)
File "/usr/lib64/python3.8/xml/etree/ElementTree.py", line 584, in parse
source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '--only-from-first'
Fixes: 3c11116c484d ('docs: in "generate-docs-nm-settings-docs-merge.py" only take properties from first setting')
2020-06-12 16:01:28 +02:00
|
|
|
'@OUTPUT@',
|
docs: rework selecting properties with "generate-docs-nm-settings-docs-merge.py"
"generate-docs-nm-settings-docs-merge.py" merges properties from
multiple XMLs. It supported an argument "--only-from-first", to
only select properties that were in the first of the provided XMLs.
The idea is that the first XML would be "src/nmcli/gen-metadata-nm-settings-nmcli.xml"
which is generated from nmcli meta-data and exactly describes the
supported properties. For example, "connection.read-only", "user.data"
or "wireless.tx-power" exist as properties somewhere, but not supported
by nmcli.
Change that, to not tie the selected property to the first XML.
"gen-metadata-nm-settings-nmcli.xml" is the XML that contains which
properties to select from, but "src/libnm-client-impl/nm-property-infos-nmcli.xml"
contains hand crafted descriptions. The latter descriptions are
preferred. As the order of the XML is already relevant for which
description is preferred, the selection is orthogonal to that.
With this, prefer descriptions from "src/libnm-client-impl/nm-property-infos-nmcli.xml"
but still select properties from "src/nmcli/gen-metadata-nm-settings-nmcli.xml".
Note that the argument is only used to generate "man/nm-settings-docs-nmcli.xml",
and with the current input, there is no actual change in behavior.
2023-05-18 22:17:55 +02:00
|
|
|
'--only-properties-from',
|
2022-10-26 10:19:19 +02:00
|
|
|
gen_metadata_nm_settings_nmcli_xml,
|
2020-06-09 18:53:47 +02:00
|
|
|
nm_property_infos_xml[name],
|
docs: rework selecting properties with "generate-docs-nm-settings-docs-merge.py"
"generate-docs-nm-settings-docs-merge.py" merges properties from
multiple XMLs. It supported an argument "--only-from-first", to
only select properties that were in the first of the provided XMLs.
The idea is that the first XML would be "src/nmcli/gen-metadata-nm-settings-nmcli.xml"
which is generated from nmcli meta-data and exactly describes the
supported properties. For example, "connection.read-only", "user.data"
or "wireless.tx-power" exist as properties somewhere, but not supported
by nmcli.
Change that, to not tie the selected property to the first XML.
"gen-metadata-nm-settings-nmcli.xml" is the XML that contains which
properties to select from, but "src/libnm-client-impl/nm-property-infos-nmcli.xml"
contains hand crafted descriptions. The latter descriptions are
preferred. As the order of the XML is already relevant for which
description is preferred, the selection is orthogonal to that.
With this, prefer descriptions from "src/libnm-client-impl/nm-property-infos-nmcli.xml"
but still select properties from "src/nmcli/gen-metadata-nm-settings-nmcli.xml".
Note that the argument is only used to generate "man/nm-settings-docs-nmcli.xml",
and with the current input, there is no actual change in behavior.
2023-05-18 22:17:55 +02:00
|
|
|
gen_metadata_nm_settings_nmcli_xml,
|
man nm-setting-*: proper format for gtkdoc constants
Gtkdoc comments are used, among other things, to generate the various
nm-setting-* manual pages. When a constant is referenced in a gtkdoc
comment (i.e. `%NM_IP_TUNNEL_MODE_IPIP`) it is expanded to show the C name
and the value (i.e. `NM_IP_TUNNEL_MODE_IPIP (1)`). To generate the
nm-setting-* manual pages, we don't use gtkdoc, but we process this data
with the custom script tools/generate-docs-nm-settings-docs-gir.py.
This script was expanding the constants in the same way than gtkdoc.
Showing the constants in that way in nm-setting-* manual pages makes
little sense, because users are not going to use the C identifiers.
Let's show them with a more appropriate format.
Additionally, the different nm-setting-* pages might require different
formats than the other. For example, for nm-setting-nmcli a format like
`"ipip" (1)` is prefered, but for nm-setting-dbus it's better
`1 (ipip)`. Let's generate different nm-settings-docs-gir-*.xml files for
nmcli, dbus, keyfile and ifcfg-rh, using the right format for each one.
2023-09-07 08:33:22 +02:00
|
|
|
nm_settings_docs_xml_gir[name],
|
2020-06-09 18:53:47 +02:00
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
nm_settings_docs_xml = {
|
|
|
|
|
'dbus': nm_settings_docs_xml_dbus,
|
|
|
|
|
'nmcli': nm_settings_docs_xml_nmcli,
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-25 11:39:06 +01:00
|
|
|
mans = [
|
2020-05-28 13:51:56 +02:00
|
|
|
['nm-settings-keyfile', '5', nm_property_infos_xml['keyfile']],
|
docs: add more nm-settings manpages (dbus,nmcli,keyfile,ifcfg-rh)
A significant part of NetworkManager's API are the connection profiles, documented
in `man nm-settings*`. But there are different aspects about profiles, depending
on what you are interested. There is the D-Bus API, nmcli options, keyfile format,
and ifcfg-rh format. Additionally, there is also libnm API.
Add distinct manual pages for the four aspects. Currently the two new manual
pages "nm-settings-dbus" and "nm-settings-nmcli" are still identical to the
former "nm-settings.5" manual. In the future, they will diverge to
account for the differences.
There are the following aspects:
- "dbus"
- "keyfile"
- "ifcfg-rh"
- "nmcli"
For "libnm" we don't generate a separate "nm-settings-libnm" manual
page. That is instead documented via gtk-doc.
Currently the keyfile and ifcfg-rh manual pages only detail settings
which differ. But later I think also these manual pages should contain
all settings that apply.
2020-06-02 19:24:12 +02:00
|
|
|
['nm-settings-dbus', '5', nm_settings_docs_xml['dbus']],
|
|
|
|
|
['nm-settings-nmcli', '5', nm_settings_docs_xml['nmcli']],
|
2017-11-25 11:39:06 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
if enable_ifcfg_rh
|
2020-05-28 13:51:56 +02:00
|
|
|
mans += [['nm-settings-ifcfg-rh', '5', nm_property_infos_xml['ifcfg-rh']]]
|
2017-11-25 11:39:06 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
foreach man: mans
|
|
|
|
|
output = man[0] + '.xml'
|
|
|
|
|
|
|
|
|
|
input = custom_target(
|
|
|
|
|
output,
|
|
|
|
|
input: man[2],
|
|
|
|
|
output: output,
|
2018-10-18 12:50:20 +02:00
|
|
|
command: xsltproc_options + [join_paths(meson.current_source_dir(), man[0] + '.xsl'), '@INPUT@'],
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
content_files += input.full_path()
|
|
|
|
|
|
|
|
|
|
output = '@0@.@1@'.format(man[0], man[1])
|
|
|
|
|
|
|
|
|
|
custom_target(
|
|
|
|
|
output,
|
|
|
|
|
input: input,
|
|
|
|
|
output: output,
|
|
|
|
|
command: xsltproc_options + [docbook_xls, '@INPUT@'],
|
|
|
|
|
install: true,
|
2018-10-18 12:50:20 +02:00
|
|
|
install_dir: join_paths(nm_mandir, 'man' + man[1]),
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
endforeach
|
|
|
|
|
endif
|