source: trunk/packages/python-afs/setup.py @ 2766

Last change on this file since 2766 was 2599, checked in by broder, 15 years ago

Import python-afs.

Debathena should eventually be importing PyAFS for
<http://debathena.mit.edu/trac/ticket/395>, so hopefully this is only
temporary.

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/usr/bin/python
2
3from distutils.core import setup
4from distutils.extension import Extension
5from Cython.Distutils import build_ext
6import sys
7import os
8
9for 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
16include_dirs = [os.path.join(os.path.dirname(__file__), 'afs'),
17                '%s/include' % root]
18library_dirs = ['%s/lib' % root,
19                '%s/lib/afs' % root]
20if os.path.exists('%s/lib/libafsauthent_pic.a' % root):
21    suffix = '_pic'
22else:
23    suffix = ''
24libraries = ['afsauthent%s' % suffix, 'afsrpc%s' % suffix, 'resolv']
25define_macros = [('AFS_PTHREAD_ENV', None)]
26
27def PyAFSExtension(module, *args, **kwargs):
28    kwargs.setdefault('libraries', []).extend(libraries)
29    kwargs.setdefault('include_dirs', []).extend(include_dirs)
30    kwargs.setdefault('library_dirs', []).extend(library_dirs)
31    kwargs.setdefault('define_macros', []).extend(define_macros)
32    return Extension(module,
33                     ["%s.pyx" % module.replace('.', '/')],
34                     *args,
35                     **kwargs)
36
37setup(
38    name="PyAFS",
39    version="0.1.1",
40    description="PyAFS - Python bindings for AFS",
41    author="Evan Broder",
42    author_email="broder@mit.edu",
43    url="http://github.com/ebroder/pyafs/",
44    license="GPL",
45    requires=['Cython'],
46    packages=['afs', 'afs.tests'],
47    ext_modules=[
48        PyAFSExtension("afs._util"),
49        PyAFSExtension("afs._acl"),
50        PyAFSExtension("afs._fs"),
51        PyAFSExtension("afs._pts", libraries=['krb5']),
52        ],
53    cmdclass= {"build_ext": build_ext}
54)
Note: See TracBrowser for help on using the repository browser.