You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2012/11/18 17:49:45 UTC

[1/50] git commit: build system now gracefully handles missing doc dependencies

Updated Branches:
  refs/heads/docs_tmp [created] 7723efc86


build system now gracefully handles missing doc dependencies


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/6e86296d
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/6e86296d
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/6e86296d

Branch: refs/heads/docs_tmp
Commit: 6e86296d539dcc04824100ebb67caf95a8b2c5e5
Parents: 99d4a97
Author: Noah Slater <ns...@apache.org>
Authored: Sat Nov 17 19:49:44 2012 +0000
Committer: Robert Newson <rn...@apache.org>
Committed: Sun Nov 18 00:15:33 2012 +0000

----------------------------------------------------------------------
 .gitignore                  |    7 ++-
 bin/Makefile.am             |   14 ++---
 build-aux/sphinx-build      |   55 +++++++++++++++++
 build-aux/sphinx-touch      |   12 ++++
 configure.ac                |   32 +++++-----
 share/doc/build/Makefile.am |  122 +++++++++++++++++---------------------
 6 files changed, 148 insertions(+), 94 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/6e86296d/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 308c3fe..bfb53c6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,7 +27,12 @@ bin/couchdb
 bin/couchdb.1
 bin/couchjs_dev
 bin/couchpw
-build-aux
+build-aux/config.*
+build-aux/depcomp
+build-aux/install-sh
+build-aux/ltmain.sh
+build-aux/missing
+build-aux/texinfo.tex
 config.h
 config.log
 config.status

http://git-wip-us.apache.org/repos/asf/couchdb/blob/6e86296d/bin/Makefile.am
----------------------------------------------------------------------
diff --git a/bin/Makefile.am b/bin/Makefile.am
index 5125b02..24dab60 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -110,15 +110,11 @@ couch-config_dev: couch-config.tpl
 
 HELP2MAN_OPTION=--no-info --help-option="-h" --version-option="-V"
 
-# XXX: Because the scripts are made at build time for the user we need to
-# XXX: depend on the original templates so as not to cause the rebuilding of
-# XXX: the man pages.
+# Because the scripts are made at build time for the user we need to depend on
+# the original templates so as not to cause the rebuilding of the man pages.
 
 couchdb.1: couchdb.tpl.in
-	if test -n "`which help2man`"; then \
-	    $(MAKE) -f Makefile couchdb; \
+	$(MAKE) -f Makefile couchdb; \
+	$(top_srcdir)/build-aux/missing --run \
 	    help2man $(HELP2MAN_OPTION) \
-	        --name="Apache CouchDB database server" ./couchdb --output $@; \
-	else \
-	    $(top_srcdir)/build-aux/missing help2man && exit 1; \
-	fi
+	    --name="Apache CouchDB database server" ./couchdb --output $@
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/6e86296d/build-aux/sphinx-build
----------------------------------------------------------------------
diff --git a/build-aux/sphinx-build b/build-aux/sphinx-build
new file mode 100755
index 0000000..f211c35
--- /dev/null
+++ b/build-aux/sphinx-build
@@ -0,0 +1,55 @@
+#!/bin/sh -e
+
+# This script is called by the build system and is used to call sphinx-build if
+# is is available, or alternatively, emit a warning, and perform a no-op. Any
+# required directories or Makefiles are created and stubbed out as appropriate.
+
+if test -z "`which sphinx-build`"; then
+    missing=yes
+    cat << EOF
+WARNING: 'sphinx-build' is needed, and is missing on your system.
+         You might have modified some files without having the
+         proper tools for further handling them.
+EOF
+fi
+
+if test "$2" = "texinfo"; then
+    if test -z "`which makeinfo`"; then
+        missing=yes
+        cat << EOF
+WARNING: 'makeinfo' is needed, and is missing on your system.
+         You might have modified some files without having the
+         proper tools for further handling them.
+EOF
+    fi
+    if test "$missing" != "yes"; then
+        sphinx-build $*
+    else
+        mkdir -p texinfo
+        echo "info:" > texinfo/Makefile
+    fi
+fi
+
+if test "$2" = "latex"; then
+    if test -z "`which pdflatex`"; then
+        missing=yes
+        cat << EOF
+WARNING: 'pdflatex' is needed, and is missing on your system.
+         You might have modified some files without having the
+         proper tools for further handling them.
+EOF
+    fi
+    if test "$missing" != "yes"; then
+        sphinx-build $*
+    else
+        mkdir -p latex
+        echo "all-pdf:" > latex/Makefile
+    fi
+fi
+if test "$2" = "html"; then
+    if test "$missing" != "yes"; then
+        sphinx-build $*
+    else
+        mkdir -p html
+    fi
+fi

