source: tags/2.8.2/setup.py.in

Last change on this file was 97, checked in by bas, 18 years ago

distro/setup.py.in:

  • Clean up some code and more documentation
File size: 1.3 KB
Line 
1#!/usr/bin/env python
2#
3# $Id: setup.py 434 2005-11-04 15:02:07Z bas $
4
5import sys
6import os
7
8from distutils.core import setup, Extension
9
10# Libs required by this package
11#
12LIBS = ['log', 'net', 'pbs'] 
13
14# Try some usefule defaults if not set
15#
16PBS_LIB_DIR='@pbspath@'
17if 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
24if 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#
31for 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
38setup ( 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
Note: See TracBrowser for help on using the repository browser.