summaryrefslogtreecommitdiffstats
path: root/doc/meson.build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:26:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:26:00 +0000
commit830407e88f9d40d954356c3754f2647f91d5c06a (patch)
treed6a0ece6feea91f3c656166dbaa884ef8a29740e /doc/meson.build
parentInitial commit. (diff)
downloadknot-resolver-830407e88f9d40d954356c3754f2647f91d5c06a.tar.xz
knot-resolver-830407e88f9d40d954356c3754f2647f91d5c06a.zip
Adding upstream version 5.6.0.upstream/5.6.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'doc/meson.build')
-rw-r--r--doc/meson.build79
1 files changed, 79 insertions, 0 deletions
diff --git a/doc/meson.build b/doc/meson.build
new file mode 100644
index 0000000..72a8a7b
--- /dev/null
+++ b/doc/meson.build
@@ -0,0 +1,79 @@
+# documentation
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+# man page
+man_config = configuration_data()
+man_config.set('version', meson.project_version())
+man_config.set('date', run_command('../scripts/get-date.sh', check: true).stdout())
+
+man_config.set('man_seealso_systemd', '')
+if systemd_files == 'enabled'
+ man_config.set('man_seealso_systemd', '\\fIkresd.systemd(7)\\fR, ')
+endif
+
+man_kresd = configure_file(
+ input: 'kresd.8.in',
+ output: 'kresd.8',
+ configuration: man_config,
+)
+install_man(man_kresd)
+
+
+# html and info documentation
+if get_option('doc') == 'enabled'
+ message('--- doc dependencies ---')
+ doxygen = find_program('doxygen')
+ sphinx_build = find_program('sphinx-build-3', required: false)
+ if not sphinx_build.found()
+ sphinx_build = find_program('sphinx-build')
+ endif
+ makeinfo = find_program('makeinfo', required: false)
+
+ # python dependencies: breathe, sphinx_rtd_theme
+ python_breathe = run_command('python3', '-c', 'import breathe', check: false)
+ if python_breathe.returncode() != 0
+ # some distros might use python2 sphinx
+ python_breathe = run_command('python2', '-c', 'import breathe', check: false)
+ if python_breathe.returncode() != 0
+ error('missing doc dependency: python breathe')
+ else
+ python_sphinx_rtd_theme = run_command('python2', '-c', 'import sphinx_rtd_theme', check: false)
+ if python_sphinx_rtd_theme.returncode() != 0
+ error('missing doc dependency: python sphinx_rtd_theme')
+ endif
+ endif
+ else
+ python_sphinx_rtd_theme = run_command('python3', '-c', 'import sphinx_rtd_theme', check: false)
+ if python_sphinx_rtd_theme.returncode() != 0
+ error('missing doc dependency: python sphinx_rtd_theme')
+ endif
+ endif
+ message('------------------------')
+
+ # install html docs
+ install_subdir(
+ meson.current_source_dir() / 'html',
+ install_dir: doc_dir,
+ )
+
+ if makeinfo.found()
+ # install info docs
+ install_subdir(
+ meson.current_source_dir() / 'texinfo' / '.install',
+ strip_directory: true,
+ install_dir: info_dir,
+ )
+ endif
+endif
+
+make_doc = find_program('../scripts/make-doc.sh')
+run_target(
+ 'doc',
+ command: make_doc,
+)
+
+
+run_target(
+ 'doc-strict',
+ command: [make_doc, '-W'],
+)