9 # find the buildtools directory
11 while not os.path.exists(srcdir+'/buildtools') and len(srcdir.split('/')) < 5:
12 srcdir = srcdir + '/..'
13 sys.path.insert(0, srcdir + '/buildtools/wafsamba')
15 import wafsamba, samba_dist, Options, Logs, Utils
16 import samba_utils, samba_version
18 env = samba_utils.LOAD_ENVIRONMENT()
19 if os.path.isfile('./VERSION'):
21 elif os.path.isfile('../VERSION'):
24 Logs.error("VERSION file not found")
26 version = samba_version.samba_version_file('%s/VERSION' % vdir, vdir, env)
27 VERSION = version.STRING.replace('-', '.')
29 Options.default_prefix = '/usr/local'
31 samba_dist.DIST_DIRS('''ctdb:. lib/replace:lib/replace lib/talloc:lib/talloc
32 lib/tevent:lib/tevent lib/tdb:lib/tdb
33 lib/socket_wrapper:lib/socket_wrapper
34 third_party/popt:third_party/popt
35 lib/util:lib/util lib/tdb_wrap:lib/tdb_wrap
36 lib/ccan:lib/ccan libcli/util:libcli/util
37 buildtools:buildtools''')
41 opt.PRIVATE_EXTENSION_DEFAULT('ctdb')
43 opt.RECURSE('lib/replace')
45 opt.RECURSE('lib/util')
47 opt.RECURSE('lib/talloc')
48 opt.RECURSE('lib/tevent')
49 opt.RECURSE('lib/tdb')
51 opt.add_option('--enable-infiniband',
52 help=("Turn on infiniband support (default=no)"),
53 action="store_true", dest='ctdb_infiniband', default=False)
54 opt.add_option('--enable-pmda',
55 help=("Turn on PCP pmda support (default=no)"),
56 action="store_true", dest='ctdb_pmda', default=False)
58 opt.add_option('--with-logdir',
59 help=("Path to log directory"),
60 action="store", dest='ctdb_logdir', default=None)
61 opt.add_option('--with-socketpath',
62 help=("path to CTDB daemon socket"),
63 action="store_true", dest='ctdb_sockpath', default=False)
68 # CTDB relies on nested event loops
69 conf.env.TEVENT_DEPRECATED = 1
71 # No need to build python bindings for talloc/tevent/tdb
72 if conf.IN_LAUNCH_DIR():
73 Options.options.disable_python = True
75 conf.RECURSE('lib/replace')
77 conf.SAMBA_CHECK_PERL(mandatory=True)
79 conf.SAMBA_CHECK_PYTHON(mandatory=True, version=(2,5,0))
80 conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=True)
82 if conf.CHECK_FOR_THIRD_PARTY():
83 conf.RECURSE('third_party/popt')
85 if not conf.CHECK_POPT():
86 raise Utils.WafError('popt development packages have not been found\nIf third_party is installed, check that it is in the proper place.')
88 conf.define('USING_SYSTEM_POPT', 1)
90 conf.RECURSE('lib/util')
92 conf.RECURSE('lib/talloc')
93 conf.RECURSE('lib/tevent')
94 conf.RECURSE('lib/tdb')
95 conf.RECURSE('lib/socket_wrapper')
97 conf.CHECK_HEADERS('sched.h')
98 conf.CHECK_HEADERS('procinfo.h')
99 if sys.platform.startswith('aix') and not conf.CHECK_FUNCS('thread_setsched'):
100 Logs.error('Need thread_setsched() on AIX')
102 elif not conf.CHECK_FUNCS('sched_setscheduler'):
103 Logs.error('Need sched_setscheduler()')
105 conf.CHECK_FUNCS('mlockall')
107 if not conf.CHECK_VARIABLE('ETIME', headers='errno.h'):
108 conf.DEFINE('ETIME', 'ETIMEDOUT')
110 if sys.platform.startswith('linux'):
111 conf.SET_TARGET_TYPE('pcap', 'EMPTY')
113 if not conf.CHECK_HEADERS('pcap.h'):
114 Logs.error('Need libpcap')
116 if not conf.CHECK_FUNCS_IN('pcap_open_live', 'pcap', headers='pcap.h'):
117 Logs.error('Need libpcap')
120 if not conf.CHECK_FUNCS_IN('backtrace backtrace_symbols', 'execinfo',
121 checklibc=True, headers='execinfo.h'):
122 Logs.error('backtrace support not available')
125 if Options.options.ctdb_pmda:
128 if not conf.CHECK_HEADERS('pcp/pmapi.h pcp/impl.h pcp/pmda.h',
131 if not conf.CHECK_FUNCS_IN('pmProgname', 'pcp'):
133 if not conf.CHECK_FUNCS_IN('pmdaDaemon', 'pcp_pmda'):
138 Logs.error("PMDA support not available")
140 Logs.info('Building with PMDA support')
141 conf.define('HAVE_PMDA', 1)
142 conf.env.CTDB_PMDADIR = os.path.join(conf.env.LOCALSTATEDIR,
143 'lib/pcp/pmdas/ctdb')
145 have_infiniband = False
146 if Options.options.ctdb_infiniband:
149 if not conf.CHECK_HEADERS('infiniband/verbs.h rdma/rdma_cma.h'):
151 if not conf.CHECK_FUNCS_IN('ibv_create_qp', 'ibverbs'):
153 if not conf.CHECK_FUNCS_IN('rdma_connect', 'rdmacm'):
156 have_infiniband = True
158 Logs.error("Infiniband support not available")
160 Logs.info('Building with Infiniband support')
161 conf.define('HAVE_INFINIBAND', 1)
162 conf.define('USE_INFINIBAND', 1)
164 conf.env.CTDB_BINDIR = os.path.join(conf.env.EXEC_PREFIX, 'bin')
165 conf.env.CTDB_ETCDIR = os.path.join(conf.env.SYSCONFDIR, 'ctdb')
166 conf.env.CTDB_VARDIR = os.path.join(conf.env.LOCALSTATEDIR, 'lib/ctdb')
167 conf.env.CTDB_RUNDIR = os.path.join(conf.env.LOCALSTATEDIR, 'run/ctdb')
169 if Options.options.ctdb_logdir:
170 conf.env.CTDB_LOGDIR = Options.options.ctdb_logdir
172 conf.env.CTDB_LOGDIR = os.path.join(conf.env.LOCALSTATEDIR, 'log')
174 if Options.options.ctdb_sockpath:
175 conf.env.CTDB_SOCKPATH = Options.options.ctdb_sockpath
177 conf.env.CTDB_SOCKPATH = os.path.join(conf.env.CTDB_RUNDIR,
180 conf.ADD_CFLAGS('''-DBINDIR=\"%s\"
185 -DCTDB_RUNDIR=\"%s\"''' % (
186 conf.env.CTDB_BINDIR,
187 conf.env.CTDB_LOGDIR,
188 conf.env.CTDB_SOCKPATH,
189 conf.env.CTDB_ETCDIR,
190 conf.env.CTDB_VARDIR,
191 conf.env.CTDB_RUNDIR))
193 conf.env.CTDB_TEST_DATADIR = os.path.join(conf.env.EXEC_PREFIX,
195 conf.env.CTDB_TEST_LIBDIR = os.path.join(conf.env.LIBDIR, 'ctdb-tests')
197 # Allow unified compilation and separate compilation of utilities
200 # Building from tarball
201 conf.ADD_EXTRA_INCLUDES('#include')
202 conf.ADD_EXTRA_INCLUDES('#include/internal')
204 # Building standalone CTDB from within Samba tree
205 conf.ADD_EXTRA_INCLUDES('#ctdb/include')
206 conf.ADD_EXTRA_INCLUDES('#ctdb/include/internal')
207 conf.ADD_EXTRA_INCLUDES('#ctdb')
208 conf.ADD_EXTRA_INCLUDES('#lib #lib/replace')
210 conf.SET_TARGET_TYPE('systemd-daemon', 'EMPTY')
212 del(conf.env.defines['PYTHONDIR'])
213 del(conf.env.defines['PYTHONARCHDIR'])
215 conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True)
216 conf.DEFINE('SAMBA_UTIL_CORE_ONLY', 1, add_to_cflags=True)
217 conf.SAMBA_CONFIG_H()
221 # enable building of public headers in the build tree
222 bld.env.build_public_headers = 'include/public'
224 t = bld.SAMBA_GENERATOR('ctdb-version-header',
225 target='include/ctdb_version.h',
226 rule='../packaging/mkversion.sh ${TGT} %s' % (VERSION),
227 dep_vars=['VERSION'])
228 t.env.VERSION = VERSION
230 version_h = samba_utils.os_path_relpath(os.path.join(Options.launch_dir,
233 t.bld.SAMBA_GENERATOR('ctdb-samba-version-header',
235 rule='printf "#include \\"ctdb_version.h\\" \\n#define SAMBA_VERSION_STRING CTDB_VERSION_STRING\\n" > ${TGT}',
236 dep_vars=['VERSION'])
237 t.env.VERSION = VERSION
239 bld.RECURSE('lib/replace')
240 if bld.CHECK_FOR_THIRD_PARTY():
241 bld.RECURSE('third_party/popt')
243 bld.RECURSE('lib/tdb_wrap')
244 bld.RECURSE('lib/util')
246 bld.RECURSE('lib/talloc')
247 bld.RECURSE('lib/tevent')
248 bld.RECURSE('lib/tdb')
249 bld.RECURSE('lib/socket_wrapper')
251 # When a combined build is implemented, CTDB will wanted to build
252 # against samba-util rather than samba-util-core. Similarly,
253 # other Samba subsystems expect samba-util. So, for a standalone
254 # build, just define a fake samba-util subsystem that pulls in
256 bld.SAMBA_SUBSYSTEM('samba-util',
258 deps='samba-util-core')
260 bld.SAMBA_SUBSYSTEM('ctdb-tcp',
261 source=bld.SUBDIR('tcp',
262 'tcp_connect.c tcp_init.c tcp_io.c'),
263 includes='include include/internal',
264 deps='replace tdb talloc tevent')
267 if bld.env.HAVE_INFINIBAND:
268 bld.SAMBA_SUBSYSTEM('ctdb-ib',
269 source=bld.SUBDIR('ib',
270 '''ibwrapper.c ibw_ctdb.c
272 includes='include include/internal',
274 ib_deps = ' ctdb-ib rdmacm ibverbs'
276 bld.SAMBA_SUBSYSTEM('ctdb-common',
277 source=bld.SUBDIR('common',
278 '''ctdb_io.c ctdb_util.c ctdb_ltdb.c
279 ctdb_message.c cmdline.c rb_tree.c
280 system_common.c ctdb_fork.c'''),
281 includes='include include/internal common .',
282 deps='replace popt talloc tevent tdb popt')
284 bld.SAMBA_SUBSYSTEM('ctdb-common-util',
285 source=bld.SUBDIR('common',
286 'system_util.c ctdb_logging.c'),
287 includes='include include/internal',
288 deps='replace tevent tdb')
290 if sys.platform.startswith('linux'):
291 CTDB_SYSTEM_SRC = bld.SUBDIR('common', 'system_linux.c')
292 elif sys.platform.startswith('aix'):
293 CTDB_SYSTEM_SRC = bld.SUBDIR('common', 'system_aix.c')
294 elif sys.platform.startswith('freebsd'):
295 CTDB_SYSTEM_SRC = bld.SUBDIR('common', 'system_freebsd.c')
296 elif sys.platform == 'kfreebsd':
297 CTDB_SYSTEM_SRC = bld.SUBDIR('common', 'system_kfreebsd.c')
298 elif sys.platform == 'gnu':
299 CTDB_SYSTEM_SRC = bld.SUBDIR('common', 'system_gnu.c')
301 Logs.error("Platform %s not supported" % sys.platform)
303 bld.SAMBA_SUBSYSTEM('ctdb-system',
304 source=CTDB_SYSTEM_SRC,
305 includes='include include/internal',
306 deps='replace talloc tevent tdb pcap')
308 bld.SAMBA_SUBSYSTEM('ctdb-client',
309 source=bld.SUBDIR('client', 'ctdb_client.c'),
310 includes='include include/internal',
311 public_headers='include/ctdb_client.h',
312 deps='''replace popt talloc tevent tdb
313 samba-util tdb-wrap''')
315 bld.SAMBA_SUBSYSTEM('ctdb-server',
316 source='server/ctdbd.c ' +
318 '''ctdb_daemon.c ctdb_recoverd.c
319 ctdb_recover.c ctdb_freeze.c
320 ctdb_tunables.c ctdb_monitor.c
321 ctdb_server.c ctdb_control.c
322 ctdb_call.c ctdb_ltdb_server.c
323 ctdb_traverse.c eventscript.c
324 ctdb_takeover.c ctdb_serverids.c
325 ctdb_persistent.c ctdb_keepalive.c
326 ctdb_logging.c ctdb_uptime.c
327 ctdb_vacuum.c ctdb_banning.c
331 includes='include include/internal',
332 public_headers='''include/ctdb_version.h
334 include/ctdb_private.h
335 include/ctdb_protocol.h
336 include/ctdb_typesafe_cb.h''',
337 deps='replace popt talloc tevent tdb')
339 bld.SAMBA_BINARY('ctdbd',
341 deps='''ctdb-server ctdb-client ctdb-common
342 ctdb-common-util ctdb-system ctdb-tcp''' +
344 install_path='${SBINDIR}',
345 manpages='doc/ctdbd.1')
347 bld.SAMBA_BINARY('ctdb',
348 source='tools/ctdb.c tools/ctdb_vacuum.c',
349 deps='''ctdb-client ctdb-common ctdb-common-util
351 includes='include include/internal',
352 install_path='${BINDIR}',
353 manpages='doc/ctdb.1')
355 bld.SAMBA_BINARY('ltdbtool',
356 source='tools/ltdbtool.c',
359 install_path='${BINDIR}',
360 manpages='doc/ltdbtool.1')
362 bld.SAMBA_BINARY('ctdb_lock_helper',
363 source='server/ctdb_lock_helper.c',
364 deps='samba-util ctdb-common-util talloc tdb',
365 includes='include include/internal',
366 install_path='${BINDIR}')
368 bld.SAMBA_BINARY('ctdb_event_helper',
369 source='server/ctdb_event_helper.c',
370 includes='include include/internal',
371 deps='samba-util ctdb-common-util replace tdb',
372 install_path='${BINDIR}')
374 bld.SAMBA_GENERATOR('ctdb-smnotify-h',
375 source='utils/smnotify/smnotify.x',
376 target='utils/smnotify/smnotify.h',
377 rule='rpcgen -h ${SRC} > ${TGT}')
379 xdr_buf_hack = 'sed -e "s@^\([ \t]*register int32_t \*buf\);@\\1 = buf;@"'
381 bld.SAMBA_GENERATOR('ctdb-smnotify-x',
382 source='utils/smnotify/smnotify.x',
383 target='utils/smnotify/gen_xdr.c',
384 rule='rpcgen -c ${SRC} | ' + xdr_buf_hack + ' > ${TGT}')
386 bld.SAMBA_GENERATOR('ctdb-smnotify-c',
387 source='utils/smnotify/smnotify.x',
388 target='utils/smnotify/gen_smnotify.c',
389 rule='rpcgen -l ${SRC} > ${TGT}')
391 bld.SAMBA_BINARY('smnotify',
392 source=bld.SUBDIR('utils/smnotify',
393 'smnotify.c gen_smnotify.c gen_xdr.c'),
394 deps='ctdb-smnotify-h ctdb-smnotify-c ctdb-smnotify-x popt',
395 includes='utils utils/smnotify',
396 install_path='${BINDIR}')
398 bld.SAMBA_BINARY('ping_pong',
399 source='utils/ping_pong/ping_pong.c',
401 install_path='${BINDIR}',
402 manpages='doc/ping_pong.1')
404 if bld.env.HAVE_PMDA:
405 bld.SAMBA_BINARY('pmdactdb',
406 source='utils/pmda/pmda_ctdb.c',
407 includes='include include/internal',
408 deps='''ctdb-client ctdb-common ctdb-system
410 install_path='${CTDB_PMDADIR}')
411 bld.INSTALL_FILES('${CTDB_PMDADIR}', 'utils/pmda/Install',
413 bld.INSTALL_FILES('${CTDB_PMDADIR}', 'utils/pmda/Remove',
415 bld.INSTALL_FILES('${CTDB_PMDADIR}', 'utils/pmda/pmns',
417 bld.INSTALL_FILES('${CTDB_PMDADIR}', 'utils/pmda/domain.h',
419 bld.INSTALL_FILES('${CTDB_PMDADIR}', 'utils/pmda/help',
421 bld.INSTALL_FILES('${CTDB_PMDADIR}', 'utils/pmda/README',
424 bld.MANPAGES('''doc/onnode.1 doc/ctdbd_wrapper.1 doc/ctdbd.conf.5
425 doc/ctdb.7 doc/ctdb-statistics.7 doc/ctdb-tunables.7''',
428 bld.INSTALL_FILES('${BINDIR}', 'tools/onnode',
429 destname='onnode', chmod=0755)
430 bld.INSTALL_FILES('${BINDIR}', 'tools/ctdb_diagnostics',
431 destname='ctdb_diagnostics', chmod=0755)
432 bld.INSTALL_FILES('${SBINDIR}', 'config/ctdbd_wrapper',
433 destname='ctdbd_wrapper', chmod=0755)
435 def SUBDIR_MODE_callback(arg, dirname, fnames):
437 fl = os.path.join(dirname, f)
438 if os.path.isdir(fl) or os.path.islink(fl):
440 mode = os.lstat(fl).st_mode & 0777
442 fl = samba_utils.os_path_relpath(fl, arg['trim_path'])
443 arg['file_list'].append([fl, mode])
445 def SUBDIR_MODE(path, trim_path=None):
446 pd = {'trim_path': trim_path, 'file_list': []}
447 os.path.walk(path, SUBDIR_MODE_callback, pd)
448 return pd['file_list']
455 for t in etc_subdirs:
456 files = SUBDIR_MODE('config/%s' % t, trim_path='config')
458 bld.INSTALL_FILES(bld.env.CTDB_ETCDIR, 'config/%s' % fmode[0],
459 destname=fmode[0], chmod=fmode[1])
461 bld.INSTALL_FILES(bld.env.CTDB_ETCDIR, 'config/functions',
462 destname='functions')
465 'ctdb-crash-cleanup.sh',
466 'debug-hung-script.sh',
473 for t in etc_scripts:
474 bld.INSTALL_FILES(bld.env.CTDB_ETCDIR, 'config/' + t,
475 destname=t, chmod=0755)
477 bld.INSTALL_FILES('${SYSCONFDIR}/sudoers.d', 'config/ctdb.sudoers',
480 bld.INSTALL_FILES('${CTDB_ETCDIR}/notify.d', 'config/notify.d.README',
483 bld.install_dir(bld.env.CTDB_LOGDIR)
484 bld.install_dir(bld.env.CTDB_RUNDIR)
485 bld.install_dir(bld.env.CTDB_VARDIR)
487 sed_expr = 's/@PACKAGE_VERSION@/%s/g' % VERSION
488 t = bld.SAMBA_GENERATOR('ctdb-pc',
491 rule='sed -e "%s" ${SRC} > ${TGT}' % sed_expr,
492 dep_vars=['VERSION'])
493 t.env.VERSION = VERSION
494 bld.INSTALL_FILES('${LIBDIR}/pkgconfig', 'ctdb.pc')
502 'ctdb_fetch_readonly_once',
503 'ctdb_fetch_readonly_loop',
504 'ctdb_trackingdb_test',
505 'ctdb_update_record',
506 'ctdb_update_record_persistent',
511 'ctdb_porting_tests',
516 for target in ctdb_tests:
517 src = 'tests/src/' + target + '.c'
519 bld.SAMBA_BINARY(target,
521 includes='include include/internal',
522 deps='''ctdb-client ctdb-common ctdb-common-util
524 install_path='${CTDB_TEST_LIBDIR}')
526 bld.SAMBA_BINARY('ctdb_takeover_tests',
527 source='tests/src/ctdb_takeover_tests.c',
528 deps='''replace popt tdb tevent talloc ctdb-system
529 samba-util tdb-wrap''' +
531 includes='include include/internal',
532 install_path='${CTDB_TEST_LIBDIR}')
534 bld.SAMBA_BINARY('ctdb_functest',
535 source='tests/src/ctdb_functest.c',
536 deps='''replace tdb tevent talloc popt ctdb-system
537 samba-util tdb-wrap''',
538 includes='include include/internal',
539 install_path='${CTDB_TEST_LIBDIR}')
541 bld.SAMBA_BINARY('ctdb_stubtest',
542 source='tests/src/ctdb_test.c',
543 deps='''replace tdb tevent talloc popt ctdb-system
544 samba-util tdb-wrap''',
545 includes='include include/internal',
546 install_path='${CTDB_TEST_LIBDIR}')
548 if bld.env.HAVE_INFINIBAND:
549 bld.SAMBA_BINARY('ibwrapper_test',
550 source='ib/ibwrapper_test.c',
551 includes='include include/internal',
552 deps='''replace talloc ctdb-client ctdb-common
555 install_path='${CTDB_TEST_LIBDIR}')
567 for t in test_subdirs:
568 files = SUBDIR_MODE('tests/%s' % t, trim_path='tests')
570 bld.INSTALL_FILES(bld.env.CTDB_TEST_DATADIR, 'tests/%s' % fmode[0],
571 destname=fmode[0], chmod=fmode[1])
573 # Install tests/scripts directory without test_wrap
580 for t in test_scripts:
581 bld.INSTALL_FILES(bld.env.CTDB_TEST_DATADIR,
582 os.path.join('tests/scripts', t),
583 destname=os.path.join('scripts', t))
585 sed_expr = 's@^TEST_SCRIPTS_DIR=.*@&\\nexport TEST_BIN_DIR=\"%s\"@' % (
586 bld.env.CTDB_TEST_LIBDIR)
587 bld.SAMBA_GENERATOR('ctdb-test-wrap',
588 source='tests/scripts/test_wrap',
590 rule='sed -e "%s" ${SRC} > ${TGT}' % sed_expr)
591 bld.INSTALL_FILES(bld.env.CTDB_TEST_DATADIR+"/scripts", 'test_wrap',
592 destname='test_wrap', chmod=0755)
594 sed_expr1 = 's@^test_dir=.*@test_dir=%s\\nexport TEST_BIN_DIR=\"%s\"@' % (
595 bld.env.CTDB_TEST_DATADIR, bld.env.CTDB_TEST_LIBDIR)
596 sed_expr2 = 's@^\(export CTDB_TESTS_ARE_INSTALLED\)=false@\\1=true@'
597 bld.SAMBA_GENERATOR('ctdb-test-runner',
598 source='tests/run_tests.sh',
599 target='ctdb_run_tests.sh',
600 rule='sed -e "%s" -e "%s" ${SRC} > ${TGT}' % (
601 sed_expr1, sed_expr2))
602 bld.INSTALL_FILES('${BINDIR}', 'ctdb_run_tests.sh',
603 destname='ctdb_run_tests', chmod=0755)
604 bld.symlink_as(os.path.join(bld.env.BINDIR, 'ctdb_run_cluster_tests'),
607 test_eventscript_links = [
613 test_link_dir = os.path.join(bld.env.CTDB_TEST_DATADIR,
614 'eventscripts/etc-ctdb')
615 for t in test_eventscript_links:
616 bld.symlink_as(os.path.join(test_link_dir, t),
617 os.path.join(bld.env.CTDB_ETCDIR, t))
621 cmd = 'tests/run_tests.sh -V tests/var'
622 ret = samba_utils.RUN_COMMAND(cmd)
624 print('tests exited with exit status %d' % ret)
630 Scripting.commands.append('build')
631 Scripting.commands.append('testonly')
635 cmd = 'LD_PRELOAD=bin/shared/libsocket-wrapper.so tests/run_tests.sh -e -S -C'
636 ret = samba_utils.RUN_COMMAND(cmd)
638 print('autotest exited with exit status %d' % ret)
642 def show_version(ctx):
647 samba_dist.DIST_FILES('VERSION:VERSION', extend=True)
649 t = 'include/ctdb_version.h'
650 cmd = 'packaging/mkversion.sh %s %s' % (t, VERSION)
651 ret = samba_utils.RUN_COMMAND(cmd)
653 print('Command "%s" failed with exit status %d' % (cmd, ret))
655 samba_dist.DIST_FILES('ctdb/%s:%s' % (t, t), extend=True)
658 sed_expr1 = 's/@VERSION@/%s/g' % VERSION
659 sed_expr2 = 's/@RELEASE@/%s/g' % '1'
660 cmd = 'sed -e "%s" -e "%s" packaging/RPM/ctdb.spec.in > %s' % (
661 sed_expr1, sed_expr2, t)
662 ret = samba_utils.RUN_COMMAND(cmd)
664 print('Command "%s" failed with exit status %d' % (cmd, ret))
666 samba_dist.DIST_FILES('ctdb/%s:%s' % (t, t), extend=True)
680 ret = samba_utils.RUN_COMMAND(cmd)
682 print('Command "%s" failed with exit status %d' % (cmd, ret))
685 samba_dist.DIST_FILES('ctdb/doc/%s:doc/%s' % (t, t), extend=True)
686 samba_dist.DIST_FILES('ctdb/doc/%s.html:doc/%s.html' % (t, t),
693 cmd = 'rpmbuild -ta --clean --rmsource ctdb-%s.tar.gz' % VERSION
694 ret = samba_utils.RUN_COMMAND(cmd)
696 print('rpmbuild exited with exit status %d' % ret)
702 Scripting.commands.append('dist')
703 Scripting.commands.append('rpmonly')
707 "build 'tags' file using ctags"
709 source_root = os.path.dirname(Utils.g_module.root_path)
710 cmd = 'ctags $(find %s -name "*.[ch]")' % source_root
711 print("Running: %s" % cmd)
712 ret = samba_utils.RUN_COMMAND(cmd)
714 print('ctags failed with exit status %d' % ret)