Shared block storage support
[ganeti-local] / Makefile.am
index 46cae48..81c1dfb 100644 (file)
@@ -9,6 +9,9 @@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 
+# Use bash in order to be able to use pipefail
+SHELL=/bin/bash
+
 ACLOCAL_AMFLAGS = -I autotools
 BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
 RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
 ACLOCAL_AMFLAGS = -I autotools
 BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
 RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
@@ -16,6 +19,7 @@ CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
 CHECK_MAN = $(top_srcdir)/autotools/check-man
 CHECK_VERSION = $(top_srcdir)/autotools/check-version
 CHECK_NEWS = $(top_srcdir)/autotools/check-news
 CHECK_MAN = $(top_srcdir)/autotools/check-man
 CHECK_VERSION = $(top_srcdir)/autotools/check-version
 CHECK_NEWS = $(top_srcdir)/autotools/check-news
+DOCPP = $(top_srcdir)/autotools/docpp
 REPLACE_VARS_SED = autotools/replace_vars.sed
 
 clientdir = $(pkgpythondir)/client
 REPLACE_VARS_SED = autotools/replace_vars.sed
 
 clientdir = $(pkgpythondir)/client
@@ -122,7 +126,8 @@ nodist_pkgpython_PYTHON = \
        lib/_autoconf.py
 
 noinst_PYTHON = \
        lib/_autoconf.py
 
 noinst_PYTHON = \
-       lib/build/__init__.py
+       lib/build/__init__.py \
+       lib/build/sphinx_ext.py
 
 pkgpython_PYTHON = \
        lib/__init__.py \
 
 pkgpython_PYTHON = \
        lib/__init__.py \
@@ -236,9 +241,11 @@ docrst = \
        doc/design-2.2.rst \
        doc/design-2.3.rst \
        doc/design-2.4.rst \
        doc/design-2.2.rst \
        doc/design-2.3.rst \
        doc/design-2.4.rst \
+       doc/design-draft.rst \
        doc/design-oob.rst \
        doc/design-query2.rst \
        doc/cluster-merge.rst \
        doc/design-oob.rst \
        doc/design-query2.rst \
        doc/cluster-merge.rst \
+       doc/design-shared-storage.rst \
        doc/devnotes.rst \
        doc/glossary.rst \
        doc/hooks.rst \
        doc/devnotes.rst \
        doc/glossary.rst \
        doc/hooks.rst \
@@ -256,8 +263,14 @@ docrst = \
 
 $(RUN_IN_TEMPDIR): | $(all_dirfiles)
 
 
 $(RUN_IN_TEMPDIR): | $(all_dirfiles)
 
+# Note: we use here an order-only prerequisite, as the contents of
+# _autoconf.py are not actually influencing the html build output: it
+# has to exist in order for the sphinx module to be loaded
+# successfully, but we certainly don't want the docs to be rebuilt if
+# it changes
 doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
 doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
-       $(RUN_IN_TEMPDIR)
+       $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py lib/opcodes.py lib/ht.py \
+       | lib/_autoconf.py
        @test -n "$(SPHINX)" || \
            { echo 'sphinx-build' not found during configure; exit 1; }
        @mkdir_p@ $(dir $@)
        @test -n "$(SPHINX)" || \
            { echo 'sphinx-build' not found during configure; exit 1; }
        @mkdir_p@ $(dir $@)
@@ -378,8 +391,10 @@ EXTRA_DIST = \
        autotools/build-bash-completion \
        autotools/check-python-code \
        autotools/check-man \
        autotools/build-bash-completion \
        autotools/check-python-code \
        autotools/check-man \
+       autotools/check-news \
        autotools/check-tar \
        autotools/check-version \
        autotools/check-tar \
        autotools/check-version \
+       autotools/docpp \
        autotools/gen-coverage \
        autotools/testrunner \
        $(RUN_IN_TEMPDIR) \
        autotools/gen-coverage \
        autotools/testrunner \
        $(RUN_IN_TEMPDIR) \
@@ -398,7 +413,6 @@ EXTRA_DIST = \
        doc/examples/ganeti-kvm-poweroff.initd.in \
        doc/examples/ganeti.cron.in \
        doc/examples/gnt-config-backup.in \
        doc/examples/ganeti-kvm-poweroff.initd.in \
        doc/examples/ganeti.cron.in \
        doc/examples/gnt-config-backup.in \
-       doc/examples/dumb-allocator \
        doc/examples/ganeti.default \
        doc/examples/ganeti.default-debug \
        doc/examples/hooks/ethers \
        doc/examples/ganeti.default \
        doc/examples/ganeti.default-debug \
        doc/examples/hooks/ethers \
@@ -437,10 +451,11 @@ man_MANS = \
 
 manrst = $(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS)))
 manhtml = $(patsubst %.rst,%.html,$(manrst))
 
 manrst = $(patsubst %.7,%.rst,$(patsubst %.8,%.rst,$(man_MANS)))
 manhtml = $(patsubst %.rst,%.html,$(manrst))
+mangen = $(patsubst %.rst,%.gen,$(manrst))
 maninput = \
        $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) \
        $(patsubst %.html,%.html.in,$(manhtml)) \
 maninput = \
        $(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS))) \
        $(patsubst %.html,%.html.in,$(manhtml)) \
-       man/footer.man man/footer.html
+       man/footer.man man/footer.html $(mangen)
 
 TEST_FILES = \
        test/data/bdev-drbd-8.0.txt \
 
 TEST_FILES = \
        test/data/bdev-drbd-8.0.txt \
