summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb/pyldb.c2
-rwxr-xr-xsource4/lib/ldb/tests/python/api.py6
-rw-r--r--source4/lib/ldb/wscript3
3 files changed, 10 insertions, 1 deletions
diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c
index 25f4661dce..fe7e8a1f3d 100644
--- a/source4/lib/ldb/pyldb.c
+++ b/source4/lib/ldb/pyldb.c
@@ -2744,4 +2744,6 @@ void initldb(void)
PyModule_AddObject(m, "MessageElement", (PyObject *)&PyLdbMessageElement);
PyModule_AddObject(m, "Module", (PyObject *)&PyLdbModule);
PyModule_AddObject(m, "Tree", (PyObject *)&PyLdbTree);
+
+ PyModule_AddObject(m, "__version__", PyString_FromString(PACKAGE_VERSION));
}
diff --git a/source4/lib/ldb/tests/python/api.py b/source4/lib/ldb/tests/python/api.py
index 76de853ac7..b8adbaaf54 100755
--- a/source4/lib/ldb/tests/python/api.py
+++ b/source4/lib/ldb/tests/python/api.py
@@ -611,6 +611,12 @@ class ModuleTests(unittest.TestCase):
self.assertEquals(["init"], ops)
+class VersionTests(unittest.TestCase):
+
+ def test_version(self):
+ self.assertTrue(isinstance(ldb.__version__, str))
+
+
if __name__ == '__main__':
import unittest
unittest.TestProgram()
diff --git a/source4/lib/ldb/wscript b/source4/lib/ldb/wscript
index 226175778e..ddf12835aa 100644
--- a/source4/lib/ldb/wscript
+++ b/source4/lib/ldb/wscript
@@ -139,7 +139,8 @@ def build(bld):
bld.SAMBA_PYTHON('pyldb', 'pyldb.c',
deps='ldb pyldb_util',
- realname='ldb.so')
+ realname='ldb.so',
+ cflags='-DPACKAGE_VERSION=\"%s\"' % VERSION)
bld.SAMBA_MODULE('ldb_paged_results',
'modules/paged_results.c',