Replace nodegroups' PartialNic by PartialNicParams
[ganeti-local] / Makefile.am
index 83d3507..1ee6f5e 100644 (file)
@@ -23,6 +23,7 @@ RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
 CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
 CHECK_HEADER = $(top_srcdir)/autotools/check-header
 CHECK_MAN_DASHES = $(top_srcdir)/autotools/check-man-dashes
+CHECK_MAN_REFERENCES = $(top_srcdir)/autotools/check-man-references
 CHECK_MAN_WARNINGS = $(top_srcdir)/autotools/check-man-warnings
 CHECK_VERSION = $(top_srcdir)/autotools/check-version
 CHECK_NEWS = $(top_srcdir)/autotools/check-news
@@ -81,6 +82,7 @@ DIRS = \
        daemons \
        devel \
        doc \
+       doc/css \
        doc/examples \
        doc/examples/gnt-debug \
        doc/examples/hooks \
@@ -150,7 +152,6 @@ APIDOC_PY_DIR = $(APIDOC_DIR)/py
 APIDOC_HS_DIR = $(APIDOC_DIR)/hs
 
 MAINTAINERCLEANFILES = \
-       $(docpng) \
        $(maninput) \
        doc/install-quick.rst \
        doc/news.rst \
@@ -356,7 +357,9 @@ utils_PYTHON = \
        lib/utils/wrapper.py \
        lib/utils/x509.py
 
-docrst = \
+docinput = \
+       doc/conf.py \
+       doc/css/style.css \
        doc/admin.rst \
        doc/cluster-merge.rst \
        doc/design-2.0.rst \
@@ -409,7 +412,21 @@ docrst = \
        doc/virtual-cluster.rst \
        doc/walkthrough.rst
 
-HS_PROGS = src/htools src/mon-collector
+# Haskell programs to be installed in $PREFIX/bin
+HS_BIN_PROGS=src/htools
+
+# Haskell programs to be installed in the MYEXECLIB dir
+HS_MYEXECLIB_PROGS=src/mon-collector
+
+# Haskell programs to compiled but not installed automatically
+# Usually they have their own specific installation rules
+HS_COMPILE_PROGS= \
+       src/hconfd \
+       src/rpc-test
+
+# All Haskell non-test programs to be compiled but not automatically installed
+HS_PROGS = $(HS_BIN_PROGS) $(HS_MYEXECLIB_PROGS)
+
 HS_BIN_ROLES = hbal hscan hspace hinfo hcheck hroller
 HS_HTOOLS_PROGS = $(HS_BIN_ROLES) hail
 
@@ -417,9 +434,8 @@ HS_ALL_PROGS = \
        $(HS_PROGS) \
        test/hs/hpc-htools \
        test/hs/hpc-mon-collector \
-       test/hs/test \
-       src/hconfd \
-       src/rpc-test
+       test/hs/htest \
+       $(HS_COMPILE_PROGS)
 
 HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
 HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/hs/%) test/hs/hail
@@ -432,7 +448,7 @@ HFLAGS = \
 
 # extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
 HEXTRA =
-# internal extra flags (used for test/hs/test mainly)
+# internal extra flags (used for test/hs/htest mainly)
 HEXTRA_INT =
 # exclude options for coverage reports
 HPCEXCL = --exclude Main \
@@ -478,7 +494,6 @@ HS_LIB_SRCS = \
        src/Ganeti/HTools/Loader.hs \
        src/Ganeti/HTools/Node.hs \
        src/Ganeti/HTools/PeerMap.hs \
-       src/Ganeti/HTools/Program.hs \
        src/Ganeti/HTools/Program/Hail.hs \
        src/Ganeti/HTools/Program/Hbal.hs \
        src/Ganeti/HTools/Program/Hcheck.hs \
@@ -486,6 +501,7 @@ HS_LIB_SRCS = \
        src/Ganeti/HTools/Program/Hscan.hs \
        src/Ganeti/HTools/Program/Hspace.hs \
        src/Ganeti/HTools/Program/Hroller.hs \
+       src/Ganeti/HTools/Program/Main.hs \
        src/Ganeti/HTools/Types.hs \
        src/Ganeti/Hash.hs \
        src/Ganeti/JQueue.hs \
