3 from setuptools import setup, find_packages
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 = ['bos', 'volser', 'vldb', 'afsrpc', 'afsauthent', 'cmd', 'usd',
22 'util', 'afsrpc', 'util',
23 'util', 'afsauthent', 'util',
26 define_macros = [('AfS_PTHREAD_ENV', None)]
28 for i, l in enumerate(libraries):
29 if l in ('util', 'vlib') and \
30 not os.path.exists('%s/lib/afs/lib%s.a' % (root, l)):
32 extra_objects.append('%s/lib/afs/%s.a' % (root, l))
35 extra_objects.append('%s/lib/afs/libcom_err.a')
40 description="PyAFS - Python bindings for AFS",
42 author_email="broder@mit.edu",
45 packages=find_packages(),
50 include_dirs=include_dirs,
51 library_dirs=library_dirs,
52 extra_objects=extra_objects,
53 define_macros=define_macros)
55 cmdclass= {"build_ext": build_ext}