source: trunk/setup.py.in @ 230

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

Fixed a bug in setting the right compiler path for the library, closes #19

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