r26108: Add makefile rules for building, installing and checking python bindings.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 25 Nov 2007 02:06:50 +0000 (03:06 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:46:07 +0000 (05:46 +0100)
(This used to be commit d8d04300d2c2613268e8bf9e6981d172471514da)

source4/lib/tdb/Makefile.in
source4/lib/tdb/setup.py

index 2a1df7829ccacfdd951a9414fcd07492951f5ee3..651fc654de69c61551783d65a27d494065b12395 100644 (file)
@@ -68,10 +68,10 @@ libtdb.a: $(TDB_OBJ)
        ar -rv libtdb.a $(TDB_OBJ)
 
 libtdb.$(SHLIBEXT): $(SOLIB)
-       ln -s $< $@
+       ln -fs $< $@
 
 $(SONAME): $(SOLIB)
-       ln -s $< $@
+       ln -fs $< $@
 
 $(SOLIB): $(TDB_OBJ)
        $(SHLD) $(SHLD_FLAGS) -o $@ $(TDB_OBJ) @SONAMEFLAG@$(SONAME)
@@ -110,3 +110,16 @@ distclean: clean
 
 realdistclean: distclean
        rm -f configure include/config.h.in
+
+build-python: libtdb.$(SHLIBEXT)
+       ./setup.py build
+
+install-python:
+       ./setup.py install --prefix=$(prefix)
+
+check-python: build-python
+       # FIXME: Should be more portable:
+       LD_LIBRARY_PATH=. PYTHONPATH=.:build/lib.linux-i686-2.4 trial python/tests/simple.py
+
+clean-python:
+       ./setup.py clean
index 67974a888892677fbf5427e5bc26242aa06a3611..6b5ecc24ab6169a87fb4459f436475f82df24bf3 100755 (executable)
@@ -1,8 +1,10 @@
 #!/usr/bin/python
 from distutils.core import setup
 from distutils.extension import Extension
+
 setup(name='tdb',
       version='1.0',
+      url="http://tdb.samba.org/",
       ext_modules=[Extension('_tdb', ['tdb.i'], include_dirs=['include'],
-      libraries=['tdb'], swig_opts=["-noproxydel"])],
-      )
+          library_dirs=["."], libraries=['tdb'], swig_opts=["-noproxydel"])],
+)