@@ -460,6 +475,7 @@ python_tests = \
        test/ganeti.backend_unittest.py \
        test/ganeti.bdev_unittest.py \
        test/ganeti.cli_unittest.py \
        test/ganeti.backend_unittest.py \
        test/ganeti.bdev_unittest.py \
        test/ganeti.cli_unittest.py \
+       test/ganeti.client.gnt_cluster_unittest.py \
        test/ganeti.client.gnt_instance_unittest.py \
        test/ganeti.daemon_unittest.py \
        test/ganeti.cmdlib_unittest.py \
        test/ganeti.client.gnt_instance_unittest.py \
        test/ganeti.daemon_unittest.py \
        test/ganeti.cmdlib_unittest.py \
@@ -501,6 +517,7 @@ python_tests = \
        test/ganeti.utils.filelock_unittest.py \
        test/ganeti.utils.hash_unittest.py \
        test/ganeti.utils.io_unittest.py \
        test/ganeti.utils.filelock_unittest.py \
        test/ganeti.utils.hash_unittest.py \
        test/ganeti.utils.io_unittest.py \
+       test/ganeti.utils.log_unittest.py \
        test/ganeti.utils.mlock_unittest.py \
        test/ganeti.utils.nodesetup_unittest.py \
        test/ganeti.utils.process_unittest.py \
        test/ganeti.utils.mlock_unittest.py \
        test/ganeti.utils.nodesetup_unittest.py \
        test/ganeti.utils.process_unittest.py \
@@ -562,6 +579,7 @@ srclink_files = \
 
 check_python_code = \
        $(BUILD_BASH_COMPLETION) \
 
 check_python_code = \
        $(BUILD_BASH_COMPLETION) \
+       $(DOCPP) \
        $(all_python_code)
 
 lint_python_code = \
        $(all_python_code)
 
 lint_python_code = \
@@ -571,6 +589,7 @@ lint_python_code = \
        $(dist_tools_SCRIPTS) \
        $(pkglib_python_scripts) \
        $(BUILD_BASH_COMPLETION) \
        $(dist_tools_SCRIPTS) \
        $(pkglib_python_scripts) \
        $(BUILD_BASH_COMPLETION) \
+       $(DOCPP) \
        $(PYTHON_BOOTSTRAP)
 
 test/daemon-util_unittest.bash: daemons/daemon-util
        $(PYTHON_BOOTSTRAP)
 
 test/daemon-util_unittest.bash: daemons/daemon-util
@@ -613,16 +632,21 @@ man/footer.html: man/footer.rst
          { echo 'pandoc' not found during configure; exit 1; }
        $(PANDOC) -f rst -t html -o $@ $<
 
          { echo 'pandoc' not found during configure; exit 1; }
        $(PANDOC) -f rst -t html -o $@ $<
 
-man/%.7.in man/%.8.in: man/%.rst man/footer.man
+man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py
+       PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@
+
+man/%.7.in man/%.8.in: man/%.gen man/footer.man
        @test -n "$(PANDOC)" || \
          { echo 'pandoc' not found during configure; exit 1; }
        @test -n "$(PANDOC)" || \
          { echo 'pandoc' not found during configure; exit 1; }
+       set -o pipefail ; \
        $(PANDOC) -s -f rst -t man -A man/footer.man $< | \
          sed -e 's/\\@/@/g' > $@
        if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN) $@; fi
 
        $(PANDOC) -s -f rst -t man -A man/footer.man $< | \
          sed -e 's/\\@/@/g' > $@
        if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN) $@; fi
 
-man/%.html.in: man/%.rst man/footer.html
+man/%.html.in: man/%.gen man/footer.html
        @test -n "$(PANDOC)" || \
          { echo 'pandoc' not found during configure; exit 1; }
        @test -n "$(PANDOC)" || \
          { echo 'pandoc' not found during configure; exit 1; }
+       set -o pipefail ; \
        $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
          sed -e 's/\\@/@/g' > $@
 
        $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
          sed -e 's/\\@/@/g' > $@
 
@@ -635,8 +659,8 @@ man/%.8: man/%.8.in $(REPLACE_VARS_SED)
 man/%.html: man/%.html.in $(REPLACE_VARS_SED)
        sed -f $(REPLACE_VARS_SED) < $< > $@
 
 man/%.html: man/%.html.in $(REPLACE_VARS_SED)
        sed -f $(REPLACE_VARS_SED) < $< > $@
 
-epydoc.conf: epydoc.conf.in
-       sed -e 's#@MODULES@#$(lint_python_code)#g' < $< > $@
+epydoc.conf: epydoc.conf.in Makefile
+       sed -e 's#@MODULES@#$(strip $(lint_python_code))#g' < $< > $@
 
 vcs-version:
        if test -d .git; then \
 
 vcs-version:
        if test -d .git; then \
@@ -688,6 +712,8 @@ lib/_autoconf.py: Makefile vcs-version | lib/.dir
          echo "XEN_INITRD = '$(XEN_INITRD)'"; \
          echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
          echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
          echo "XEN_INITRD = '$(XEN_INITRD)'"; \
          echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
          echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
+         echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
+         echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
          echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
          echo "KVM_PATH = '$(KVM_PATH)'"; \
          echo "SOCAT_PATH = '$(SOCAT)'"; \
          echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
          echo "KVM_PATH = '$(KVM_PATH)'"; \
          echo "SOCAT_PATH = '$(SOCAT)'"; \