From: Matt Turner <mattst88@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: Matt Turner <mattst88@gmail.com>
Subject: [PATCH nftables] doc: Include generated man pages in dist tarball
Date: Tue, 7 Apr 2020 12:05:08 -0700 [thread overview]
Message-ID: <20200407190508.21496-1-mattst88@gmail.com> (raw)
Most projects ship pre-generated man pages in the distribution tarball
so that builders don't need the documentation tools installed, similar
to how bison-generated sources are included.
To do this, we conditionalize the presence check of a2x on whether nft.8
already exists in the source directory, as it would exist if included in
the distribution tarball.
Secondly, we move the 'if BUILD_MAN' conditional to around the man page
generation rules. This ensures that the man pages are unconditionally
installed. Also only add the man pages to CLEANFILES if their generation
is enabled.
Signed-off-by: Matt Turner <mattst88@gmail.com>
---
configure.ac | 2 +-
doc/Makefile.am | 17 ++++++++---------
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/configure.ac b/configure.ac
index 6a25eeb3..a04d94bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,7 +50,7 @@ AC_EXEEXT
AC_DISABLE_STATIC
CHECK_GCC_FVISIBILITY
-AS_IF([test "x$enable_man_doc" = "xyes"], [
+AS_IF([test "x$enable_man_doc" = "xyes" -a ! -f "${srcdir}/doc/nft.8"], [
AC_CHECK_PROG(A2X, [a2x], [a2x], [no])
AS_IF([test "$A2X" = "no"],
[AC_MSG_ERROR([a2x not found, please install asciidoc])])
diff --git a/doc/Makefile.am b/doc/Makefile.am
index f0958b33..6bd90aa6 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,6 +1,4 @@
-if BUILD_MAN
man_MANS = nft.8 libnftables-json.5 libnftables.3
-endif
A2X_OPTS_MANPAGE = -L --doctype manpage --format manpage -D ${builddir}
@@ -13,6 +11,12 @@ ASCIIDOC_INCLUDES = \
statements.txt
ASCIIDOCS = ${ASCIIDOC_MAIN} ${ASCIIDOC_INCLUDES}
+EXTRA_DIST = ${ASCIIDOCS} ${man_MANS} libnftables-json.adoc libnftables.adoc
+
+CLEANFILES = \
+ *~
+
+if BUILD_MAN
nft.8: ${ASCIIDOCS}
${AM_V_GEN}${A2X} ${A2X_OPTS_MANPAGE} $<
@@ -22,10 +26,5 @@ nft.8: ${ASCIIDOCS}
.adoc.5:
${AM_V_GEN}${A2X} ${A2X_OPTS_MANPAGE} $<
-EXTRA_DIST = ${ASCIIDOCS} libnftables-json.adoc libnftables.adoc
-
-CLEANFILES = \
- nft.8 \
- libnftables-json.5 \
- libnftables.3 \
- *~
+CLEANFILES += ${man_MANS}
+endif
--
2.24.1
next reply other threads:[~2020-04-07 19:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-07 19:05 Matt Turner [this message]
2020-04-17 19:38 ` [PATCH nftables] doc: Include generated man pages in dist tarball Matt Turner
2020-04-19 16:43 ` Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200407190508.21496-1-mattst88@gmail.com \
--to=mattst88@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox