diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-04-13 20:13:00 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-04-13 20:15:41 +1000 |
commit | 367ba43b63eacb2bffaf8c53c77a343481482939 (patch) | |
tree | c484b1d97e20209e7d77cfa07b92c0e87913b6c5 /lib/tdb/wscript | |
parent | 42505df161bacc24b6f0bf72baee6995c51a260b (diff) | |
download | samba-367ba43b63eacb2bffaf8c53c77a343481482939.tar.gz samba-367ba43b63eacb2bffaf8c53c77a343481482939.tar.bz2 samba-367ba43b63eacb2bffaf8c53c77a343481482939.zip |
tdb-waf: added build of manpages and config options for RPM build
Building a RPM from the fedora spec file now works with minimal changes
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib/tdb/wscript')
-rw-r--r-- | lib/tdb/wscript | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/lib/tdb/wscript b/lib/tdb/wscript index d80b7209b0..c5706a2f16 100644 --- a/lib/tdb/wscript +++ b/lib/tdb/wscript @@ -13,7 +13,7 @@ while not os.path.exists(srcdir+'/buildtools') and len(srcdir.split('/')) < 5: srcdir = '../' + srcdir sys.path.insert(0, srcdir + '/buildtools/wafsamba') -import wafsamba, samba_dist +import wafsamba, samba_dist, Options, Logs samba_dist.DIST_DIRS('lib/tdb:. lib/replace:lib/replace buildtools:buildtools') @@ -21,6 +21,11 @@ def set_options(opt): opt.BUILTIN_DEFAULT('replace') opt.BUNDLED_EXTENSION_DEFAULT('tdb', noextenion='tdb') opt.RECURSE('lib/replace') + if opt.IN_LAUNCH_DIR(): + opt.add_option('--disable-python', + help=("disable the pytdb module"), + action="store_true", dest='disable_python', default=False) + def configure(conf): conf.RECURSE('lib/replace') @@ -29,6 +34,21 @@ def configure(conf): implied_deps='replace'): conf.define('USING_SYSTEM_TDB', 1) + conf.env.standalone_tdb = conf.IN_LAUNCH_DIR() + conf.env.disable_python = getattr(Options.options, 'disable_python', False) + + if conf.env.standalone_tdb: + conf.find_program('xsltproc', var='XSLTPROC') + + if not conf.env.disable_python: + # also disable if we don't have the python libs installed + conf.check_tool('python') + conf.check_python_version((2,4,2)) + conf.check_python_headers() + if not conf.env.HAVE_PYTHON_H: + Logs.warn('Disabling pytdb as python devel libs not found') + conf.env.disable_python = True + conf.SAMBA_CONFIG_H() def build(bld): @@ -48,7 +68,8 @@ def build(bld): bld.SAMBA_BINARY('tdbtorture', 'tools/tdbtorture.c', - 'tdb') + 'tdb', + install=False) bld.SAMBA_BINARY('tdbdump', 'tools/tdbdump.c', @@ -67,9 +88,29 @@ def build(bld): bld.SAMBA_PYTHON('pytdb', 'pytdb.c', deps='tdb', - enabled=s4_build, + enabled=not bld.env.disable_python, realname='tdb.so') + if bld.env.standalone_tdb: + bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig' + bld.env.TALLOC_VERSION = VERSION + bld.PKG_CONFIG_FILES('tdb.pc', vnum=VERSION) + bld.INSTALL_FILES('${INCLUDEDIR}', 'include/tdb.h', flat=True) + + if bld.env.XSLTPROC: + manpages = 'manpages/tdbbackup.8 manpages/tdbdump.8 manpages/tdbtool.8' + + bld.env.TDB_MAN_XSL = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl' + + for m in manpages.split(): + source = m + '.xml' + bld.SAMBA_GENERATOR(m, + source=source, + target=m, + rule='${XSLTPROC} -o ${TGT} ${TDB_MAN_XSL} ${SRC}' + ) + bld.INSTALL_FILES('${MANDIR}/man8', m, flat=True) + def test(ctx): '''run tdb testsuite''' |