waf: disable-python - fix ctdb configuration
[nivanova/samba-autobuild/.git] / ctdb / wscript
index cedae90b35ef246134399d399ee4ec85aa6245ef..9e99fa2dd0ef8221dbb44989871adcfbc898162c 100644 (file)
@@ -107,8 +107,8 @@ def configure(conf):
     if conf.env.standalone_ctdb:
         conf.SAMBA_CHECK_PERL(mandatory=True)
 
-        conf.SAMBA_CHECK_PYTHON(mandatory=True, version=(2,5,0))
-        conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=True)
+        conf.SAMBA_CHECK_PYTHON(mandatory=False, version=(2,5,0))
+        conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=False)
 
     if conf.CHECK_FOR_THIRD_PARTY():
         conf.RECURSE('third_party/popt')
@@ -502,22 +502,23 @@ def build(bld):
 
     bld.SAMBA_BINARY('ctdb_lock_helper',
                      source='server/ctdb_lock_helper.c',
-                     deps='samba-util sys_rw ctdb-system talloc tdb',
+                     deps='''samba-util sys_rw ctdb-system tevent-util
+                             talloc tevent tdb''',
                      includes='include',
                      install_path='${CTDB_HELPER_BINDIR}')
 
-    bld.SAMBA_BINARY('ctdb_event_helper',
-                     source='server/ctdb_event_helper.c',
-                     includes='include',
-                     deps='samba-util sys_rw ctdb-system replace tdb',
-                     install_path='${CTDB_HELPER_BINDIR}')
-
     bld.SAMBA_BINARY('ctdb_recovery_helper',
                      source='server/ctdb_recovery_helper.c',
                      deps='''ctdb-client2 ctdb-protocol ctdb-util
                              samba-util sys_rw replace tdb''',
                      install_path='${CTDB_HELPER_BINDIR}')
 
+    bld.SAMBA_BINARY('ctdb_takeover_helper',
+                     source='server/ctdb_takeover_helper.c',
+                     deps='''ctdb-client2 ctdb-protocol ctdb-util
+                             samba-util sys_rw replace ctdb-ipalloc popt''',
+                     install_path='${CTDB_HELPER_BINDIR}')
+
     bld.SAMBA_BINARY('ctdb_mutex_fcntl_helper',
                      source='server/ctdb_mutex_fcntl_helper.c',
                      deps='sys_rw ctdb-system',
@@ -736,6 +737,7 @@ def build(bld):
         'pidfile_test',
         'run_proc_test',
         'sock_daemon_test',
+        'sock_io_test',
     ]
 
     for target in ctdb_unit_tests:
@@ -805,7 +807,8 @@ def build(bld):
                          install_path='${CTDB_TEST_LIBEXECDIR}')
 
     bld.SAMBA_BINARY('ctdb_takeover_tests',
-                     source='tests/src/ctdb_takeover_tests.c',
+                     source='''tests/src/ctdb_takeover_tests.c
+                               tests/src/ipalloc_read_known_ips.c''',
                      deps='''replace popt tdb tevent talloc ctdb-system
                              samba-util tdb-wrap talloc_report
                              ctdb-ipalloc ctdb-protocol ctdb-util''',
@@ -813,7 +816,8 @@ def build(bld):
                      install_path='${CTDB_TEST_LIBEXECDIR}')
 
     bld.SAMBA_BINARY('fake_ctdbd',
-                     source='tests/src/fake_ctdbd.c',
+                     source='''tests/src/fake_ctdbd.c
+                               tests/src/ipalloc_read_known_ips.c''',
                      deps='''ctdb-util ctdb-protocol ctdb-system
                              samba-util tevent-util LIBASYNC_REQ popt''',
                      install_path='${CTDB_TEST_LIBEXECDIR}')
@@ -826,20 +830,33 @@ def build(bld):
                               ib_deps,
                          install_path='${CTDB_TEST_LIBEXECDIR}')
 
+    if bld.env.HAVE_ROBUST_MUTEXES and sys.platform.startswith('linux'):
+        bld.SAMBA_BINARY('test_mutex_raw',
+                         source='tests/src/test_mutex_raw.c',
+                         deps='pthread',
+                         install_path='${CTDB_TEST_LIBEXECDIR}')
+
     test_subdirs = [
         'complex',
         'cunit',
+        'eventd',
         'events.d',
         'eventscripts',
         'onnode',
         'shellcheck',
         'simple',
         'takeover',
+        'takeover_helper',
         'tool'
     ]
 
