python-ldap is built and installed using the Python DistUtils installed along with your Python installation:
python setup.py build
python setup.py install
If you have more than one Python interpreter installed locally you should use the same one you plan to use python-ldap with.
See further instructions for using DistUtils here: https://docs.python.org/2.7/install/index.html
The following software packages are required to be installed on the local system when building python-ldap:
- Python version 2.3 or later including its development files: https://www.python.org/
- OpenLDAP client libs version 2.4.11 or later: https://www.openldap.org/ It is not possible and not supported to build with prior versions.
- OpenSSL (optional): https://www.openssl.org/
- cyrus-sasl (optional): https://www.cyrusimap.org/sasl/
- Kerberos libs, MIT or heimdal (optional)
Furthermore it is required that modules :pypyasn1
and :pypyasn1_modules
are installed.
https://github.com/etingof/pyasn1
The file setup.cfg allows to set some build and installation parameters for reflecting the local installation of required software packages. Only section [_ldap] is described here. More information about other sections can be found in the documentation of Python's DistUtils.
library_dirs
Specifies in which directories to search for required libraries.
include_dirs
Specifies in which directories to search for include files of required libraries.
libs
A space-separated list of library names to link to (see libs-used-label
).
extra_compile_args
Compiler options.
extra_objects
The following example is for a full-featured build (including SSL and SASL support) of python-ldap with OpenLDAP installed in a different prefix directory (here /opt/openldap-2.4) and SASL header files found in /usr/include/sasl. Debugging symbols are preserved with compile option -g.
[_ldap]
library_dirs = /opt/openldap-2.4/lib
include_dirs = /opt/openldap-2.4/include /usr/include/sasl
extra_compile_args = -g
extra_objects =
libs = ldap_r lber sasl2 ssl crypto