Tiger comes with python 2.3.5 bundled, which is nice, but sometimes you want
to recompile it, or you want to add site-packages to it without disturbing
the standard OS installation. Here's what I had to do to compile it, and
python-ldap with it.

Building python 2.3.5:

vi pyconfig.h
make test
sudo make install

Updated: Added commenting-out of _POSIX_C_SOURCE, otherwise ESHUTDOWN cannot be imported from errno (which makes asyncore fail). Added SETPGRP_HAVE_ARG.

Building Berkeley DB 4.3.28 (needed by OpenLDAP):

cd build_unix
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%@[email protected]%%g with:
s%@[email protected]%-lresolv%g
make depend
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