1 | #!/usr/bin/env python |
---|
2 | # |
---|
3 | # $Id: setup.py 434 2005-11-04 15:02:07Z bas $ |
---|
4 | |
---|
5 | import sys |
---|
6 | import os |
---|
7 | |
---|
8 | from distutils.core import setup, Extension |
---|
9 | |
---|
10 | # Libs required by this package |
---|
11 | # |
---|
12 | LIBS = ['log', 'net', 'pbs'] |
---|
13 | |
---|
14 | # Try some usefule defaults if not set |
---|
15 | # |
---|
16 | PBS_LIB_DIR='@pbspath@' |
---|
17 | if not PBS_LIB_DIR: |
---|
18 | for dir in ['/usr/lib', '/usr/local/lib', '/opt/pbs/usr/lib', '/usr/lib/torque', '/opt/pbs/lib', '/opt/torque/lib' ]: |
---|
19 | dummy = os.path.join(dir, 'libpbs.a') |
---|
20 | if os.path.exists(dummy): |
---|
21 | PBS_LIB_DIR=dir |
---|
22 | break |
---|
23 | |
---|
24 | if not PBS_LIB_DIR: |
---|
25 | print 'Please specify where the PBS libraries are!!' |
---|
26 | print 'edit setup.py and fill in the PBS_LIB_DIR variable' |
---|
27 | sys.exit(1) |
---|
28 | |
---|
29 | # Test if we have all the libs: |
---|
30 | # |
---|
31 | for lib in LIBS: |
---|
32 | library = 'lib%s.a' %(lib) |
---|
33 | dummy = os.path.join(PBS_LIB_DIR, library) |
---|
34 | if not os.path.exists(dummy): |
---|
35 | print 'You need to install "%s" in %s' %(library, PBS_LIB_DIR) |
---|
36 | sys.exit(1) |
---|
37 | |
---|
38 | setup ( name = 'pbs_python', |
---|
39 | version = '2.8.0', |
---|
40 | description = 'openpbs/torque python interface', |
---|
41 | author = 'Bas van der Vlies', |
---|
42 | author_email = 'basv@sara.nl', |
---|
43 | url = 'http://www.sara.nl/index_eng.html', |
---|
44 | |
---|
45 | extra_path = 'pbs', |
---|
46 | package_dir = { '' : 'src' }, |
---|
47 | py_modules = [ 'pbs', 'PBSQuery' ], |
---|
48 | |
---|
49 | ext_modules = [ |
---|
50 | Extension( '_pbs', ['src/pbs_wrap.c'], |
---|
51 | library_dirs = [ PBS_LIB_DIR ], |
---|
52 | libraries = LIBS |
---|
53 | ) |
---|
54 | ] |
---|
55 | ) |
---|
56 | |
---|