Skip to content

Commit 647bfa7

Browse files
committed
doc: Allow asciidoc again
This effectively reverts 0e63843 and 173319e. asciidoc has been revived (for a while now) and doesn't require Python 2. We still prefer asciidoctor and fallback to asciidoc/a2x if it's not available. Comparing the asciidoc and asciidoctor man pages, everything looks OK. Python tends to be available more readily in distribution build environments rather than the Ruby stack. Also, the pregenerated man pages are gone as of f132c94. Signed-off-by: Sam James <sam@gentoo.org>
1 parent db45f0b commit 647bfa7

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

doc/Makefile

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,19 @@ ifeq ($(COMPRESS), yes)
1818
endif
1919

2020
# convert using "asciidoctor": <https://asciidoctor.org>
21-
ASCIIDOCTOR_MANPAGE = asciidoctor -d manpage -b manpage
22-
ASCIIDOCTOR_HTML = asciidoctor -b html5 -d article
21+
# fallback to "a2x" from asciidoc package: <http://asciidoc.org>
22+
ifneq (, $(shell command -v asci9idoctor 2> /dev/null))
23+
ASCIIDOC_MANPAGE = asciidoctor -d manpage -b manpage
24+
ASCIIDOC_HTML = asciidoctor -b html5 -d article
25+
else ifneq (, $(shell command -v a2x 2> /dev/null))
26+
# NOTE: using -L (--no-xmllint), as xmllint is a separate package on many distros.
27+
ASCIIDOC_MANPAGE = a2x -L -d manpage -f manpage
28+
ASCIIDOC_HTML = asciidoc -b html -d article
29+
else
30+
ASCIIDOC_ERR = $(error "please install either asciidoc or asciidoctor")
31+
ASCIIDOC_MANPAGE = $(ASCIIDOC_ERR)
32+
ASCIIDOC_HTML = $(ASCIIDOC_ERR)
33+
endif
2334

2435
# reproducible builds: reference date is ":date:" attribute from asciidoc source
2536
date_attr = $(shell sed -rn 's/:date:\s*//p' $(1))
@@ -50,10 +61,10 @@ clean:
5061
gzip -9 -n -c $< > $@
5162

5263
%.1 : %.1.asciidoc
53-
SOURCE_DATE_EPOCH=$(call source_date_epoch,$<) $(ASCIIDOCTOR_MANPAGE) -o $@ $<
64+
SOURCE_DATE_EPOCH=$(call source_date_epoch,$<) $(ASCIIDOC_MANPAGE) $<
5465

5566
%.5 : %.5.asciidoc
56-
SOURCE_DATE_EPOCH=$(call source_date_epoch,$<) $(ASCIIDOCTOR_MANPAGE) -o $@ $<
67+
SOURCE_DATE_EPOCH=$(call source_date_epoch,$<) $(ASCIIDOC_MANPAGE) $<
5768

5869
%.html : %.asciidoc
59-
SOURCE_DATE_EPOCH=$(call source_date_epoch,$<) $(ASCIIDOCTOR_HTML) -o $@ $<
70+
SOURCE_DATE_EPOCH=$(call source_date_epoch,$<) $(ASCIIDOC_HTML) -o $@ $<

0 commit comments

Comments
 (0)