Hi, I'm Samuel Cochran

on Twitter, Facebook, Google, LinkedIn, GitHub, Stack Overflow, and Steam.

OpenLDAP 2.3, Python 2.5 and Python-LDAP on Debian Etch

In case anyone else has the misfortune of being stuck on a Debian Etch box with Python 2.5 and finds themselves needing Python-LDAP:

Installing the latest version of Python-LDAP 2.3.x doesn't work. It requires OpenLDAP >= 2.3. Installing an old version of Python-LDAP using Python 2.5 against the OpenLDAP ~= 2.1 libraries available in Etch gave me no end of segfaults and weird issues and going back to Python 2.4 wasn't an option.

OpenLDAP 2.3 has been backported by the Debian security team, thankfully. Problem: they didn't create a development package. Solution: I grabbed the source package and fiddled with Python LDAP's setup.cfg. Put the source package somewhere and apply the Debian patch manually. Change the [_ldap] section of Python-LDAP's setup.cfg to something like:

[_ldap]
extra_objects = /usr/lib/libldap_r-2.3.so.0 /usr/lib/liblber-2.3.so.0
extra_compile_args =
libs = sasl2 ssl crypto
library_dirs = /usr/lib
include_dirs = /root/openldap-2.3.30/include /usr/include/sasl

Now easy_install the directory and you're done! Not very Debian, but it works.