source: tags/4.0.0/setup.py.in @ 329

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

setup.py.in:

  • fixed an error. Must define that we using 2.4 version
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# Try some usefule defaults if not set
14#
15PBS_LIB_DIR='@pbs_library_dir@'
16
17if not PBS_LIB_DIR:
18        print 'Please specify where the PBS libraries are!!'
19        print 'edit setup.py and fill in the PBS_LIB_DIR variable'
20        sys.exit(1)
21
22# Test if we have all the libs:
23#
24LIBS = ['torque']
25
26### Make symlinks to right torque version
27#
28VERSION = "@pbs_version@"
29tmp = VERSION.split('.')
30major_version = '.'.join( tmp[0:2] )
31
32
33os.chdir('src')
34
35## Always unlink previous links
36#
37try:
38        os.unlink('pbs.py')
39        os.unlink('pbs_wrap.c')
40except OSError:
41        pass
42
43if major_version in [ '2.4' ]:
44        os.symlink('pbs_wrap_2.4.c', 'pbs_wrap.c')
45        os.symlink('pbs_2.4.py', 'pbs.py')
46        TORQUE_VERSION='TORQUE_2_4'
47else:
48        os.symlink('pbs_wrap_2.1.c', 'pbs_wrap.c')
49        os.symlink('pbs_2.1.py', 'pbs.py')
50        TORQUE_VERSION='TORQUE_OLD'
51
52os.chdir('..')
53
54setup ( name = 'pbs_python',
55        version = '4.0.0',
56        description = 'openpbs/torque python interface',
57        author = 'Bas van der Vlies',
58        author_email = 'basv@sara.nl',
59        url = 'http://subtrac.sara.nl/oss/pbs_python',
60
61
62        extra_path = 'pbs',
63                package_dir = { '' : 'src' }, 
64                py_modules = [ 'pbs', 'PBSQuery' ], 
65
66        ext_modules = [ 
67                Extension( '_pbs', ['src/pbs_wrap.c'],
68                library_dirs = [ PBS_LIB_DIR ],
69                define_macros =  [ (TORQUE_VERSION, None) ],
70                libraries = LIBS) 
71        ]
72)
Note: See TracBrowser for help on using the repository browser.