src/Makefile.am: Check for POD errors in the generated manpages.
authorSebastian Harl <sh@tokkee.org>
Sat, 16 Aug 2008 17:37:16 +0000 (19:37 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Tue, 19 Aug 2008 08:08:09 +0000 (10:08 +0200)
If any of the generated manpages includes the string '\<POD ERRORS\>' the
build aborts with an error message. If pod2man finds any errors it adds a
section with that name to the output.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/Makefile.am

index 55770f0..f0ad3cb 100644 (file)
@@ -793,10 +793,20 @@ EXTRA_DIST += collectd-email.pod collectd-exec.pod collectd-nagios.pod \
        postgresql_default.conf
 
 .pod.1:
-       pod2man --release=$(VERSION) --center=$(PACKAGE) $< >.pod2man.tmp 2>/dev/null && mv -f .pod2man.tmp $@ || true
+       pod2man --release=$(VERSION) --center=$(PACKAGE) $< \
+               >.pod2man.tmp 2>/dev/null && mv -f .pod2man.tmp $@ || true
+       if grep '\<POD ERRORS\>' $@ >/dev/null 2>&1; \
+       then \
+               echo "$@ has some POD errors!"; false; \
+       fi
 
 .pod.5:
-       pod2man --section=5 --release=$(VERSION) --center=$(PACKAGE) $< >.pod2man.tmp 2>/dev/null && mv -f .pod2man.tmp $@ || true
+       pod2man --section=5 --release=$(VERSION) --center=$(PACKAGE) $< \
+               >.pod2man.tmp 2>/dev/null && mv -f .pod2man.tmp $@ || true
+       if grep '\<POD ERRORS\>' $@ >/dev/null 2>&1; \
+       then \
+               echo "$@ has some POD errors!"; false; \
+       fi
 
 install-exec-hook:
        $(mkinstalldirs) $(DESTDIR)$(sysconfdir)