pyconfigure

(Brandon Invergo)
2012-09-17: add sphinx-build stuff for doc building

add sphinx-build stuff for doc building

diff --git a/examples/mediagoblin/Makefile.in b/examples/mediagoblin/Makefile.in
--- a/examples/mediagoblin/Makefile.in
+++ b/examples/mediagoblin/Makefile.in
@@ -8,6 +8,7 @@ PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PYTHON = @PYTHON@
+SPHINXBUILD = @SPHINXBUILD@
 SHELL = @SHELL@
 INSTALL = @INSTALL@
 INSTALL_PROGRAM = $(INSTALL)
@@ -24,7 +25,6 @@ pkgpythondir = @pkgpythondir@
 pkgpyexecdir = @pkgpyexecdir@
 
 
-
 all: install
 
 .PHONY: all install uninstall distclean info install-html html install-pdf pdf install-dvi dvi install-ps ps clean dist check
@@ -65,7 +65,9 @@ distclean: $(wildcard $(srcdir)/docs/sou
 info: docs/build/texinfo/gnumediagoblin.info
 
 docs/build/texinfo/gnumediagoblin.info: $(wildcard docs/source/*)
-	$(MAKE) -C docs info
+ifneq ($SPHINX_BUILD, none)
+	$(MAKE) -C docs info SPHINXBUILD=$(SPHINXBUILD)
+endif
 
 
 install-html: html
@@ -74,7 +76,9 @@ install-html: html
 html: docs/build/html/index.html
 
 docs/build/html/index.html: $(wildcard $(srcdir)/docs/source/*)
-	$(MAKE) -C docs html
+ifneq ($SPHINX_BUILD, none)
+	$(MAKE) -C docs html SPHINXBUILD=$(SPHINXBUILD)
+endif
 
 
 install-pdf: pdf
@@ -83,7 +87,9 @@ install-pdf: pdf
 pdf: docs/build/latex/GNUMediaGoblin.pdf
 
 docs/build/latex/GNUMediaGoblin.pdf: $(wildcard $(srcdir)/docs/source/*)
-	$(MAKE) -C docs latexpdf
+ifneq ($SPHINX_BUILD, none)
+	$(MAKE) -C docs latexpdf SPHINXBUILD=$(SPHINXBUILD)
+endif
 
 
 install-dvi:
diff --git a/examples/mediagoblin/configure.ac b/examples/mediagoblin/configure.ac
--- a/examples/mediagoblin/configure.ac
+++ b/examples/mediagoblin/configure.ac
@@ -51,6 +51,11 @@ else
                             [AC_MSG_ERROR(Python interpreter too old)])
 fi
 
+AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build sphinx-build2], [none])
+AS_IF([test "x$SPHINXBUILD" = xnone], 
+	    AC_MSG_WARN(sphinx-build is required to build documentation))
+
+
 PC_PYTHON_CHECK_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
 
 PC_PYTHON_SITE_PACKAGE_DIR