From c2d4114427421864f9152856c6e2b4b9ff6d83dd Mon Sep 17 00:00:00 2001 From: rofl0r Date: Tue, 11 Aug 2020 14:52:16 +0100 Subject: [PATCH] add support for asciidoctor to generate manpages asciidoctor is a modern replacement for asciidoc and much more lightweight, issuing "apt-get install asciidoc" on ubuntu 16.04 results in an attempt to install more than 1.3 GB of dependencies. --- configure.ac | 6 +++++- docs/man5/Makefile.am | 8 +++++++- docs/man8/Makefile.am | 8 +++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 6ddbcc0..623d9a4 100644 --- a/configure.ac +++ b/configure.ac @@ -181,6 +181,10 @@ AM_CONDITIONAL(HAVE_XSLTPROC, test "x$XSLTPROC" != "xno") AC_PATH_PROG(A2X, a2x, no) AM_CONDITIONAL(HAVE_A2X, test "x$A2X" != "xno") +# Check for asciidoctor +AC_PATH_PROG(ASCIIDOCTOR, asciidoctor, no) +AM_CONDITIONAL(HAVE_ASCIIDOCTOR, test "x$ASCIIDOCTOR" != "xno") + # checking xmllint AC_PATH_PROG(XMLLINT, xmllint, no) if test "x$XMLLINT" != "xno"; then @@ -221,7 +225,7 @@ AC_OUTPUT # runtime, so we need to touch them after config.status terminated to prevent # make from rebuild them. -if test "x$A2X" = "xno"; then +if test "x$A2X" = "xno" -a "x$HAVE_ASCIIDOCTOR" = "xno" ; then touch docs/man5/tinyproxy.conf.txt touch docs/man8/tinyproxy.txt if test -e docs/man5/tinyproxy.conf.5 ; then diff --git a/docs/man5/Makefile.am b/docs/man5/Makefile.am index 247b7ef..48e5b03 100644 --- a/docs/man5/Makefile.am +++ b/docs/man5/Makefile.am @@ -7,6 +7,8 @@ else A2X_ARGS = -d manpage -f manpage -L endif +ASCIIDOCTOR_ARGS = -b manpage + man_MANS = \ $(MAN5_FILES:.txt=.5) @@ -14,7 +16,11 @@ man_MANS = \ if HAVE_A2X $(AM_V_GEN) $(A2X) $(A2X_ARGS) $< else - @echo "*** a2x (asciidoc) is required to regenerate $(@) ***"; exit 1; +if HAVE_ASCIIDOCTOR + $(AM_V_GEN) $(ASCIIDOCTOR) $(ASCIIDOCTOR_ARGS) $< +else + @echo "*** a2x (asciidoc) or asciidoctor is required to regenerate $(@) ***"; exit 1; +endif endif CLEANFILES = \ diff --git a/docs/man8/Makefile.am b/docs/man8/Makefile.am index 1bd0ffa..5e2f390 100644 --- a/docs/man8/Makefile.am +++ b/docs/man8/Makefile.am @@ -7,6 +7,8 @@ else A2X_ARGS = -d manpage -f manpage -L endif +ASCIIDOCTOR_ARGS = -b manpage + man_MANS = \ $(MAN8_FILES:.txt=.8) @@ -14,7 +16,11 @@ man_MANS = \ if HAVE_A2X $(AM_V_GEN) $(A2X) $(A2X_ARGS) $< else - @echo "*** a2x (asciidoc) is required to regenerate $(@) ***"; exit 1; +if HAVE_ASCIIDOCTOR + $(AM_V_GEN) $(ASCIIDOCTOR) $(ASCIIDOCTOR_ARGS) $< +else + @echo "*** a2x (asciidoc) or asciidoctor is required to regenerate $(@) ***"; exit 1; +endif endif CLEANFILES = \