summaryrefslogtreecommitdiffstats
path: root/scripts/update-docs.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-30 22:36:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-30 22:36:10 +0000
commit61d0a8bdffbbb7229776d2f4f2e79ed22d21551f (patch)
tree2e249969fedce45eb37ae6314ad167595900fe38 /scripts/update-docs.sh
parentReleasing debian version 1.4-4. (diff)
downloadlibnvme-61d0a8bdffbbb7229776d2f4f2e79ed22d21551f.tar.xz
libnvme-61d0a8bdffbbb7229776d2f4f2e79ed22d21551f.zip
Merging upstream version 1.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/update-docs.sh')
-rwxr-xr-xscripts/update-docs.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/scripts/update-docs.sh b/scripts/update-docs.sh
new file mode 100755
index 0000000..34d181e
--- /dev/null
+++ b/scripts/update-docs.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+cd "$(git rev-parse --show-toplevel)" || exit 1
+
+# build man docs
+BUILDDIR="$(mktemp -d)"
+echo "${BUILDDIR}"
+trap 'rm -rf -- ${BUILDDIR}' EXIT
+
+meson setup \
+ -Ddocs=man \
+ -Ddocs-build=true \
+ "${BUILDDIR}"
+meson compile \
+ -C "${BUILDDIR}"
+
+rm -rf doc/man
+mkdir doc/man
+
+find "${BUILDDIR}/doc" -maxdepth 1 -name '*.2' -exec cp {} doc/man \;
+
+# build ReST docs
+rm -rf -- "${BUILDDIR}"
+BUILDDIR="$(mktemp -d)"
+echo "${BUILDDIR}"
+trap 'rm -rf -- ${BUILDDIR}' EXIT
+
+meson setup \
+ -Ddocs=rst \
+ -Ddocs-build=true \
+ "${BUILDDIR}"
+meson compile \
+ -C "${BUILDDIR}"
+
+rm -rf doc/rst/*.rst
+mkdir -p doc/rst
+
+find "${BUILDDIR}/doc/rst" -maxdepth 1 -name '*.rst' -exec cp {} doc/rst \;
+
+cp "${BUILDDIR}/doc/conf.py" doc
+cp "${BUILDDIR}/doc/index.rst" doc
+cp "${BUILDDIR}/doc/config-schema.json" doc
+
+# build html docs
+# The HTML doc is not ready yet
+# rm -rf $DESTDIR/doc/html
+# cp -R $BUILDDIR/doc/html $DESTDIR/doc/
+