Installing python-ldap in OpenSolaris 2009.06

Note: This has been tested with b110, which is very close to the final 2009.06 GA build.

One of the new features in OpenSolaris 2009.06 is the integration of OpenLDAP 2.4.11.  The presence of the client libraries in particular will be of great benefit to the deployment of a number of open source applications which have extensive support for the OpenLDAP libraries but not so much (or any) for the native Solaris LDAP libraries.

One such application is the LDAP extension for Python.  As noted in its INSTALL file:

  Required:

    - Python 2.3 or newer (see http://www.python.org)

    - OpenLDAP libs (see http://www.openldap.org)
      You need OpenLDAP 2.3.x client libs or newer for full
      functionality. It is not possible and not supported
      by the python-ldap project to build with prior versions.

Some open source applications have challenges with the OpenLDAP file layout in OpenSolaris; however, python-ldap isn't one of them, as the setup.cfg mechanism is  flexible enough to support the names of the OpenLDAP libraries and the locations of the OpenLDAP header files within OpenSolaris.

Here are the required changes to the default setup.cfg from python-ldap 2.3.6 to build with OpenSolaris 2009.06:

$ diff -u setup.cfg.orig setup.cfg
--- setup.cfg.orig    Mon Apr  6 07:42:07 2009
+++ setup.cfg    Mon Apr  6 07:44:27 2009
@@ -1,9 +1,9 @@
 [_ldap]
 extra_objects =
 extra_compile_args =
-libs = ldap_r lber sasl2 ssl crypto
-library_dirs = /usr/local/openldap-2.3/lib
-include_dirs = /usr/local/openldap-2.3/include /usr/include/sasl
+libs = ldap_r-2.4 lber-2.4 sasl ssl crypto
+library_dirs = /usr/sfw/lib
+include_dirs = /usr/include/openldap /usr/include/sasl

 [egg_info]
 tag_build =

With these changes, you can proceed to the usual python setup.py build and python setup.py install, but first note that three levels of Python are included with 2009.06 -- 2.4, 2.5, and 2.6 -- with the default python command pointing to 2.4.  You'll need to install python-ldap for the desired version(s) of Python.  For example, to install it for use with the non-default Python 2.6, use the commands python2.6 setup.py build and python2.6 setup.py install.

HTH!
Comments:

Post a Comment:
Comments are closed for this entry.
About

Jeff Trawick

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today