http://git-wip-us.apache.org/repos/asf/couchdb/blob/6e86296d/build-aux/sphinx-touch
----------------------------------------------------------------------
diff --git a/build-aux/sphinx-touch b/build-aux/sphinx-touch
new file mode 100755
index 0000000..1e4ae60
--- /dev/null
+++ b/build-aux/sphinx-touch
@@ -0,0 +1,12 @@
+#!/bin/sh -e
+
+# This script is called by the build system and is used to touch the list of
+# expected output files when sphinx-build is not available. If the files exist,
+# this will satisfy make. If they do not exist, we create of empty files.
+
+if test -z "`which sphinx-build`"; then
+    for file in $*; do
+        mkdir -p `dirname $file`
+        touch $file
+    done
+fi
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/6e86296d/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index efebc80..a8004d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -545,22 +545,6 @@ if test x${HAS_HELP2MAN} = x; then
     fi
 fi
 
-AC_CHECK_PROG([HAS_SPHINX_BUILD], [sphinx-build], [yes])
-
-if test x${HAS_SPHINX_BUILD} = x; then
-    if test x${strictness_enabled} = xyes; then
-        AC_MSG_ERROR([Could not find the `sphinx-build' executable.])
-    else
-        AC_MSG_WARN([You will be unable to regenerate any documentation.])
-    fi
-fi
-
-if test x${strictness_enabled} = xyes; then
-    AX_PYTHON_MODULE([pygments], [fatal])
-else
-    AX_PYTHON_MODULE([pygments])
-fi
-
 AC_CHECK_PROG([HAS_PDFLATEX], [pdflatex], [yes])
 
 if test x${HAS_PDFLATEX} = x; then
@@ -597,6 +581,22 @@ Is GNU Texinfo installed?])
     fi
 fi
 
+AC_CHECK_PROG([HAS_SPHINX_BUILD], [sphinx-build], [yes])
+
+if test x${HAS_SPHINX_BUILD} = x; then
+    if test x${strictness_enabled} = xyes; then
+        AC_MSG_ERROR([Could not find the `sphinx-build' executable.])
+    else
+        AC_MSG_WARN([You will be unable to regenerate any documentation.])
+    fi
+fi
+
+if test x${strictness_enabled} = xyes; then
+    AX_PYTHON_MODULE([pygments], [fatal])
+else
+    AX_PYTHON_MODULE([pygments])
+fi
+
 AC_ARG_VAR([ERL], [path to the `erl' executable])
 AC_ARG_VAR([ERLC], [path to the `erlc' executable])
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/6e86296d/share/doc/build/Makefile.am
----------------------------------------------------------------------
diff --git a/share/doc/build/Makefile.am b/share/doc/build/Makefile.am
index 4d876a4..15b0ed1 100644
--- a/share/doc/build/Makefile.am
+++ b/share/doc/build/Makefile.am
@@ -16,6 +16,8 @@
 
 # @@ add RM checks to configure.ac
 
+# @@ make PDF building optional and not fail by default
+
 # @@ improve conf.py settings
 
 # @@ replace "test !" in configure.ac with "test -f X; then :; else" for portability
@@ -45,8 +47,6 @@ info_name = CouchDB
 
 info_file = texinfo/$(info_name).info
 
-texinfo_file = texinfo/CouchDB.texi
-
 pdf_file = latex/CouchDB.pdf.gz
 
 html_files = \
@@ -131,56 +131,54 @@ html_files = \
     html/ssl.html
 
 image_files = \
-	../images/epub-icon.png \
-	../images/futon-createdb.png \
-	../images/futon-editdoc.png \
-	../images/futon-editeddoc.png \
-	../images/futon-overview.png \
-	../images/futon-replform.png
-	
-src_files = \
-	../src/api/authn.rst \
-	../src/api/configuration.rst \
-	../src/api/database.rst \
-	../src/api/dbmaint.rst \
-	../src/api/design.rst \
-	../src/api/documents.rst \
-	../src/api/local.rst \
-	../src/api/misc.rst \
-	../src/api/reference.rst \
-	../src/api-basics.rst \
-	../src/changes.rst \
-	../src/commonjs.rst \
-	../src/config_reference.rst \
-	../src/configuring.rst \
-	../src/ddocs.rst \
-	../src/errors.rst \
-	../src/http-proxying.rst \
-	../src/index.rst \
-	../src/intro.rst \
-	../src/json-structure.rst \
-	../src/os-daemons.rst \
-	../src/range.rst \
-	../src/release.rst \
-	../src/replication.rst \
-	../src/ssl.rst
+    ../images/epub-icon.png \
+    ../images/futon-createdb.png \
+    ../images/futon-editdoc.png \
+    ../images/futon-editeddoc.png \
+    ../images/futon-overview.png \
+    ../images/futon-replform.png
 
+src_files = \
+    ../src/api/authn.rst \
+    ../src/api/configuration.rst \
+    ../src/api/database.rst \
+    ../src/api/dbmaint.rst \
+    ../src/api/design.rst \
+    ../src/api/documents.rst \
+    ../src/api/local.rst \
+    ../src/api/misc.rst \
+    ../src/api/reference.rst \
+    ../src/api-basics.rst \
+    ../src/changes.rst \
+    ../src/commonjs.rst \
+    ../src/config_reference.rst \
+    ../src/configuring.rst \
+    ../src/ddocs.rst \
+    ../src/errors.rst \
+    ../src/http-proxying.rst \
+    ../src/index.rst \
+    ../src/intro.rst \
+    ../src/json-structure.rst \
+    ../src/os-daemons.rst \
+    ../src/range.rst \
+    ../src/release.rst \
+    ../src/replication.rst \
+    ../src/ssl.rst
 
 dist_localdoc_DATA = \
     $(info_file) \
-    $(texinfo_file) \
     $(pdf_file)
 
 nobase_dist_localdoc_DATA = $(html_files)
 
 EXTRA_DIST = \
     ../conf.py \
-	../demo.mk \
-	../make.bat \
-	../Makefile.am \
-	$(image_files) \
-	$(src_files) \
-	html/.buildinfo
+    ../demo.mk \
+    ../make.bat \
+    ../Makefile.am \
+    $(image_files) \
+    $(src_files) \
+    html/.buildinfo
 
 $(pdf_file): pdf
 
@@ -195,15 +193,10 @@ $(info_file): info.stamp
 info.stamp: $(image_files) $(src_files)
 	@rm -f info.tmp
 	@touch info.tmp
-	if test -z "`which makeinfo`"; then \
-	    $(top_srcdir)/build-aux/missing makeinfo; \
-	fi
-	if test -n "`which sphinx-build`"; then \
-	    sphinx-build -b texinfo $(SPHINXOPTS) $(builddir)/texinfo; \
-	    $(MAKE) -C texinfo info; \
-	else \
-	    $(top_srcdir)/build-aux/missing sphinx-build; \
-	fi
+	$(top_srcdir)/build-aux/sphinx-build \
+	    -b texinfo $(SPHINXOPTS) $(builddir)/texinfo
+	$(MAKE) -C texinfo info
+	$(top_srcdir)/build-aux/sphinx-touch $(info_file)
 	@mv -f info.tmp $@
 
 $(pdf_file): pdf.stamp
@@ -215,16 +208,11 @@ $(pdf_file): pdf.stamp
 pdf.stamp: $(image_files) $(src_files)
 	@rm -f pdf.tmp
 	@touch pdf.tmp
-	if test -z "`which pdflatex`"; then \
-	    $(top_srcdir)/build-aux/missing pdflatex; \
-	fi
-	if test -n "`which sphinx-build`"; then \
-	    sphinx-build -b latex $(SPHINXOPTS) $(builddir)/latex; \
-	    $(MAKE) -C latex all-pdf; \
-	    gzip -9 < latex/CouchDB.pdf > latex/CouchDB.pdf.gz; \
-	else \
-	    $(top_srcdir)/build-aux/missing sphinx-build; \
-	fi
+	$(top_srcdir)/build-aux/sphinx-build \
+	    -b latex $(SPHINXOPTS) $(builddir)/latex
+	$(MAKE) -C latex all-pdf
+	$(top_srcdir)/build-aux/sphinx-touch $(pdf_file)
+	gzip -9 < latex/CouchDB.pdf > latex/CouchDB.pdf.gz
 	@mv -f pdf.tmp $@
 
 $(html_files): html.stamp
@@ -236,11 +224,9 @@ $(html_files): html.stamp
 html.stamp: $(image_files) $(src_files)
 	@rm -f html.tmp
 	@touch html.tmp
-	if test -n "`which sphinx-build`"; then \
-	    sphinx-build -b html $(SPHINXOPTS) $(builddir)/html; \
-	else \
-	    $(top_srcdir)/build-aux/missing sphinx-build; \
-	fi
+	$(top_srcdir)/build-aux/sphinx-build \
+	    -b html $(SPHINXOPTS) $(builddir)/html
+	$(top_srcdir)/build-aux/sphinx-touch $(html_files)
 	@mv -f html.tmp $@
 
 pdf-local:
@@ -252,13 +238,13 @@ html-local:
 install-data-local:
 	$(INSTALL) -d $(DESTDIR)$(infodir)
 	$(INSTALL_DATA) $(info_file) $(DESTDIR)$(infodir)/$(info_name);
-	if test -n "`which install-info`"; then\
+	if test -n "`which install-infoBOZ`"; then\
 	    install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$(info_name); \
 	fi
 
 uninstall-local:
 	rm -f $(infodir)/$(info_name)
-	if test -n "`which install-info`"; then\
+	if test -n "`which install-infoBOZ`"; then\
 	    install-info --delete --info-dir=$(DESTDIR)$(infodir) $(info_name) ; \
 	fi