[hg] galaxy 3461: Use the old method for fixing pbs_python's ver...
details: http://www.bx.psu.edu/hg/galaxy/rev/cb10a08016eb changeset: 3461:cb10a08016eb user: Nate Coraor <nate@bx.psu.edu> date: Tue Mar 02 11:37:55 2010 -0500 description: Use the old method for fixing pbs_python's version diffstat: scripts/scramble/patches/pbs_python/setup.py | 64 ++++++++++++++++++++++++++++ scripts/scramble/scripts/pbs_python.py | 7 +- 2 files changed, 68 insertions(+), 3 deletions(-) diffs (102 lines): diff -r 182a7947e63a -r cb10a08016eb scripts/scramble/patches/pbs_python/setup.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/scramble/patches/pbs_python/setup.py Tue Mar 02 11:37:55 2010 -0500 @@ -0,0 +1,64 @@ +#!/usr/bin/env python +# +# $Id: setup.py 434 2005-11-04 15:02:07Z bas $ +# +# set ts=4 +# + +import sys +import os + +from distutils.core import setup, Extension + +# Try some usefule defaults if not set +# +PBS_LIB_DIR='/opt/local/lib' +NEW_BUILD_SYSTEM=1 + +if not PBS_LIB_DIR: + for dir in ['/usr/lib', '/usr/local/lib', '/opt/pbs/usr/lib', '/usr/lib/torque', '/opt/pbs/lib', '/opt/torque/lib' ]: + dummy_new = os.path.join(dir, 'libtorque.so') + dummy_old = os.path.join(dir, 'libpbs.a') + if os.path.exists(dummy_new): + PBS_LIB_DIR=dir + break + elif os.path.exists(dummy_old): + PBS_LIB_DIR=dir + NEW_BUILD_SYSTEM=0 + break + +if not PBS_LIB_DIR: + print 'Please specify where the PBS libraries are!!' + print 'edit setup.py and fill in the PBS_LIB_DIR variable' + sys.exit(1) + +# Test if we have all the libs: +# +if NEW_BUILD_SYSTEM: + LIBS = ['torque'] +else: + LIBS = ['log', 'net', 'pbs'] + for lib in LIBS: + library = 'lib%s.a' %(lib) + dummy = os.path.join(PBS_LIB_DIR, library) + if not os.path.exists(dummy): + print 'You need to install "%s" in %s' %(library, PBS_LIB_DIR) + sys.exit(1) + +setup ( name = 'pbs_python', + version = '2.9.4', + description = 'openpbs/torque python interface', + author = 'Bas van der Vlies', + author_email = 'basv@sara.nl', + url = 'http://www.sara.nl/index_eng.html', + + extra_path = 'pbs', + package_dir = { '' : 'src' }, + py_modules = [ 'pbs', 'PBSQuery' ], + + ext_modules = [ + Extension( '_pbs', ['src/pbs_wrap.c'], + library_dirs = [ PBS_LIB_DIR ], + libraries = LIBS) + ] +) diff -r 182a7947e63a -r cb10a08016eb scripts/scramble/scripts/pbs_python.py --- a/scripts/scramble/scripts/pbs_python.py Tue Mar 02 11:17:05 2010 -0500 +++ b/scripts/scramble/scripts/pbs_python.py Tue Mar 02 11:37:55 2010 -0500 @@ -1,4 +1,4 @@ -import os, sys +import os, sys, shutil if "LIBTORQUE_DIR" not in os.environ: print "main(): Please set LIBTORQUE_DIR to the path of the" @@ -13,13 +13,15 @@ sys.path.append( os.path.join( '..', '..', '..', 'lib' ) ) from scramble_lib import * -ver = get_ver() # get the version tag = get_tag() # get the tag clean() # clean up any existing stuff (could happen if you run scramble.py by hand) # the build process doesn't set an rpath for libtorque os.environ['LD_RUN_PATH'] = os.environ['LIBTORQUE_DIR'] +# patch setup.py +shutil.copy( os.path.join( patches, 'pbs_python', 'setup.py' ), 'setup.py' ) + # run the config script run( 'sh configure --with-pbsdir=%s' % os.environ['LIBTORQUE_DIR'], os.getcwd(), 'Running pbs_python configure script' ) @@ -27,7 +29,6 @@ me = sys.argv[0] sys.argv = [ me ] sys.argv.append( "egg_info" ) -sys.argv.append( "--version=%s" % ver ) if tag is not None: sys.argv.append( "--tag-build=%s" %tag ) # svn revision (if any) is handled directly in tag-build
participants (1)
-
Greg Von Kuster