3 from distutils.core import setup
4 from distutils.extension import Extension
5 from Cython.Distutils import build_ext
9 for root in ['/Library/OpenAFS/Tools',
13 if os.path.exists('%s/include/afs/afs.h' % root):
16 include_dirs = [os.path.join(os.path.dirname(__file__), 'afs'),
18 library_dirs = ['%s/lib' % root,
20 libraries = ['afsauthent', 'afsrpc', 'afsutil', 'resolv']
21 define_macros = [('AFS_PTHREAD_ENV', None)]
23 def PyAFSExtension(module):
24 return Extension(module,
25 ["%s.pyx" % module.replace('.', '/')],
27 include_dirs=include_dirs,
28 library_dirs=library_dirs,
29 define_macros=define_macros)
34 description="PyAFS - Python bindings for AFS",
36 author_email="broder@mit.edu",
39 packages=['afs', 'afs.tests'],
41 PyAFSExtension("afs.afs"),
42 PyAFSExtension("afs._pts"),
43 PyAFSExtension("afs._acl"),
45 cmdclass= {"build_ext": build_ext}