Fix “make distcheck”.
authorMichael Hanselmann <hansmi@google.com>
Mon, 8 Oct 2007 10:03:17 +0000 (10:03 +0000)
committerMichael Hanselmann <hansmi@google.com>
Mon, 8 Oct 2007 10:03:17 +0000 (10:03 +0000)
- Move symlink to “ganeti” to top dir
- Add ganeti.config_unittest.py to tests to be run
- Make sure everything is built before tests are run

Reviewed-by: iustinp

Makefile.am
configure.ac
lib/Makefile.am
test/Makefile.am

index fffd09b..e2a0345 100644 (file)
@@ -1,8 +1,13 @@
-# standard automake rules
 SUBDIRS = man lib scripts daemons doc test tools qa
-
 EXTRA_DIST = NEWS
 
+.PHONY: ganeti
+ganeti:
+       cd $(top_builddir) && rm -f $@ && $(LN_S) lib $@
+
+pre-check: ganeti
+       $(MAKE) -C lib $@
+
 # custom rules
 depgraph: depgraph.png
 
index d233f12..1ed1110 100644 (file)
@@ -1,8 +1,8 @@
 # Configure script for Ganeti
-
 AC_PREREQ(2.59)
 AC_INIT(ganeti, 1.2b2, ganeti@googlegroups.com)
 AC_CONFIG_AUX_DIR(autotools)
+AC_CONFIG_SRCDIR(configure)
 AM_INIT_AUTOMAKE([foreign tar-ustar])
 
 # --with-ssh-initscript=...
@@ -35,6 +35,7 @@ AC_SUBST(OS_SEARCH_PATH, $os_search_path)
 
 # Check common programs
 AC_PROG_INSTALL
+AC_PROG_LN_S
 
 # Check for Python
 AM_PATH_PYTHON(2.4)
index 3bcc2f9..1e35356 100644 (file)
@@ -19,3 +19,8 @@ _autoconf.py: Makefile
          echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
          echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
        } > $@
+
+pre-check: all
+       for i in $(pkgpython_PYTHON); do \
+               if test ! -f $$i; then $(LN_S) $(srcdir)/$$i $$i; fi; \
+       done
index 43f0b4d..83c7b9b 100644 (file)
@@ -1,11 +1,13 @@
-TESTS = ganeti.hooks_unittest.py ganeti.utils_unittest.py
-TESTS_ENVIRONMENT = PYTHONPATH=.:$(srcdir)
+TESTS = \
+  ganeti.config_unittest.py \
+  ganeti.hooks_unittest.py \
+  ganeti.utils_unittest.py
+TESTS_ENVIRONMENT = PYTHONPATH=.:$(top_builddir)
 
-check_DATA = ganeti
-ganeti:
-       rm -f ganeti
-       ln -s $(top_srcdir)/lib ganeti
+check-am: do-pre-check
+
+do-pre-check:
+       $(MAKE) -C $(top_builddir) pre-check
 
 EXTRA_DIST = $(TESTS) mocks.py
 CLEANFILES = *.py[co]
-MAINTAINERCLEANFILES = ganeti