summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2021-07-25 00:53:13 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2021-07-25 05:27:12 +0000
commit43ebcdd3af57a7a9a94a4646c55001a9204d50f8 (patch)
tree16db7e7c4bb7ec8fcc443462c733bd2fe2c027e8
parentCorrecting check for shellcheck executable in Makefile. (diff)
downloadcompute-tools-43ebcdd3af57a7a9a94a4646c55001a9204d50f8.tar.xz
compute-tools-43ebcdd3af57a7a9a94a4646c55001a9204d50f8.zip
Updating build relevant stuff to move from asciidoc to rst for manpage generation.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
-rw-r--r--.gitignore1
-rw-r--r--Makefile4
-rw-r--r--share/man/Makefile32
3 files changed, 22 insertions, 15 deletions
diff --git a/.gitignore b/.gitignore
index 262c04a..d6d4fec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,2 @@
README.txt
share/man/*.[0-9]
-share/man/*.xml
diff --git a/Makefile b/Makefile
index 2819de5..0cb6291 100644
--- a/Makefile
+++ b/Makefile
@@ -63,10 +63,10 @@ test:
fi
@echo " done."
-build: share/man/*.txt
+build: share/man/*.rst
$(MAKE) -C share/man
- sed -n '/^NAME/,$$p' share/man/$(SOFTWARE).7.txt > README.txt
+ sed -n '/^===/,$$p' share/man/$(SOFTWARE).7.rst > README.txt
install: build
mkdir -p $(DESTDIR)/etc/$(SOFTWARE)/config
diff --git a/share/man/Makefile b/share/man/Makefile
index 2ef1507..ae5a737 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,36 @@
# 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
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: *.rst
+ @echo -n "Creating manpages... "
+
+ @for FILE in *.rst; \
do \
- $(A2X) --format=manpage $${FILE}; \
+ $(RST2MAN) $${FILE} > $$(basename $${FILE} .rst); \
+ echo -n "."; \
done
+ @echo " done."
+
+clean:
+ rm -f *.[0-9]
+
.PHONY: all clean build rebuild man