summaryrefslogtreecommitdiffstats
path: root/share/man/Makefile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-25 06:01:17 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-25 06:01:17 +0000
commit9676caa0c8ad63964c7b4eb899757aebb9e9aefb (patch)
tree4f32728fc58c3ad154a5e35c44de96a328c46461 /share/man/Makefile
parentAdding upstream version 20210724. (diff)
downloadopen-infrastructure-compute-tools-9676caa0c8ad63964c7b4eb899757aebb9e9aefb.tar.xz
open-infrastructure-compute-tools-9676caa0c8ad63964c7b4eb899757aebb9e9aefb.zip
Adding upstream version 20210725.upstream/20210725
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'share/man/Makefile')
-rw-r--r--share/man/Makefile39
1 files changed, 27 insertions, 12 deletions
diff --git a/share/man/Makefile b/share/man/Makefile
index 2ef1507..a8af58d 100644
--- a/share/man/Makefile
+++ b/share/man/Makefile
@@ -1,4 +1,4 @@
-# Makefile
+# Open Infrastructure: compute-tools
# Copyright (C) 2014-2021 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
@@ -17,28 +17,43 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-# Depends: asciidoc dblatex docbook-xsl libxml2-utils source-highlight
+# Depends: python3-docutils
-A2X = a2x \
- --asciidoc-opts="-a revdate=$(shell cat ../../VERSION.txt)" \
- --doctype=manpage
+RST2MAN = rst2man \
+ --no-datestamp \
+ --no-generator \
+ --strict \
+ --strip-comments \
+ --tab-width=4 \
+ --verbose
+
+VERSION := $(shell cat ../../VERSION.txt)
SHELL := sh -e
all: build
-clean:
- rm -f *.[0-9]
- rm -f *.xml
-
build: man
rebuild: clean build
-man: *.txt
- for FILE in *.txt; \
+man: man.in *.rst
+ @echo -n "Creating manpages... "
+
+ @for FILE in *.rst; \
do \
- $(A2X) --format=manpage $${FILE}; \
+ cp man.in $$(basename $${FILE} .rst); \
+ $(RST2MAN) $${FILE} | \
+ sed -e '/^.\\" Man page generated/d' \
+ -e '/^.\\" Generated by/d' \
+ -e "s|^\(.TH .*\) \(\"\" \"\"\) |\1 $${VERSION} compute-tools |" \
+ >> $$(basename $${FILE} .rst); \
+ echo -n "."; \
done
+ @echo " done."
+
+clean:
+ rm -f *.[0-9]
+
.PHONY: all clean build rebuild man