+    if bld.env.standalone_ctdb:
+        testdir = 'tests'
+    else:
+        testdir = 'ctdb/tests'
+
     for t in test_subdirs:
-        files = SUBDIR_MODE('tests/%s' % t, trim_path='tests')
+        files = SUBDIR_MODE('%s/%s' % (testdir, t), trim_path=testdir)
         for fmode in files:
             bld.INSTALL_FILES(bld.env.CTDB_TEST_DATADIR, 'tests/%s' % fmode[0],
                               destname=fmode[0], chmod=fmode[1])
@@ -940,7 +957,27 @@ def show_version(ctx):
     print VERSION
 
 
-def dist():
+def manpages(ctx):
+    BASE_URL = 'http://docbook.sourceforge.net/release/xsl/current'
+    MAN_XSL = '%s/manpages/docbook.xsl' % BASE_URL
+    HTML_XSL = '%s/html/docbook.xsl' % BASE_URL
+    CMD_TEMPLATE = 'xsltproc --xinclude -o %s --nonet %s %s'
+    manpages = manpages_binary + manpages_misc + manpages_etcd + manpages_ceph
+    for t in manpages:
+        cmd = CMD_TEMPLATE % ('doc/%s' % t, MAN_XSL, 'doc/%s.xml' % t)
+        ret = samba_utils.RUN_COMMAND(cmd)
+        if ret != 0:
+            print('Command %s failed with exit status %d' % (cmd, ret))
+            sys.exit(ret)
+
+        cmd = CMD_TEMPLATE % ('doc/%s.html' % t, HTML_XSL, 'doc/%s.xml' % t)
+        ret = samba_utils.RUN_COMMAND(cmd)
+        if ret != 0:
+            print('Command %s failed with exit status %d' % (cmd, ret))
+            sys.exit(ret)
+
+
+def distonly(ctx):
     samba_dist.DIST_FILES('VERSION:VERSION', extend=True)
 
     t = 'include/ctdb_version.h'
@@ -962,24 +999,8 @@ def dist():
         sys.exit(ret)
     samba_dist.DIST_FILES('ctdb/%s:%s' % (t, t), extend=True)
 
-    BASE_URL = 'http://docbook.sourceforge.net/release/xsl/current'
-    MAN_XSL = '%s/manpages/docbook.xsl' % BASE_URL
-    HTML_XSL = '%s/html/docbook.xsl' % BASE_URL
-    CMD_TEMPLATE = 'xsltproc --xinclude -o %s --nonet %s %s'
     manpages = manpages_binary + manpages_misc + manpages_etcd + manpages_ceph
     for t in manpages:
-        cmd = CMD_TEMPLATE % ('doc/%s' % t, MAN_XSL, 'doc/%s.xml' % t)
-        ret = samba_utils.RUN_COMMAND(cmd)
-        if ret != 0:
-            print('Command %s failed with exit status %d' % (cmd, ret))
-            sys.exit(ret)
-
-        cmd = CMD_TEMPLATE % ('doc/%s.html' % t, HTML_XSL, 'doc/%s.xml' % t)
-        ret = samba_utils.RUN_COMMAND(cmd)
-        if ret != 0:
-            print('Command %s failed with exit status %d' % (cmd, ret))
-            sys.exit(ret)
-
         samba_dist.DIST_FILES('ctdb/doc/%s:doc/%s' % (t, t), extend=True)
         samba_dist.DIST_FILES('ctdb/doc/%s.html:doc/%s.html' % (t, t),
                               extend=True)
@@ -987,6 +1008,12 @@ def dist():
     samba_dist.dist()
 
 
+def dist():
+    import Scripting
+    Scripting.commands.append('manpages')
+    Scripting.commands.append('distonly')
+
+
 def rpmonly(ctx):
     opts = os.getenv('RPM_OPTIONS') or ''
     cmd = 'rpmbuild -ta --clean --rmsource %s ctdb-%s.tar.gz' % (opts, VERSION)
@@ -998,7 +1025,8 @@ def rpmonly(ctx):
 
 def rpm(ctx):
     import Scripting
-    Scripting.commands.append('dist')
+    Scripting.commands.append('manpages')
+    Scripting.commands.append('distonly')
     Scripting.commands.append('rpmonly')