From: Pieter Lexis Date: Wed, 13 Jan 2016 19:21:38 +0000 (+0100) Subject: dnsdist: Build manpages from make X-Git-Tag: dnsdist-1.0.0-alpha2~80^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F3228%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Build manpages from make Build manpage when they are not there and ensure they are distributed in the tarball. --- diff --git a/build-scripts/dist-dnsdist b/build-scripts/dist-dnsdist index b69b9c1224..11f7a0ac7b 100755 --- a/build-scripts/dist-dnsdist +++ b/build-scripts/dist-dnsdist @@ -10,7 +10,6 @@ set -x cd pdns/dnsdistdist -./populate autoreconf -i ./configure make dist diff --git a/pdns/dnsdistdist/Makefile.am b/pdns/dnsdistdist/Makefile.am index a9b5156f50..3221882736 100644 --- a/pdns/dnsdistdist/Makefile.am +++ b/pdns/dnsdistdist/Makefile.am @@ -12,14 +12,11 @@ BUILT_SOURCES=htmlfiles.h htmlfiles.h: html/* ./incfiles > $@ -man_MANS=dnsdist.1 - EXTRA_DIST=dnslabeltext.rl \ dnsdistconf.lua \ README.md \ delaypipe.cc delaypipe.hh \ html \ - dnsdist.1 \ dnsdist.1.md \ .version \ contrib \ @@ -118,3 +115,19 @@ testrunner_LDADD = \ $(RT_LIBS) \ $(SANITIZER_FLAGS) +MANPAGES=dnsdist.1 + +dist_man_MANS=$(MANPAGES) + +if HAVE_PANDOC +$(MANPAGES): %: %.md + $(AM_V_GEN)$(PANDOC) -s -t man $< -o $@ +else +if HAVE_MANPAGES +#nothing +else +$(MANPAGES): + echo "You need pandoc to generate the manpages" + exit 1 +endif +endif diff --git a/pdns/dnsdistdist/configure.ac b/pdns/dnsdistdist/configure.ac index 7e30b440c5..c72fb993d5 100644 --- a/pdns/dnsdistdist/configure.ac +++ b/pdns/dnsdistdist/configure.ac @@ -45,6 +45,8 @@ AS_IF([test "x$enable_hardening" != "xno"], [ PDNS_ENABLE_SANITIZERS +PDNS_CHECK_PANDOC + LDFLAGS="$RELRO_LDFLAGS $LDFLAGS" AS_IF([test "x$static" != "xyes"], [ diff --git a/pdns/dnsdistdist/m4/pdns_check_pandoc.m4 b/pdns/dnsdistdist/m4/pdns_check_pandoc.m4 new file mode 100644 index 0000000000..794d2f80e5 --- /dev/null +++ b/pdns/dnsdistdist/m4/pdns_check_pandoc.m4 @@ -0,0 +1,11 @@ +AC_DEFUN([PDNS_CHECK_PANDOC], [ + AC_CHECK_PROG([PANDOC], [pandoc], [pandoc], [no]) + + AS_IF([test "x$PANDOC" = "xno"], [ + AS_IF([test -f "$srcdir/dnsdist.1"], + [AC_MSG_WARN([pandoc is missing, unable to build documentation and manpages.])] + ) + ]) + AM_CONDITIONAL([HAVE_PANDOC], [test "x$PANDOC" != "xno"]) + AM_CONDITIONAL([HAVE_MANPAGES], [test -e "$srcdir/dnsdist.1"]) +]) diff --git a/pdns/dnsdistdist/populate b/pdns/dnsdistdist/populate deleted file mode 100755 index 6fac50ccca..0000000000 --- a/pdns/dnsdistdist/populate +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -x - -pandoc -s -t man ../../docs/manpages/dnsdist.1.md > dnsdist.1 -