Add bdev_sizes RPC call
[ganeti-local] / Makefile.am
index 35c0a20..81c1dfb 100644 (file)
@@ -9,12 +9,17 @@
 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
 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
+DOCPP = $(top_srcdir)/autotools/docpp
 REPLACE_VARS_SED = autotools/replace_vars.sed
 
 clientdir = $(pkgpythondir)/client
@@ -90,6 +95,7 @@ CLEANFILES = \
        $(addsuffix /*.py[co],$(DIRS)) \
        $(all_dirfiles) \
        $(PYTHON_BOOTSTRAP) \
+       epydoc.conf \
        autotools/replace_vars.sed \
        daemons/daemon-util \
        daemons/ensure-dirs \
@@ -103,6 +109,7 @@ CLEANFILES = \
        doc/examples/hooks/ipsec \
        $(man_MANS) \
        $(manhtml) \
+       tools/kvm-ifup \
        stamp-srclinks \
        $(nodist_pkgpython_PYTHON)
 
@@ -119,7 +126,8 @@ nodist_pkgpython_PYTHON = \
        lib/_autoconf.py
 
 noinst_PYTHON = \
-       lib/build/__init__.py
+       lib/build/__init__.py \
+       lib/build/sphinx_ext.py
 
 pkgpython_PYTHON = \
        lib/__init__.py \
@@ -220,6 +228,7 @@ utils_PYTHON = \
        lib/utils/log.py \
        lib/utils/mlock.py \
        lib/utils/nodesetup.py \
+       lib/utils/process.py \
        lib/utils/retry.py \
        lib/utils/text.py \
        lib/utils/wrapper.py \
@@ -231,9 +240,12 @@ docrst = \
        doc/design-2.1.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-shared-storage.rst \
        doc/devnotes.rst \
        doc/glossary.rst \
        doc/hooks.rst \
@@ -251,8 +263,14 @@ docrst = \
 
 $(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 \
-       $(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 $@)
@@ -362,17 +380,21 @@ pkglib_python_scripts = \
 pkglib_SCRIPTS = \
        daemons/daemon-util \
        daemons/ensure-dirs \
+       tools/kvm-ifup \
        $(pkglib_python_scripts)
 
 EXTRA_DIST = \
        NEWS \
        UPGRADE \
+       epydoc.conf.in \
        pylintrc \
        autotools/build-bash-completion \
        autotools/check-python-code \
        autotools/check-man \
+       autotools/check-news \
        autotools/check-tar \
        autotools/check-version \
+       autotools/docpp \
        autotools/gen-coverage \
        autotools/testrunner \
        $(RUN_IN_TEMPDIR) \
@@ -381,6 +403,7 @@ EXTRA_DIST = \
        daemons/ganeti-cleaner.in \
        $(pkglib_python_scripts) \
        devel/upload.in \
+       tools/kvm-ifup.in \
        $(docdot) \
        $(docpng) \
        $(docrst) \
@@ -390,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/dumb-allocator \
        doc/examples/ganeti.default \
        doc/examples/ganeti.default-debug \
        doc/examples/hooks/ethers \
@@ -429,10 +451,11 @@ man_MANS = \
 
 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)) \
-       man/footer.man man/footer.html
+       man/footer.man man/footer.html $(mangen)
 
 TEST_FILES = \
        test/data/bdev-drbd-8.0.txt \
@@ -452,6 +475,7 @@ python_tests = \
        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 \
@@ -493,8 +517,10 @@ python_tests = \
        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.retry_unittest.py \
        test/ganeti.utils.text_unittest.py \
        test/ganeti.utils.wrapper_unittest.py \
@@ -553,6 +579,7 @@ srclink_files = \
 
 check_python_code = \
        $(BUILD_BASH_COMPLETION) \
+       $(DOCPP) \
        $(all_python_code)
 
 lint_python_code = \
@@ -562,12 +589,17 @@ lint_python_code = \
        $(dist_tools_SCRIPTS) \
        $(pkglib_python_scripts) \
        $(BUILD_BASH_COMPLETION) \
+       $(DOCPP) \
        $(PYTHON_BOOTSTRAP)
 
 test/daemon-util_unittest.bash: daemons/daemon-util
 
 test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
 
+tools/kvm-ifup: tools/kvm-ifup.in $(REPLACE_VARS_SED)
+       sed -f $(REPLACE_VARS_SED) < $< > $@
+       chmod +x $@
+
 devel/upload: devel/upload.in $(REPLACE_VARS_SED)
        sed -f $(REPLACE_VARS_SED) < $< > $@
        chmod u+x $@
@@ -600,20 +632,24 @@ man/footer.html: man/footer.rst
          { 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; }
+       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
 
-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; }
+       set -o pipefail ; \
        $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
          sed -e 's/\\@/@/g' > $@
 
-
 man/%.7: man/%.7.in $(REPLACE_VARS_SED)
        sed -f $(REPLACE_VARS_SED) < $< > $@
 
@@ -623,6 +659,9 @@ man/%.8: man/%.8.in $(REPLACE_VARS_SED)
 man/%.html: man/%.html.in $(REPLACE_VARS_SED)
        sed -f $(REPLACE_VARS_SED) < $< > $@
 
+epydoc.conf: epydoc.conf.in Makefile
+       sed -e 's#@MODULES@#$(strip $(lint_python_code))#g' < $< > $@
+
 vcs-version:
        if test -d .git; then \
          git describe > $@; \
@@ -673,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 "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)'"; \
@@ -795,11 +836,15 @@ check-dirs: $(BUILT_SOURCES)
 check-local: check-dirs
        $(CHECK_PYTHON_CODE) $(check_python_code)
        $(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
+       $(CHECK_NEWS) < $(top_srcdir)/NEWS
 
 .PHONY: lint
 lint: $(BUILT_SOURCES)
        @test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
        $(PYLINT) $(LINT_OPTS) $(lint_python_code)
+       cd $(top_srcdir)/qa && \
+         PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
+         --rcfile  ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
 
 # a dist hook rule for updating the vcs-version file; this is
 # hardcoded due to where it needs to build the file...