Use isinstance(..., basestring) instead of (unicode, str).
[invirt/packages/python-afs.git] / setup.py
1 #!/usr/bin/python
2
3 from distutils.core import setup
4 from distutils.extension import Extension
5 from Cython.Distutils import build_ext
6 import sys
7 import os
8
9 for root in ['/Library/OpenAFS/Tools',
10              '/usr/local',
11              '/usr/afsws',
12              '/usr']:
13     if os.path.exists('%s/include/afs/afs.h' % root):
14         break
15
16 include_dirs = [os.path.join(os.path.dirname(__file__), 'afs'),
17                 '%s/include' % root]
18 library_dirs = ['%s/lib' % root,
19                 '%s/lib/afs' % root]
20 if os.path.exists('%s/lib/libafsauthent_pic.a' % root):
21     suffix = '_pic'
22 else:
23     suffix = ''
24 libraries = ['afsauthent%s' % suffix, 'afsrpc%s' % suffix, 'resolv']
25 define_macros = [('AFS_PTHREAD_ENV', None)]
26
27 def PyAFSExtension(module):
28     return Extension(module,
29                      ["%s.pyx" % module.replace('.', '/')],
30                      libraries=libraries,
31                      include_dirs=include_dirs,
32                      library_dirs=library_dirs,
33                      define_macros=define_macros)
34
35 setup(
36     name="PyAFS",
37     version="0.0.0",
38     description="PyAFS - Python bindings for AFS",
39     author="Evan Broder",
40     author_email="broder@mit.edu",
41     license="GPL",
42     requires=['Cython'],
43     packages=['afs', 'afs.tests'],
44     ext_modules=[
45         PyAFSExtension("afs.afs"),
46         PyAFSExtension("afs._pts"),
47         PyAFSExtension("afs._acl"),
48         ],
49     cmdclass= {"build_ext": build_ext}
50 )