http://blogs.nuxeo.com/sections/blogs/florent_guillaume/2005_05_21_compiling_python_2_3_5/tbping
Here's how you do it.
Thanks to florent for this one!!
Building Berkeley DB 4.3.28 (needed by OpenLDAP):
cd build_unix
../dist/configure
make
sudo make install
Building OpenLDAP 2.2.26:
CPPFLAGS=-I/usr/local/BerkeleyDB.4.3/include LDFLAGS=-L/usr/local/BerkeleyDB.4.3/lib ./configure
vi config.status
# replace s%@LIBS@%%g with:
s%@LIBS@%-lresolv%g
./config.status
make depend
make
sudo make install
Building python-ldap 2.0.7:
vi setup.cfg
library_dirs = /usr/local/lib
include_dirs = /usr/local/include
# comment libs = sasl2 in libs:
libs = ldap_r lber ssl crypto
/usr/local/bin/python2.3 setup.py build
sudo /usr/local/bin/python2.3 setup.py install