]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
build: Include generated man pages in dist tarball
authorMatt Turner <mattst88@gmail.com>
Tue, 7 Apr 2020 19:05:08 +0000 (12:05 -0700)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 19 Apr 2020 16:40:59 +0000 (18:40 +0200)
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>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
configure.ac
doc/Makefile.am

index 6a25eeb3074c585d9edc6ac456d8346db1bfb6d0..a04d94bc757c9e98220142404ddda5958b74c5df 100644 (file)
@@ -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])])
index f0958b33331dcd2bd91449cbe89f9eda78bdf9e5..6bd90aa6361b78b0c424e7385b66af200bc8a509 100644 (file)
@@ -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