summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-02-12 01:21:10 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-02-12 01:21:10 +0100
commit1529331b97cc67869f07c2cfa8c73616f3247b73 (patch)
treeb7ddf59c80d04e7a70255354b332958ea9205fb8 /source4/lib/ldb
parentaa2fd8ee50d8e416a503fb920f0195cd89c4c93b (diff)
downloadsamba-1529331b97cc67869f07c2cfa8c73616f3247b73.tar.gz
samba-1529331b97cc67869f07c2cfa8c73616f3247b73.tar.bz2
samba-1529331b97cc67869f07c2cfa8c73616f3247b73.zip
Avoid using setup.py for intsallation.
(This used to be commit 7b93e43dad55454e9107a38e67764e08f51392d3)
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/configure.ac1
-rw-r--r--source4/lib/ldb/ldb.mk5
-rwxr-xr-xsource4/lib/ldb/tests/python/api.py3
3 files changed, 7 insertions, 2 deletions
diff --git a/source4/lib/ldb/configure.ac b/source4/lib/ldb/configure.ac
index 1435536373..4d9444ad10 100644
--- a/source4/lib/ldb/configure.ac
+++ b/source4/lib/ldb/configure.ac
@@ -78,6 +78,7 @@ AC_LIBREPLACE_MDLD_FLAGS
AC_LIBREPLACE_RUNTIME_LIB_PATH_VAR
AC_PATH_PROGS([PYTHON_CONFIG], [python2.6-config python2.5-config python2.4-config python-config])
+AC_PATH_PROGS([PYTHON], [python2.6 python2.5 python2.4 python])
PYTHON_BUILD_TARGET="build-python"
PYTHON_INSTALL_TARGET="install-python"
diff --git a/source4/lib/ldb/ldb.mk b/source4/lib/ldb/ldb.mk
index 69c1bf6ad9..6d0ad44d38 100644
--- a/source4/lib/ldb/ldb.mk
+++ b/source4/lib/ldb/ldb.mk
@@ -74,13 +74,14 @@ _ldb.$(SHLIBEXT): $(LIBS) ldb_wrap.o
$(SHLD) $(SHLD_FLAGS) -o _ldb.$(SHLIBEXT) ldb_wrap.o $(LIB_FLAGS)
install-python:: build-python
- $(ldbdir)/setup.py install --prefix=$(DESTDIR)$(prefix)
+ cp $(ldbdir)/ldb.py $(DESTDIR)`$(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(0)"`
+ cp _ldb.$(SHLIBEXT) $(DESTDIR)`$(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1)"`
install-swig::
cp ldb.i `$(SWIG) -swiglib`
check-python:: build-python
- LD_LIBRARY_PATH=lib PYTHONPATH=.:$(ldbdir) trial $(ldbdir)/tests/python/api.py
+ LD_LIBRARY_PATH=lib PYTHONPATH=.:$(ldbdir) $(PYTHON) $(ldbdir)/tests/python/api.py
clean::
rm -f _ldb.$(SHLIBEXT)
diff --git a/source4/lib/ldb/tests/python/api.py b/source4/lib/ldb/tests/python/api.py
index d5346c30b0..5f3f727b5d 100755
--- a/source4/lib/ldb/tests/python/api.py
+++ b/source4/lib/ldb/tests/python/api.py
@@ -418,3 +418,6 @@ class ModuleTests(unittest.TestCase):
def test_register_module(self):
ldb.register_module(ExampleModule())
+if __name__ == '__main__':
+ import unittest
+ unittest.TestProgram()