#!/usr/bin/env python
APPNAME = 'ldb'
-VERSION = '1.6.0'
+VERSION = '1.6.2'
import sys, os
implied_deps='replace talloc tdb tevent ldb'):
using_system_pyldb_util = False
- # We need to get a pyldb-util for all the python versions
- # we are building for
- if conf.env['EXTRA_PYTHON']:
- name = 'pyldb-util' + conf.all_envs['extrapython']['PYTHON_SO_ABI_FLAG']
- if not conf.CHECK_BUNDLED_SYSTEM_PKG(name,
- minversion=VERSION,
- maxversion=max_ldb_version_dots,
- onlyif='talloc tdb tevent',
- implied_deps='replace talloc tdb tevent ldb'):
- using_system_pyldb_util = False
-
if using_system_pyldb_util:
conf.define('USING_SYSTEM_PYLDB_UTIL', 1)
if conf.CHECK_FUNCS_IN('mdb_env_create', 'lmdb', headers='lmdb.h'):
conf.DEFINE('HAVE_LMDB', '1')
+ conf.env.HAVE_LMDB = True
conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True)
if bld.PYTHON_BUILD_IS_ENABLED():
if not bld.CONFIG_SET('USING_SYSTEM_PYLDB_UTIL'):
- for env in bld.gen_python_environments(['PKGCONFIGDIR']):
-
- name = bld.pyembed_libname('pyldb-util')
- bld.SAMBA_LIBRARY(name,
- deps='replace ldb',
- source='pyldb_util.c',
- public_headers=('' if private_library else 'pyldb.h'),
- public_headers_install=not private_library,
- vnum=VERSION,
- private_library=private_library,
- pc_files='pyldb-util.pc',
- pyembed=True,
- enabled=bld.PYTHON_BUILD_IS_ENABLED(),
- abi_directory='ABI',
- abi_match='pyldb_*')
-
- if not bld.CONFIG_SET('USING_SYSTEM_LDB'):
- bld.SAMBA_PYTHON('pyldb', 'pyldb.c',
- deps='replace ldb ' + name,
- realname='ldb.so',
- cflags='-DPACKAGE_VERSION=\"%s\"' % VERSION)
+ name = bld.pyembed_libname('pyldb-util')
+ bld.SAMBA_LIBRARY(name,
+ deps='replace ldb',
+ source='pyldb_util.c',
+ public_headers=('' if private_library else 'pyldb.h'),
+ public_headers_install=not private_library,
+ vnum=VERSION,
+ private_library=private_library,
+ pc_files='pyldb-util.pc',
+ pyembed=True,
+ enabled=bld.PYTHON_BUILD_IS_ENABLED(),
+ abi_directory='ABI',
+ abi_match='pyldb_*')
+
+ if not bld.CONFIG_SET('USING_SYSTEM_LDB'):
+ bld.SAMBA_PYTHON('pyldb', 'pyldb.c',
+ deps='replace ldb ' + name,
+ realname='ldb.so',
+ cflags='-DPACKAGE_VERSION=\"%s\"' % VERSION)
# Do only install this file as part of the Samba build if we do not
# use the system libldb!
if not bld.CONFIG_SET('USING_SYSTEM_PYLDB_UTIL'):
- for env in bld.gen_python_environments(['PKGCONFIGDIR']):
- bld.SAMBA_SCRIPT('_ldb_text.py',
- pattern='_ldb_text.py',
- installdir='python')
+ bld.SAMBA_SCRIPT('_ldb_text.py',
+ pattern='_ldb_text.py',
+ installdir='python')
- bld.INSTALL_FILES('${PYTHONARCHDIR}', '_ldb_text.py')
+ bld.INSTALL_FILES('${PYTHONARCHDIR}', '_ldb_text.py')
if not bld.CONFIG_SET('USING_SYSTEM_LDB'):
if bld.is_install:
cflags='-DTEST_BE=\"mdb\"',
deps='cmocka ldb',
install=False)
+ else:
+ bld.SAMBA_BINARY('ldb_no_lmdb_test',
+ source='tests/ldb_no_lmdb_test.c',
+ deps='cmocka ldb',
+ install=False)
def test(ctx):
'''run ldb testsuite'''
env = samba_utils.LOAD_ENVIRONMENT()
ctx.env = env
- if not env.HAVE_LMDB:
- raise Errors.WafError('make test called, but ldb was built '
- '--without-ldb-lmdb')
-
test_prefix = "%s/st" % (Context.g_module.out)
shutil.rmtree(test_prefix, ignore_errors=True)
os.makedirs(test_prefix)
os.environ['TEST_DATA_PREFIX'] = test_prefix
os.environ['LDB_MODULES_PATH'] = Context.g_module.out + "/modules/ldb"
+ if env.HAVE_LMDB:
+ os.environ['HAVE_LMDB'] = '1'
+ else:
+ os.environ['HAVE_LMDB'] = '0'
samba_utils.ADD_LD_LIBRARY_PATH('bin/shared')
samba_utils.ADD_LD_LIBRARY_PATH('bin/shared/private')
'ldb_msg_test',
'ldb_tdb_kv_ops_test',
'ldb_tdb_test',
- 'ldb_mdb_mod_op_test',
- 'ldb_lmdb_test',
- # we don't want to run ldb_lmdb_size_test (which proves we can
- # fit > 4G of data into the DB), it would fill up the disk on
- # many of our test instances
- 'ldb_mdb_kv_ops_test',
'ldb_match_test']
+ if env.HAVE_LMDB:
+ test_exes += ['ldb_mdb_mod_op_test',
+ 'ldb_lmdb_test',
+ # we don't want to run ldb_lmdb_size_test (which proves we can
+ # fit > 4G of data into the DB), it would fill up the disk on
+ # many of our test instances
+ 'ldb_mdb_kv_ops_test']
+ else:
+ test_exes += ['ldb_no_lmdb_test']
+
for test_exe in test_exes:
cmd = os.path.join(Context.g_module.out, test_exe)
cmocka_ret = cmocka_ret or samba_utils.RUN_COMMAND(cmd)