summaryrefslogtreecommitdiff
path: root/source4/lib/tdb
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/tdb
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/tdb')
-rw-r--r--source4/lib/tdb/Makefile.in1
-rw-r--r--source4/lib/tdb/configure.ac1
-rw-r--r--source4/lib/tdb/python/tests/simple.py5
-rw-r--r--source4/lib/tdb/tdb.mk11
4 files changed, 13 insertions, 5 deletions
diff --git a/source4/lib/tdb/Makefile.in b/source4/lib/tdb/Makefile.in
index f900469afa..8c79f6e24c 100644
--- a/source4/lib/tdb/Makefile.in
+++ b/source4/lib/tdb/Makefile.in
@@ -22,6 +22,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PICFLAG = @PICFLAG@
SHLIBEXT = @SHLIBEXT@
SWIG = swig
+PYTHON = @PYTHON@
PYTHON_CONFIG = @PYTHON_CONFIG@
PYTHON_BUILD_TARGET = @PYTHON_BUILD_TARGET@
PYTHON_INSTALL_TARGET = @PYTHON_INSTALL_TARGET@
diff --git a/source4/lib/tdb/configure.ac b/source4/lib/tdb/configure.ac
index 36d409ac11..9b16a82c33 100644
--- a/source4/lib/tdb/configure.ac
+++ b/source4/lib/tdb/configure.ac
@@ -14,6 +14,7 @@ AC_LIBREPLACE_SHLD_FLAGS
AC_LIBREPLACE_RUNTIME_LIB_PATH_VAR
m4_include(libtdb.m4)
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/tdb/python/tests/simple.py b/source4/lib/tdb/python/tests/simple.py
index 1cc51aea07..94407b6398 100644
--- a/source4/lib/tdb/python/tests/simple.py
+++ b/source4/lib/tdb/python/tests/simple.py
@@ -142,3 +142,8 @@ class SimpleTdbTests(TestCase):
self.assertEquals(0, len(self.tdb))
self.tdb["entry"] = "value"
self.assertEquals(1, len(self.tdb))
+
+
+if __name__ == '__main__':
+ import unittest
+ unittest.TestProgram()
diff --git a/source4/lib/tdb/tdb.mk b/source4/lib/tdb/tdb.mk
index 10b7c6a92d..976589fd0f 100644
--- a/source4/lib/tdb/tdb.mk
+++ b/source4/lib/tdb/tdb.mk
@@ -35,8 +35,8 @@ clean::
build-python:: _tdb.$(SHLIBEXT)
-tdb_wrap.o: tdb_wrap.c
- $(CC) -c $< $(CFLAGS) `$(PYTHON_CONFIG) --cflags`
+tdb_wrap.o: $(tdbdir)/tdb_wrap.c
+ $(CC) -c $(tdbdir)/tdb_wrap.c $(CFLAGS) `$(PYTHON_CONFIG) --cflags`
_tdb.$(SHLIBEXT): libtdb.$(SHLIBEXT) tdb_wrap.o
$(SHLD) $(SHLD_FLAGS) -o $@ tdb_wrap.o -L. -ltdb `$(PYTHON_CONFIG) --libs`
@@ -44,11 +44,12 @@ _tdb.$(SHLIBEXT): libtdb.$(SHLIBEXT) tdb_wrap.o
install:: installdirs installbin installheaders installlibs \
$(PYTHON_INSTALL_TARGET)
-installpython:: build-python
- ./setup.py install --prefix=$(DESTDIR)$(prefix)
+install-python:: build-python
+ cp $(tdbdir)/tdb.py $(DESTDIR)`$(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(0)"`
+ cp _tdb.$(SHLIBEXT) $(DESTDIR)`$(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1)"`
check-python:: build-python
- $(LIB_PATH_VAR)=. PYTHONPATH=".:$(tdbdir)" trial $(tdbdir)/python/tests/simple.py
+ $(LIB_PATH_VAR)=. PYTHONPATH=".:$(tdbdir)" $(PYTHON) $(tdbdir)/python/tests/simple.py
install-swig::
mkdir -p $(DESTDIR)`$(SWIG) -swiglib`