]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Build manpages from make 3228/head
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 13 Jan 2016 19:21:38 +0000 (20:21 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 13 Jan 2016 22:19:01 +0000 (23:19 +0100)
Build manpage when they are not there and ensure they are distributed in
the tarball.

build-scripts/dist-dnsdist
pdns/dnsdistdist/Makefile.am
pdns/dnsdistdist/configure.ac
pdns/dnsdistdist/m4/pdns_check_pandoc.m4 [new file with mode: 0644]
pdns/dnsdistdist/populate [deleted file]

index b69b9c1224638b0e6630471ad90fd022b8df65cb..11f7a0ac7b493da05b1ad03a125f6d3b09f1c0e7 100755 (executable)
@@ -10,7 +10,6 @@ set -x
 
 cd pdns/dnsdistdist
 
-./populate
 autoreconf -i
 ./configure
 make dist
index a9b5156f50db81b1978b49185d00a0134103fb96..32218827368d6259a48235bd73e60fa79e415773 100644 (file)
@@ -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
index 7e30b440c5e24a5b94f1a500832c99ea521537c2..c72fb993d543a023bbb13b24203121ec6f81eab8 100644 (file)
@@ -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 (file)
index 0000000..794d2f8
--- /dev/null
@@ -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 (executable)
index 6fac50c..0000000
+++ /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
-