@@ -569,9 +585,10 @@ $(RUN_IN_TEMPDIR): | stamp-directories
 # 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: $(docinput) doc/conf.py configure.ac \
        $(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
        lib/build/shell_example_lexer.py lib/opcodes.py lib/ht.py \
+       doc/css/style.css \
        | $(BUILT_PYTHON_SOURCES)
        @test -n "$(SPHINX)" || \
            { echo 'sphinx-build' not found during configure; exit 1; }
@@ -580,7 +597,8 @@ doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
            -d . \
            -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
            -D release="$(PACKAGE_VERSION)" \
-           $(abs_top_srcdir)/doc $(CURDIR)/doc/html
+           -D graphviz_dot="$(DOT)" \
+           $(abs_top_builddir)/doc $(CURDIR)/doc/html
        rm -f doc/html/.buildinfo doc/html/objects.inv
        touch $@
 
@@ -598,13 +616,6 @@ doc/install-quick.rst doc/news.rst doc/upgrade.rst:
          cat $<; \
        } > $@
 
-docdot = \
-       doc/arch-2.0.dot \
-       doc/design-2.1-lock-acquire.dot \
-       doc/design-2.1-lock-release.dot
-
-docpng = $(patsubst %.dot,%.png,$(docdot))
-
 # Things to build but not to install (add it to EXTRA_DIST if it should be
 # distributed)
 noinst_DATA = \
@@ -659,7 +670,7 @@ qa_scripts = \
 
 bin_SCRIPTS =
 if WANT_HTOOLS
-bin_SCRIPTS += $(filter-out src/hail,$(HS_PROGS))
+bin_SCRIPTS += $(HS_BIN_PROGS)
 install-exec-hook:
        @mkdir_p@ $(DESTDIR)$(iallocatorsdir)
 # FIXME: this is a hardcoded logic, instead of auto-resolving
@@ -684,8 +695,8 @@ $(HS_ALL_PROGS): %: %.hs $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS) Makefile
          $(HEXTRA) $(HEXTRA_INT) $@
        @touch "$@"
 
-# for the test/hs/test binary, we need to enable profiling/coverage
-test/hs/test: HEXTRA_INT=-fhpc -itest/hs
+# for the test/hs/htest binary, we need to enable profiling/coverage
+test/hs/htest: HEXTRA_INT=-fhpc -itest/hs
 
 # we compile the hpc-htools binary with the program coverage
 test/hs/hpc-htools: HEXTRA_INT=-fhpc
@@ -771,7 +782,7 @@ myexeclib_SCRIPTS = \
        daemons/daemon-util \
        tools/kvm-ifup \
        $(pkglib_python_scripts) \
-       src/mon-collector
+       $(HS_MYEXECLIB_PROGS)
 
 nodist_myexeclib_SCRIPTS = \
        $(nodist_pkglib_python_scripts)
@@ -786,6 +797,7 @@ EXTRA_DIST = \
        autotools/check-header \
        autotools/check-imports \
        autotools/check-man-dashes \
+       autotools/check-man-references \
        autotools/check-man-warnings \
        autotools/check-news \
        autotools/check-python-code \
@@ -793,7 +805,7 @@ EXTRA_DIST = \
        autotools/check-version \
        autotools/convert-constants \
        autotools/docpp \
-       autotools/gen-coverage \
+       autotools/gen-py-coverage \
        autotools/testrunner \
        autotools/wrong-hardcoded-paths \
        $(RUN_IN_TEMPDIR) \
@@ -801,12 +813,10 @@ EXTRA_DIST = \
        daemons/ganeti-cleaner.in \
        $(pkglib_python_scripts) \
        devel/upload \
+       devel/webserver \
        tools/kvm-ifup.in \
        tools/vcluster-setup.in \
-       $(docdot) \
-       $(docpng) \
-       $(docrst) \
-       doc/conf.py \
+       $(docinput) \
        doc/html \
        $(BUILT_EXAMPLES:%=%.in) \
        doc/examples/ganeti.default \
@@ -869,7 +879,7 @@ mangen = $(patsubst %.rst,%.gen,$(manrst))
 maninput = \
        $(patsubst %.1,%.1.in,$(patsubst %.7,%.7.in,$(patsubst %.8,%.8.in,$(man_MANS)))) \
        $(patsubst %.html,%.html.in,$(manhtml)) \
