[beast] DOCS: conditionalized manual page builds from website for --enable-maintainer-mode



commit d1f65fe30549a05414f74376d085d0db9e159b5b
Author: Tim Janik <timj gtk org>
Date:   Mon May 9 19:49:59 2011 +0200

    DOCS: conditionalized manual page builds from website for --enable-maintainer-mode

 configure.in     |   24 ++++++++++++++++++++++++
 docs/Makefile.am |    7 +++----
 2 files changed, 27 insertions(+), 4 deletions(-)
---
diff --git a/configure.in b/configure.in
index ad3f6b9..e89bb00 100644
--- a/configure.in
+++ b/configure.in
@@ -353,6 +353,29 @@ AC_DEFUN([AC_BSE_REQUIREMENTS],
     bseuserdatadir='~/beast'
     AC_SUBST(bseuserdatadir)
 ])
+AC_DEFUN([AC_MAN_REQUIREMENTS],
+[
+  AC_PATH_PROGS(WIKIHTML2MAN, wikihtml2man wikihtml2man.py, false)
+  AC_PATH_PROG(GROFF, groff, false)
+  IFMAN=
+  IFAGING=
+  if test x"$enable_maintainer_mode" = xyes ; then
+    test x"$WIKIHTML2MAN" = xfalse && {
+      AC_MSG_ERROR(This package requires the wikihtml2man.py tool for maintainer builds)
+    }
+    echo "" | $GROFF -mandoc -Thtml 2>/dev/null | grep -Fq HTML || {
+      AC_MSG_ERROR(Failed to test-build HTML manual page via groff)
+    }
+  else # non-maintainer builds, need to have pre-built manual pages
+    test -e "${srcdir}/docs/mans/beast.1" || {
+      AC_MSG_ERROR([Missing prepackaged manual pages, use --enable-maintainer-mode])
+    }
+    IFMAN="#"
+    IFAGING="#"
+  fi
+  AC_SUBST(IFMAN)
+  AC_SUBST(IFAGING)
+])
 AC_DEFUN([AC_ASOUND_CHECK],
 [
     saved_cflags="$CFLAGS"
@@ -627,6 +650,7 @@ AC_BIRNET_REQUIREMENTS
 AC_I18N_REQUIREMENTS
 AC_SFI_REQUIREMENTS
 AC_BSE_REQUIREMENTS
+AC_MAN_REQUIREMENTS
 AC_ASOUND_CHECK
 AC_BSESCM_REQUIREMENTS
 AC_BSE_SNDDEV_CHECK
diff --git a/docs/Makefile.am b/docs/Makefile.am
index d882718..de37134 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -20,11 +20,10 @@ mans/:
 $(MANUAL_CACHE_TARGETS): cache/stamp-refresh
 	curl -sfS http://beast.testbit.eu/$(@F)?action=render >$(@D)/xgen-$(@F)
 	mv $(@D)/xgen-$(@F) $@ ; rm -f $(@D)/xgen-$(@F)
-WIKIHTML2MAN = wikihtml2man.py
-mans/%: cache/% | mans/
+mans/%: $(IFMAN) cache/% | mans/
 	$(WIKIHTML2MAN) $< >$(@D)/xgen-$(@F)
 	mv $(@D)/xgen-$(@F) $@ ; rm -f $(@D)/xgen-$(@F)
-html/%.html: mans/% | html/
+html/%.html: $(IFMAN) mans/% | html/
 	groff -mandoc -Thtml $< >$(@D)/xgen-$(@F)
 	mv $(@D)/xgen-$(@F) $@ ; rm -f $(@D)/xgen-$(@F)
 
@@ -69,7 +68,7 @@ cache/:
 stamp-refresh-message:	# conditional phony dependency
 	@TXT="  Some source files hosted online appear outdated; forcing refresh...  " \
 	&& echo "$$TXT" | sed 's/./=/g' && echo "$$TXT" && echo "$$TXT" | sed 's/./=/g'
-cache/stamp-refresh: $(call AGINGRULE, cache/stamp-refresh, 1440, stamp-refresh-message) | cache/ # refresh daily
+cache/stamp-refresh: $(IFAGING) $(call AGINGRULE, cache/stamp-refresh, 1440, stamp-refresh-message) | cache/ # refresh daily
 	touch $@
 MAINTAINERCLEANFILES += cache/
 # $(call AGINGRULE, stamp-file-for-aging, AgingInMinutes, rule-name-for-remaking)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]