[python-ldap] Issues installing py-ldap2

McCann, Brian bmccann at andmore.com
Fri Nov 11 16:57:33 CET 2011


Hi all.  I've spent a few hours trying to figure this out and it's driving me nutty.

I have one FreeBSD "ports" machine I build packages on, then install those packages on all my various servers (of the same OS version.  In this case, FreeBSD 6.2)  On that machine, I've built and packaged py-ldap2 without issue.  When I try to install that package on another machine, it fails.  Here's the output of the pkg_add (story continues after output):

---Start---
extra_compile_args: -g
extra_objects:
include_dirs: /opt/openldap-RE24/include /usr/include/sasl
library_dirs: /opt/openldap-RE24/lib
libs: ldap_r lber sasl2 ssl crypto
file Lib/ldap.py (for module ldap) not found
file Lib/ldap/controls.py (for module ldap.controls) not found
file Lib/ldap/extop.py (for module ldap.extop) not found
file Lib/ldap/schema.py (for module ldap.schema) not found
warning: no files found matching 'Makefile'
warning: no files found matching 'Modules/LICENSE'
file Lib/ldap.py (for module ldap) not found
file Lib/ldap/controls.py (for module ldap.controls) not found
file Lib/ldap/extop.py (for module ldap.extop) not found
file Lib/ldap/schema.py (for module ldap.schema) not found
file Lib/ldap.py (for module ldap) not found
file Lib/ldap/controls.py (for module ldap.controls) not found
file Lib/ldap/extop.py (for module ldap.extop) not found
file Lib/ldap/schema.py (for module ldap.schema) not found
In file included from Modules/LDAPObject.c:9:
Modules/errors.h:8:18: lber.h: No such file or directory
Modules/errors.h:9:18: ldap.h: No such file or directory
In file included from Modules/LDAPObject.c:9:
Modules/errors.h:12: error: syntax error before '*' token
In file included from Modules/LDAPObject.c:11:
Modules/LDAPObject.h:12:2: #error Current python-ldap requires OpenLDAP 2.x
In file included from Modules/LDAPObject.c:11:
Modules/LDAPObject.h:23: error: syntax error before "LDAP"
Modules/LDAPObject.h:31: error: syntax error before '*' token
In file included from Modules/LDAPObject.c:12:
Modules/ldapcontrol.h:11: error: syntax error before '*' token
Modules/ldapcontrol.h:12: error: syntax error before "LDAPControl"
Modules/ldapcontrol.h:13: error: syntax error before '*' token
In file included from Modules/LDAPObject.c:13:
Modules/message.h:11: error: syntax error before '*' token
In file included from Modules/LDAPObject.c:14:
Modules/berval.h:10: warning: "struct berval" declared inside parameter list
Modules/berval.h:10: warning: its scope is only this definition or declaration, which is probably not what you want
Modules/berval.h:12: warning: "struct berval" declared inside parameter list
Modules/berval.h:13: warning: "struct berval" declared inside parameter list
Modules/LDAPObject.c:18:18: sasl.h: No such file or directory
Modules/LDAPObject.c:26: error: syntax error before '*' token
Modules/LDAPObject.c: In function `newLDAPObject':
Modules/LDAPObject.c:31: error: structure has no member named `ldap'
Modules/LDAPObject.c:31: error: `l' undeclared (first use in this function)
Modules/LDAPObject.c:31: error: (Each undeclared identifier is reported only once
Modules/LDAPObject.c:31: error: for each function it appears in.)
Modules/LDAPObject.c: In function `dealloc':
Modules/LDAPObject.c:42: error: structure has no member named `ldap'
Modules/LDAPObject.c:45: error: structure has no member named `ldap'
Modules/LDAPObject.c:49: error: structure has no member named `ldap'
Modules/LDAPObject.c: At top level:
Modules/LDAPObject.c:76: error: syntax error before '*' token
Modules/LDAPObject.c: In function `LDAPMod_DEL':
Modules/LDAPObject.c:80: error: `lm' undeclared (first use in this function)
Modules/LDAPObject.c: At top level:
Modules/LDAPObject.c:103: error: syntax error before '*' token
Modules/LDAPObject.c: In function `Tuple_to_LDAPMod':
Modules/LDAPObject.c:109: error: `LDAPMod' undeclared (first use in this function)
Modules/LDAPObject.c:109: error: `lm' undeclared (first use in this function)
Modules/LDAPObject.c:127: error: syntax error before ')' token
Modules/LDAPObject.c:131: error: `LDAP_MOD_BVALUES' undeclared (first use in this function)
Modules/LDAPObject.c:147: error: invalid application of `sizeof' to incomplete type `berval'
Modules/LDAPObject.c:147: warning: division by zero
Modules/LDAPObject.c:147: error: invalid application of `sizeof' to incomplete type `berval'
Modules/LDAPObject.c:147: error: invalid application of `sizeof' to incomplete type `berval'
Modules/LDAPObject.c:147: error: invalid application of `sizeof' to incomplete type `berval'
Modules/LDAPObject.c:159: error: invalid application of `sizeof' to incomplete type `berval'
Modules/LDAPObject.c:159: warning: division by zero
Modules/LDAPObject.c:159: error: invalid application of `sizeof' to incomplete type `berval'
Modules/LDAPObject.c:159: error: invalid application of `sizeof' to incomplete type `berval'
Modules/LDAPObject.c:159: error: invalid application of `sizeof' to incomplete type `berval'
Modules/LDAPObject.c: At top level:
Modules/LDAPObject.c:194: error: syntax error before '*' token
Modules/LDAPObject.c: In function `LDAPMods_DEL':
Modules/LDAPObject.c:195: error: `LDAPMod' undeclared (first use in this function)
Modules/LDAPObject.c:195: error: `lmp' undeclared (first use in this function)
Modules/LDAPObject.c:196: error: `lms' undeclared (first use in this function)
Modules/LDAPObject.c: At top level:
Modules/LDAPObject.c:206: error: syntax error before '*' token
Modules/LDAPObject.c: In function `List_to_LDAPMods':
Modules/LDAPObject.c:210: error: `LDAPMod' undeclared (first use in this function)
Modules/LDAPObject.c:210: error: `lms' undeclared (first use in this function)
Modules/LDAPObject.c:227: error: syntax error before ')' token
Modules/LDAPObject.c:227: error: syntax error before ')' token
Modules/LDAPObject.c:227: error: syntax error before ')' token
Modules/LDAPObject.c:227: error: syntax error before ')' token
Modules/LDAPObject.c:227: error: syntax error before ')' token
Modules/LDAPObject.c: In function `l_ldap_unbind_ext':
Modules/LDAPObject.c:332: error: `LDAPControl' undeclared (first use in this function)
Modules/LDAPObject.c:332: error: `server_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:333: error: `client_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:351: error: structure has no member named `ldap'
Modules/LDAPObject.c:357: error: `LDAP_SUCCESS' undeclared (first use in this function)
Modules/LDAPObject.c:358: error: structure has no member named `ldap'
Modules/LDAPObject.c: In function `l_ldap_abandon_ext':
Modules/LDAPObject.c:373: error: `LDAPControl' undeclared (first use in this function)
Modules/LDAPObject.c:373: error: `server_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:374: error: `client_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:392: error: structure has no member named `ldap'
Modules/LDAPObject.c:398: error: `LDAP_SUCCESS' undeclared (first use in this function)
Modules/LDAPObject.c:399: error: structure has no member named `ldap'
Modules/LDAPObject.c: In function `l_ldap_add_ext':
Modules/LDAPObject.c:414: error: `LDAPControl' undeclared (first use in this function)
Modules/LDAPObject.c:414: error: `server_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:415: error: `client_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:419: error: `LDAPMod' undeclared (first use in this function)
Modules/LDAPObject.c:419: error: `mods' undeclared (first use in this function)
Modules/LDAPObject.c:439: error: structure has no member named `ldap'
Modules/LDAPObject.c:445: error: `LDAP_SUCCESS' undeclared (first use in this function)
Modules/LDAPObject.c:446: error: structure has no member named `ldap'
Modules/LDAPObject.c: In function `l_ldap_simple_bind':
Modules/LDAPObject.c:462: error: `LDAPControl' undeclared (first use in this function)
Modules/LDAPObject.c:462: error: `server_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:463: error: `client_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:464: error: storage size of 'cred' isn't known
Modules/LDAPObject.c:467: error: `ber_len_t' undeclared (first use in this function)
Modules/LDAPObject.c:467: error: syntax error before "cred_len"
Modules/LDAPObject.c:482: error: structure has no member named `ldap'
Modules/LDAPObject.c:482: error: `LDAP_SASL_SIMPLE' undeclared (first use in this function)
Modules/LDAPObject.c:488: error: `LDAP_SUCCESS' undeclared (first use in this function)
Modules/LDAPObject.c:489: error: structure has no member named `ldap'
Modules/LDAPObject.c: At top level:
Modules/LDAPObject.c:553: error: syntax error before "sasl_interact_t"
Modules/LDAPObject.c: In function `interaction':
Modules/LDAPObject.c:559: error: `SASLObject' undeclared (first use in this function)
Modules/LDAPObject.c:562: error: `interact' undeclared (first use in this function)
Modules/LDAPObject.c:569: error: `LDAP_OPERATIONS_ERROR' undeclared (first use in this function)
Modules/LDAPObject.c:589: error: `LDAP_SUCCESS' undeclared (first use in this function)
Modules/LDAPObject.c: At top level:
Modules/LDAPObject.c:601: error: syntax error before '*' token
Modules/LDAPObject.c: In function `py_ldap_sasl_interaction':
Modules/LDAPObject.c:607: error: `sasl_interact_t' undeclared (first use in this function)
Modules/LDAPObject.c:607: error: `interact' undeclared (first use in this function)
Modules/LDAPObject.c:607: error: syntax error before ')' token
Modules/LDAPObject.c:608: error: `defaults' undeclared (first use in this function)
Modules/LDAPObject.c:610: error: `SASL_CB_LIST_END' undeclared (first use in this function)
Modules/LDAPObject.c:612: error: `flags' undeclared (first use in this function)
Modules/LDAPObject.c:616: error: `LDAP_SUCCESS' undeclared (first use in this function)
Modules/LDAPObject.c: In function `l_ldap_sasl_interactive_bind_s':
Modules/LDAPObject.c:627: error: `LDAPControl' undeclared (first use in this function)
Modules/LDAPObject.c:627: error: `server_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:628: error: `client_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:634: error: `LDAP_SASL_QUIET' undeclared (first use in this function)
Modules/LDAPObject.c:674: error: structure has no member named `ldap'
Modules/LDAPObject.c:677: error: syntax error before ')' token
Modules/LDAPObject.c:686: error: `LDAP_SUCCESS' undeclared (first use in this function)
Modules/LDAPObject.c:687: error: structure has no member named `ldap'
Modules/LDAPObject.c: In function `l_ldap_compare_ext':
Modules/LDAPObject.c:745: error: `LDAPControl' undeclared (first use in this function)
Modules/LDAPObject.c:745: error: `server_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:746: error: `client_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:751: error: storage size of 'value' isn't known
Modules/LDAPObject.c:754: error: `ber_len_t' undeclared (first use in this function)
Modules/LDAPObject.c:754: error: syntax error before "value_len"
Modules/LDAPObject.c:769: error: structure has no member named `ldap'
Modules/LDAPObject.c:775: error: `LDAP_SUCCESS' undeclared (first use in this function)
Modules/LDAPObject.c:776: error: structure has no member named `ldap'
Modules/LDAPObject.c: In function `l_ldap_delete_ext':
Modules/LDAPObject.c:790: error: `LDAPControl' undeclared (first use in this function)
Modules/LDAPObject.c:790: error: `server_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:791: error: `client_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:810: error: structure has no member named `ldap'
Modules/LDAPObject.c:816: error: `LDAP_SUCCESS' undeclared (first use in this function)
Modules/LDAPObject.c:817: error: structure has no member named `ldap'
Modules/LDAPObject.c: In function `l_ldap_modify_ext':
Modules/LDAPObject.c:832: error: `LDAPControl' undeclared (first use in this function)
Modules/LDAPObject.c:832: error: `server_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:833: error: `client_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:837: error: `LDAPMod' undeclared (first use in this function)
Modules/LDAPObject.c:837: error: `mods' undeclared (first use in this function)
Modules/LDAPObject.c:857: error: structure has no member named `ldap'
Modules/LDAPObject.c:864: error: `LDAP_SUCCESS' undeclared (first use in this function)
Modules/LDAPObject.c:865: error: structure has no member named `ldap'
Modules/LDAPObject.c: In function `l_ldap_rename':
Modules/LDAPObject.c:881: error: `LDAPControl' undeclared (first use in this function)
Modules/LDAPObject.c:881: error: `server_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:882: error: `client_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:902: error: structure has no member named `ldap'
Modules/LDAPObject.c:908: error: `LDAP_SUCCESS' undeclared (first use in this function)
Modules/LDAPObject.c:909: error: structure has no member named `ldap'
Modules/LDAPObject.c: In function `l_ldap_result4':
Modules/LDAPObject.c:920: error: `LDAP_RES_ANY' undeclared (first use in this function)
Modules/LDAPObject.c:929: error: `LDAPMessage' undeclared (first use in this function)
Modules/LDAPObject.c:929: error: `msg' undeclared (first use in this function)
Modules/LDAPObject.c:947: error: structure has no member named `ldap'
Modules/LDAPObject.c:951: error: structure has no member named `ldap'
Modules/LDAPObject.c:963: error: `LDAP_TIMEOUT' undeclared (first use in this function)
Modules/LDAPObject.c:969: error: `LDAP_SUCCESS' undeclared (first use in this function)
Modules/LDAPObject.c:971: error: `LDAPControl' undeclared (first use in this function)
Modules/LDAPObject.c:971: error: `serverctrls' undeclared (first use in this function)
Modules/LDAPObject.c:973: error: `LDAP_RES_SEARCH_ENTRY' undeclared (first use in this function)
Modules/LDAPObject.c:975: error: `LDAP_RES_SEARCH_REFERENCE' undeclared (first use in this function)
Modules/LDAPObject.c:977: error: `LDAP_RES_INTERMEDIATE' undeclared (first use in this function)
Modules/LDAPObject.c:981: error: `LDAP_RES_EXTENDED' undeclared (first use in this function)
Modules/LDAPObject.c:983: error: structure has no member named `ldap'
Modules/LDAPObject.c:991: error: structure has no member named `ldap'
Modules/LDAPObject.c:998: error: `LDAP_REFERRAL' undeclared (first use in this function)
Modules/LDAPObject.c:1004: error: structure has no member named `ldap'
Modules/LDAPObject.c:1008: error: `LDAP_NO_MEMORY' undeclared (first use in this function)
Modules/LDAPObject.c:1009: error: structure has no member named `ldap'
Modules/LDAPObject.c:1009: error: `LDAP_OPT_ERROR_NUMBER' undeclared (first use in this function)
Modules/LDAPObject.c:1011: error: structure has no member named `ldap'
Modules/LDAPObject.c:1015: error: structure has no member named `ldap'
Modules/LDAPObject.c: In function `l_ldap_search_ext':
Modules/LDAPObject.c:1057: error: `LDAPControl' undeclared (first use in this function)
Modules/LDAPObject.c:1057: error: `server_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:1058: error: `client_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:1095: error: structure has no member named `ldap'
Modules/LDAPObject.c:1103: error: `LDAP_SUCCESS' undeclared (first use in this function)
Modules/LDAPObject.c:1104: error: structure has no member named `ldap'
Modules/LDAPObject.c: In function `l_ldap_whoami_s':
Modules/LDAPObject.c:1117: error: `LDAPControl' undeclared (first use in this function)
Modules/LDAPObject.c:1117: error: `server_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:1118: error: `client_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:1139: error: structure has no member named `ldap'
Modules/LDAPObject.c:1145: error: `LDAP_SUCCESS' undeclared (first use in this function)
Modules/LDAPObject.c:1146: error: structure has no member named `ldap'
Modules/LDAPObject.c: In function `l_ldap_start_tls_s':
Modules/LDAPObject.c:1164: error: structure has no member named `ldap'
Modules/LDAPObject.c:1165: error: `LDAP_SUCCESS' undeclared (first use in this function)
Modules/LDAPObject.c:1166: error: structure has no member named `ldap'
Modules/LDAPObject.c:1166: error: `LDAP_OPT_ERROR_NUMBER' undeclared (first use in this function)
Modules/LDAPObject.c:1167: error: structure has no member named `ldap'
Modules/LDAPObject.c: In function `l_ldap_passwd':
Modules/LDAPObject.c:1211: error: storage size of 'user' isn't known
Modules/LDAPObject.c:1213: error: storage size of 'oldpw' isn't known
Modules/LDAPObject.c:1215: error: storage size of 'newpw' isn't known
Modules/LDAPObject.c:1219: error: `LDAPControl' undeclared (first use in this function)
Modules/LDAPObject.c:1219: error: `server_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:1220: error: `client_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:1228: error: `ber_len_t' undeclared (first use in this function)
Modules/LDAPObject.c:1228: error: syntax error before "user_len"
Modules/LDAPObject.c:1229: error: syntax error before "oldpw_len"
Modules/LDAPObject.c:1230: error: syntax error before "newpw_len"
Modules/LDAPObject.c:1245: error: structure has no member named `ldap'
Modules/LDAPObject.c:1257: error: `LDAP_SUCCESS' undeclared (first use in this function)
Modules/LDAPObject.c:1258: error: structure has no member named `ldap'
Modules/LDAPObject.c: In function `l_ldap_extended_operation':
Modules/LDAPObject.c:1270: error: variable `reqvalue' has initializer but incomplete type
Modules/LDAPObject.c:1270: warning: excess elements in struct initializer
Modules/LDAPObject.c:1270: warning: (near initialization for `reqvalue')
Modules/LDAPObject.c:1270: warning: excess elements in struct initializer
Modules/LDAPObject.c:1270: warning: (near initialization for `reqvalue')
Modules/LDAPObject.c:1270: error: storage size of 'reqvalue' isn't known
Modules/LDAPObject.c:1273: error: `LDAPControl' undeclared (first use in this function)
Modules/LDAPObject.c:1273: error: `server_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:1274: error: `client_ldcs' undeclared (first use in this function)
Modules/LDAPObject.c:1295: error: structure has no member named `ldap'
Modules/LDAPObject.c:1305: error: `LDAP_SUCCESS' undeclared (first use in this function)
Modules/LDAPObject.c:1306: error: structure has no member named `ldap'
error: Setup script exited with error: command 'cc' failed with exit status 1
pkg_add: command '/usr/bin/env PYTHONPATH=/usr/local/lib/python2.7/site-packages  /usr/local/bin/easy_install-2.7 -q -N -S /usr/local/lib/python2.7/site-packages  -d /usr/local/lib/python2.7/site-packages  -s /usr/local/bin  python-ldap==2.4.3' failed
---End---

What's driving me bonkers and what I THINK is the cause of the problem is the "include_dirs: /opt/openldap-RE24/include /usr/include/sasl" and "library_dirs: /opt/openldap-RE24/lib".  Those are just wrong.  When I build the package, it uses "include_dirs: /usr/local/include /usr/include/sasl" and "library_dirs: /usr/local/lib".  Those directories will get the installer to actually find the missing lber.h, etc.  I un-tarballed the tbz file and grep'd through all the files looking for "RE24", and couldn't find where it's getting that include path from.

Can someone please point me in the right direction here?

Thanks,
--Brian


More information about the python-ldap mailing list