[Groonga-commit] groonga/groonga [master] doc: pass versions via environment variables

Back to archive index

null+****@clear***** null+****@clear*****
2012年 5月 29日 (火) 10:57:41 JST


Kouhei Sutou	2012-05-29 10:57:41 +0900 (Tue, 29 May 2012)

  New Revision: 702b522f4785ca3b02d6a7186b0200016fc73dae

  Log:
    doc: pass versions via environment variables

  Modified files:
    build/makefiles/sphinx-build.am
    configure.ac
    doc/source/conf.py

  Modified: build/makefiles/sphinx-build.am (+6 -1)
===================================================================
--- build/makefiles/sphinx-build.am    2012-05-29 09:01:52 +0900 (0a1c895)
+++ build/makefiles/sphinx-build.am    2012-05-29 10:57:41 +0900 (b2f8a53)
@@ -12,7 +12,12 @@ ALLSPHINXOPTS   = $(PAPEROPT_$(PAPER)) -E $(SPHINXOPTS) $(SOURCE_DIR)
 
 SPHINX_DIR = $(abs_top_builddir)/doc/sphinx
 SPHINX_BUILD = $(SPHINX_DIR)/sphinx-build.py
-SPHINX_BUILD_COMMAND = LOCALE="$(LOCALE)" PYTHONPATH="$(SPHINX_DIR):$$PYTHONPATH" python $(SPHINX_BUILD)
+SPHINX_BUILD_COMMAND =				\
+	VERSION="$(DOCUMENT_VERSION)"		\
+	VERSION_FULL="$(DOCUMENT_VERSION_FULL)"	\
+	LOCALE="$(LOCALE)"			\
+	PYTHONPATH="$(SPHINX_DIR):$$PYTHONPATH"	\
+	python $(SPHINX_BUILD)
 
 .PHONY: sphinx-ensure-updated
 

  Modified: configure.ac (+5 -0)
===================================================================
--- configure.ac    2012-05-29 09:01:52 +0900 (280cd3b)
+++ configure.ac    2012-05-29 10:57:41 +0900 (24e24df)
@@ -1022,6 +1022,11 @@ AM_CONDITIONAL([HAVE_BUILT_DOCUMENT],
 AC_MSG_CHECKING([whether having built document])
 AC_MSG_RESULT($have_built_document)
 
+DOCUMENT_VERSION=groonga_version
+DOCUMENT_VERSION_FULL="$GRN_VERSION"
+AC_SUBST(DOCUMENT_VERSION)
+AC_SUBST(DOCUMENT_VERSION_FULL)
+
 # Munin plugins
 AC_MSG_CHECKING([whether install munin plugins])
 AC_ARG_WITH(munin-plugins,

  Modified: doc/source/conf.py (+3 -16)
===================================================================
--- doc/source/conf.py    2012-05-29 09:01:52 +0900 (77107c7)
+++ doc/source/conf.py    2012-05-29 10:57:41 +0900 (869754c)
@@ -70,23 +70,10 @@ copyright = u'2009-' + unicode(datetime.today().year) + ', Brazil, Inc'
 # built documents.
 #
 
-# read version from env/file.
-if os.environ.has_key('GRN_VERSION'):
-  version_sh = 'GRN_VERSION=' + os.environ['GRN_VERSION']
-else:
-  os.system('../../version-gen.sh')
-  version_sh = open(os.path.join(os.path.dirname(__file__), '../../version.sh')).read()
-
-release_regex = re.compile(r'^GRN_VERSION=(?P<release>.*)$')
-# The full version, including alpha/beta/rc tags.
-release = release_regex.search(version_sh).group('release')
-
-version_regex = re.compile(r'^(?P<version>\d+(\.\d+)*)')
 # The short X.Y version.
-version = version_regex.search(release).group('version')
-
-# NOTE: release == version, because release includes git tag.
-release = version
+version = os.environ["DOCUMENT_VERSION"]
+# The full version, including alpha/beta/rc tags.
+release = os.environ["DOCUMENT_VERSION_FULL"]
 
 # The directories that has *.mo files.
 locale_dirs = ["../locale"]




Groonga-commit メーリングリストの案内
Back to archive index