source: trunk/setup.py.in @ 237

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

New version 4.1.0:

  • see CHANGES file, closes #20
File size: 1.5 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('.')
29
30major_version = int(tmp[0])
31minor_version = int(tmp[1])
32build_version = int(tmp[2])
33
34os.chdir('src')
35
36## Always unlink previous links
37#
38try:
39        os.unlink('pbs.py')
40        os.unlink('pbs_wrap.c')
41except OSError:
42        pass
43
44if major_version  >= 2 and minor_version >= 4 and build_version >= 7:
45        os.symlink('pbs_wrap_2.4.c', 'pbs_wrap.c')
46        os.symlink('pbs_2.4.py', 'pbs.py')
47        TORQUE_VERSION='TORQUE_2_4'
48else:
49        os.symlink('pbs_wrap_2.1.c', 'pbs_wrap.c')
50        os.symlink('pbs_2.1.py', 'pbs.py')
51        TORQUE_VERSION='TORQUE_OLD'
52
53os.chdir('..')
54
55setup ( name = 'pbs_python',
56        version = '4.0.0',
57        description = 'openpbs/torque python interface',
58        author = 'Bas van der Vlies',
59        author_email = 'basv@sara.nl',
60        url = 'http://subtrac.sara.nl/oss/pbs_python',
61
62
63        extra_path = 'pbs',
64                package_dir = { '' : 'src' }, 
65                py_modules = [ 'pbs', 'PBSQuery' ], 
66
67        ext_modules = [ 
68                Extension( '_pbs', ['src/pbs_wrap.c'],
69                library_dirs = [ PBS_LIB_DIR ],
70                define_macros =  [ (TORQUE_VERSION, None) ],
71                libraries = LIBS,
72                ) 
73        ]
74)
Note: See TracBrowser for help on using the repository browser.