From f68a90740192c8c25e4319a27a250b36c653e2f6 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Wed, 13 Jan 2016 20:21:38 +0100 Subject: [PATCH] dnsdist: Build manpages from make Build manpage when they are not there and ensure they are distributed in the tarball. --- build-scripts/dist-dnsdist | 1 - pdns/dnsdistdist/Makefile.am | 19 ++++++++++++++++--- pdns/dnsdistdist/configure.ac | 2 ++ pdns/dnsdistdist/m4/pdns_check_pandoc.m4 | 11 +++++++++++ pdns/dnsdistdist/populate | 7 ------- 5 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 pdns/dnsdistdist/m4/pdns_check_pandoc.m4 delete mode 100755 pdns/dnsdistdist/populate 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 - -- 2.47.2