Add sphinx extension
[ganeti-local] / Makefile.am
index 7704dd9..d85d546 100644 (file)
@@ -9,12 +9,16 @@
 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
 REPLACE_VARS_SED = autotools/replace_vars.sed
 
 clientdir = $(pkgpythondir)/client
@@ -90,6 +94,7 @@ CLEANFILES = \
        $(addsuffix /*.py[co],$(DIRS)) \
        $(all_dirfiles) \
        $(PYTHON_BOOTSTRAP) \
+       epydoc.conf \
        autotools/replace_vars.sed \
        daemons/daemon-util \
        daemons/ensure-dirs \
@@ -103,6 +108,7 @@ CLEANFILES = \
        doc/examples/hooks/ipsec \
        $(man_MANS) \
        $(manhtml) \
+       tools/kvm-ifup \
        stamp-srclinks \
        $(nodist_pkgpython_PYTHON)
 
@@ -119,7 +125,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 \
@@ -214,11 +221,17 @@ server_PYTHON = \
 utils_PYTHON = \
        lib/utils/__init__.py \
        lib/utils/algo.py \
+       lib/utils/filelock.py \
        lib/utils/hash.py \
+       lib/utils/io.py \
        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/text.py \
+       lib/utils/wrapper.py \
+       lib/utils/x509.py
 
 docrst = \
        doc/admin.rst \
@@ -226,6 +239,8 @@ 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 \
@@ -247,7 +262,7 @@ docrst = \
 $(RUN_IN_TEMPDIR): | $(all_dirfiles)
 
 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/opdoc.py
        @test -n "$(SPHINX)" || \
            { echo 'sphinx-build' not found during configure; exit 1; }
        @mkdir_p@ $(dir $@)
@@ -357,15 +372,18 @@ 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/gen-coverage \
@@ -376,6 +394,7 @@ EXTRA_DIST = \
        daemons/ganeti-cleaner.in \
        $(pkglib_python_scripts) \
        devel/upload.in \
+       tools/kvm-ifup.in \
        $(docdot) \
        $(docpng) \
        $(docrst) \
@@ -385,7 +404,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 \
@@ -485,10 +503,16 @@ python_tests = \
        test/ganeti.ssh_unittest.py \
        test/ganeti.uidpool_unittest.py \
        test/ganeti.utils.algo_unittest.py \
+       test/ganeti.utils.filelock_unittest.py \
        test/ganeti.utils.hash_unittest.py \
+       test/ganeti.utils.io_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 \
+       test/ganeti.utils.x509_unittest.py \
        test/ganeti.utils_unittest.py \
        test/ganeti.workerpool_unittest.py \
        test/cfgupgrade_unittest.py \
@@ -558,6 +582,10 @@ 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 $@
@@ -593,6 +621,7 @@ man/footer.html: man/footer.rst
 man/%.7.in man/%.8.in: man/%.rst 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
@@ -600,10 +629,10 @@ man/%.7.in man/%.8.in: man/%.rst man/footer.man
 man/%.html.in: man/%.rst 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) < $< > $@
 
@@ -613,6 +642,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
+       sed -e 's#@MODULES@#$(lint_python_code)#g' < $< > $@
+
 vcs-version:
        if test -d .git; then \
          git describe > $@; \
@@ -785,11 +817,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...