14
14
from ConfigParser import ConfigParser
15
15
import sys ,os ,string ,time
16
16
17
- ##################################################################
18
- # Weird Hack to grab release version of python-ldap from local dir
19
- ##################################################################
20
- exec_startdir = os .path .dirname (os .path .abspath (sys .argv [0 ]))
21
- package_init_file_name = reduce (os .path .join ,[exec_startdir ,'Lib' ,'ldap' ,'__init__.py' ])
22
- f = open (package_init_file_name ,'r' )
23
- s = f .readline ()
24
- while s :
25
- s = string .strip (s )
26
- if s [0 :11 ]== '__version__' :
27
- version = eval (string .split (s ,'=' )[1 ])
28
- break
29
- s = f .readline ()
30
- f .close ()
17
+ sys .path .insert (0 , os .path .join (os .getcwd (), 'Lib/ldap' ))
18
+ import pkginfo
31
19
32
20
#-- A class describing the features and requirements of OpenLDAP 2.0
33
21
class OpenLDAP2 :
@@ -78,7 +66,8 @@ class OpenLDAP2:
78
66
setup (
79
67
#-- Package description
80
68
name = name ,
81
- version = version ,
69
+ license = pkginfo .__license__ ,
70
+ version = pkginfo .__version__ ,
82
71
description = 'Python modules for implementing LDAP clients' ,
83
72
long_description = """python-ldap:
84
73
python-ldap provides an object-oriented API to access LDAP directory servers
@@ -87,7 +76,7 @@ class OpenLDAP2:
87
76
(e.g. processing LDIF, LDAPURLs, LDAPv3 schema, LDAPv3 extended operations
88
77
and controls, etc.).
89
78
""" ,
90
- author = 'python-ldap project' ,
79
+ author = pkginfo . __author__ ,
91
80
author_email = 'python-ldap@python.org' ,
92
81
url = 'https://www.python-ldap.org/' ,
93
82
download_url = 'https://pypi.python.org/pypi/python-ldap/' ,
@@ -108,7 +97,6 @@ class OpenLDAP2:
108
97
'Topic :: System :: Systems Administration :: Authentication/Directory :: LDAP' ,
109
98
'License :: OSI Approved :: Python Software Foundation License' ,
110
99
],
111
- license = 'Python style' ,
112
100
#-- C extension modules
113
101
ext_modules = [
114
102
Extension (
@@ -137,7 +125,7 @@ class OpenLDAP2:
137
125
('ldap_r' in LDAP_CLASS .libs or 'oldap_r' in LDAP_CLASS .libs )* [('HAVE_LIBLDAP_R' ,None )] + \
138
126
('sasl' in LDAP_CLASS .libs or 'sasl2' in LDAP_CLASS .libs or 'libsasl' in LDAP_CLASS .libs )* [('HAVE_SASL' ,None )] + \
139
127
('ssl' in LDAP_CLASS .libs and 'crypto' in LDAP_CLASS .libs )* [('HAVE_TLS' ,None )] + \
140
- [('LDAPMODULE_VERSION' , version )]
128
+ [('LDAPMODULE_VERSION' , pkginfo . __version__ )]
141
129
),
142
130
],
143
131
#-- Python "stand alone" modules
0 commit comments