-       man/footer.man man/footer.html $(mangen)
+       $(mangen)
 
 TEST_FILES = \
        test/data/htools/clean-nonzero-score.data \
@@ -909,6 +919,7 @@ TEST_FILES = \
        test/data/bdev-drbd-net-ip6.txt \
        test/data/cert1.pem \
        test/data/cert2.pem \
+       test/data/instance-minor-pairing.txt \
        test/data/ip-addr-show-dummy0.txt \
        test/data/ip-addr-show-lo-ipv4.txt \
        test/data/ip-addr-show-lo-ipv6.txt \
@@ -919,7 +930,9 @@ TEST_FILES = \
        test/data/kvm_0.12.5_help.txt \
        test/data/kvm_0.15.90_help.txt \
        test/data/kvm_0.9.1_help.txt \
+       test/data/kvm_0.9.1_help_boot_test.txt \
        test/data/kvm_1.0_help.txt \
+       test/data/kvm_1.1.2_help.txt \
        test/data/ovfdata/compr_disk.vmdk.gz \
        test/data/ovfdata/config.ini \
        test/data/ovfdata/corrupted_resources.ovf \
@@ -1026,6 +1039,7 @@ python_tests = \
        test/py/ganeti.utils.io_unittest-runasroot.py \
        test/py/ganeti.utils.io_unittest.py \
        test/py/ganeti.utils.log_unittest.py \
+       test/py/ganeti.utils.lvm_unittest.py \
        test/py/ganeti.utils.mlock_unittest.py \
        test/py/ganeti.utils.nodesetup_unittest.py \
        test/py/ganeti.utils.process_unittest.py \
@@ -1040,7 +1054,7 @@ python_tests = \
        test/py/qa.qa_config_unittest.py \
        test/py/tempfile_fork_unittest.py
 
-haskell_tests = test/hs/test
+haskell_tests = test/hs/htest
 
 dist_TESTS = \
        test/py/check-cert-expired_unittest.bash \
@@ -1109,7 +1123,8 @@ srclink_files = \
        test/hs/offline-test.sh \
        test/hs/cli-tests-defs.sh \
        $(all_python_code) \
-       $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS)
+       $(HS_LIBTEST_SRCS) $(HS_PROG_SRCS) \
+       $(docinput)
 
 check_python_code = \
        $(BUILD_BASH_COMPLETION) \
@@ -1178,50 +1193,36 @@ doc/examples/bash_completion doc/examples/bash_completion-debug: \
        PYTHONPATH=. $(RUN_IN_TEMPDIR) \
          $(CURDIR)/$(BUILD_BASH_COMPLETION) $(BC_ARGS) > $@
 
-doc/%.png: doc/%.dot
-       @test -n "$(DOT)" || { echo 'dot' not found during configure; exit 1; }
-       $(DOT) -Tpng -o $@ $<
-
-man/footer.man: man/footer.rst
-       @test -n "$(PANDOC)" || \
-         { echo 'pandoc' not found during configure; exit 1; }
-       $(PANDOC) -f rst -t man -o $@ $<
-
-man/footer.html: man/footer.rst
-       @test -n "$(PANDOC)" || \
-         { echo 'pandoc' not found during configure; exit 1; }
-       $(PANDOC) -f rst -t html -o $@ $<
-
 man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
        lib/build/shell_example_lexer.py \
        | $(RUN_IN_TEMPDIR) $(BUILT_PYTHON_SOURCES)
        @echo "Checking $< for hardcoded paths..."
        @if grep -nEf autotools/wrong-hardcoded-paths $<; then \
-         echo "Man page $< has harcoded paths (see above)!" 1>&2 ; \
+         echo "Man page $< has hardcoded paths (see above)!" 1>&2 ; \
          exit 1; \
        fi
        set -e ; \
        trap 'echo auto-removing $@; rm $@' EXIT; \
        PYTHONPATH=. $(RUN_IN_TEMPDIR) $(CURDIR)/$(DOCPP) < $< > $@ ;\
+       $(CHECK_MAN_REFERENCES) $@; \
        trap - EXIT
 
-man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
+man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.rst
        @test -n "$(PANDOC)" || \
          { echo 'pandoc' not found during configure; exit 1; }
        set -o pipefail ; \
        trap 'echo auto-removing $@; rm $@' EXIT; \
