source: trunk/setup.py.in @ 236

Last change on this file since 236 was 236, checked in by bas, 14 years ago

Added an new variable:

  • pbs_library_compile_line
  • pbs_library_dir (pbs-config --libdir)
File size: 1.4 KB
Line 
1#!/usr/bin/env python
2#
3# $Id: setup.py 434 2005-11-04 15:02:07Z bas $
4#
5# set ts=4
6#
7
8import sys
9import os
10
11from distutils.core import setup, Extension
12
13# Strip off the -L it is also added by the python setup tools
14#
15PBS_LIB_COMPILE_LINE='@pbs_library_compile_line@'
16PBS_LIB_DIR='@pbs_library_dir@'
17
18if not PBS_LIB_DIR:
19        print 'Please specify where the PBS libraries are!!'
20        print 'edit setup.py and fill in the PBS_LIB_DIR variable'
21        sys.exit(1)
22
23LIBS = ['torque']
24
25### Make symlinks to right torque version
26#
27VERSION = "@pbs_version@"
28tmp = VERSION.split('.')
29major_version = '.'.join( tmp[0:2] )
30
31
32os.chdir('src')
33
34## Always unlink previous links
35#
36try:
37        os.unlink('pbs.py')
38        os.unlink('pbs_wrap.c')
39except OSError:
40        pass
41
42if major_version in [ '2.4' ]:
43        os.symlink('pbs_wrap_2.4.c', 'pbs_wrap.c')
44        os.symlink('pbs_2.4.py', 'pbs.py')
45        TORQUE_VERSION='TORQUE_2_4'
46else:
47        os.symlink('pbs_wrap_2.1.c', 'pbs_wrap.c')
48        os.symlink('pbs_2.1.py', 'pbs.py')
49        TORQUE_VERSION='TORQUE_OLD'
50
51os.chdir('..')
52
53setup ( name = 'pbs_python',
54        version = '4.0.0',
55        description = 'openpbs/torque python interface',
56        author = 'Bas van der Vlies',
57        author_email = 'basv@sara.nl',
58        url = 'http://subtrac.sara.nl/oss/pbs_python',
59
60
61        extra_path = 'pbs',
62                package_dir = { '' : 'src' }, 
63                py_modules = [ 'pbs', 'PBSQuery' ], 
64
65        ext_modules = [ 
66                Extension( '_pbs', ['src/pbs_wrap.c'],
67                library_dirs = [ PBS_LIB_DIR ],
68                define_macros =  [ (TORQUE_VERSION, None) ],
69                libraries = LIBS,
70                ) 
71        ]
72)
Note: See TracBrowser for help on using the repository browser.