-       $(PANDOC) -s -f rst -t man -A man/footer.man $< | \
+       $(PANDOC) -s -f rst -t man $< man/footer.rst | \
          sed -e 's/\\@/@/g' > $@; \
        if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN_WARNINGS) $@; fi; \
        $(CHECK_MAN_DASHES) $@; \
        trap - EXIT
 
-
-man/%.html.in: man/%.gen man/footer.html
+man/%.html.in: man/%.gen man/footer.rst
        @test -n "$(PANDOC)" || \
          { echo 'pandoc' not found during configure; exit 1; }
        set -o pipefail ; \
-       $(PANDOC) -s -f rst -t html -A man/footer.html $< | \
+       $(PANDOC) --toc -s -f rst -t html $< man/footer.rst | \
          sed -e 's/\\@/@/g' > $@
 
 man/%: man/%.in  $(REPLACE_VARS_SED)
@@ -1261,7 +1262,7 @@ src/Ganeti/Version.hs: src/Ganeti/Version.hs.in \
 
 src/Ganeti/Constants.hs: src/Ganeti/Constants.hs.in \
        lib/constants.py lib/_autoconf.py lib/luxi.py lib/errors.py \
-       lib/jstore.py $(RUN_IN_TEMPDIR)\
+       lib/jstore.py $(RUN_IN_TEMPDIR) \
        $(CONVERT_CONSTANTS) $(built_base_sources) \
        | lib/_vcsversion.py
        set -e; \
@@ -1551,13 +1552,19 @@ check-local: check-dirs $(GENERATED_FILES)
        done; \
        test -z "$$error"
 
-.PHONY: hs-check
-hs-check: test/hs/test test/hs/hpc-htools test/hs/hpc-mon-collector $(HS_BUILT_TEST_HELPERS) \
-       | $(BUILT_PYTHON_SOURCES)
-       @rm -f *.tix
-       ./test/hs/test
+.PHONY: hs-tests
+hs-tests: test/hs/htest | $(BUILT_PYTHON_SOURCES)
+       @rm -f htest.tix
+       ./test/hs/htest
+
+.PHONY: hs-shell
+hs-shell: test/hs/hpc-htools test/hs/hpc-mon-collector $(HS_BUILT_TEST_HELPERS)
+       @rm -f hpc-htools.tix hpc-mon-collector.tix
        HBINARY="./test/hs/hpc-htools" ./test/hs/offline-test.sh
 
+.PHONY: hs-check
+hs-check: hs-tests hs-shell
+
 # E111: indentation is not a multiple of four
 # E121: continuation line indentation is not a multiple of four
 #       (since our indent level is not 4)
@@ -1764,7 +1771,8 @@ py-coverage: $(GENERATED_FILES) $(python_tests)
        COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
        TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
        HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
-       $(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
+       $(PLAIN_TESTS_ENVIRONMENT) \
+       $(abs_top_srcdir)/autotools/gen-py-coverage \
        $(python_tests)
 
 .PHONY: hs-coverage
@@ -1773,9 +1781,9 @@ hs-coverage: $(haskell_tests) test/hs/hpc-htools test/hs/hpc-mon-collector
        $(MAKE) $(AM_MAKEFLAGS) hs-check
        @mkdir_p@ $(COVERAGE_HS_DIR)
        hpc sum --union $(HPCEXCL) \
-         test.tix hpc-htools.tix hpc-mon-collector.tix > coverage-htools.tix
-       hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-htools.tix
-       hpc report coverage-htools.tix
+         htest.tix hpc-htools.tix hpc-mon-collector.tix > coverage-hs.tix
+       hpc markup --destdir=$(COVERAGE_HS_DIR) coverage-hs.tix
+       hpc report coverage-hs.tix
        $(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html
 
 # Special "kind-of-QA" target for htools, needs special setup (all
@@ -1804,6 +1812,10 @@ gitignore-check:
          exit 1; \
        fi
 
+# target to rebuild all man pages (both groff and html output)
+.PHONY: man
+man: $(man_MANS) $(manhtml)
+
 # Target that builds all binaries (including those that are not
 # rebuilt except when running the tests)
 .PHONY: really-all