--- setup.py 2010-04-12 09:26:52.000000000 -0400 +++ setup.py 2010-04-13 09:11:53.813204216 -0400 @@ -37,7 +37,7 @@ ------------------------------------------------------------------------------- """ -import os.path +import os import sys # we check for the special 'uninstall' option, other options are handled by # the distutils stuff. @@ -53,13 +53,12 @@ else: UNINSTALL = False print __doc__ - raw_input("Hit any key to continue\n") # Change this if you want to install all the non-python stuff in a different # location. -PREFIX = '/usr/local' -#PREFIX = '/tmp' +#PREFIX = '/tmp' +PREFIX = os.environ.get('PREFIX', '/usr/local') # Don't change anything below this line unless you fully understand why you want # to make changes. @@ -277,10 +276,6 @@ pdest = os.path.join(get_python_lib(), 'childsplay_sp') print "Looking for previous childsplay python install in %s" % pdest modulepaths['PYTHONCPDIR'] = pdest -if os.path.exists(pdest): - print "Found old childsplay_sp python package in %s, removing it..." % pdest, - shutil.rmtree(pdest) - print " done" #---------- copy starters dest = os.path.join(PREFIX, 'bin') @@ -328,13 +323,13 @@ if ARE_WE_WINDOWS: src = os.path.join(os.getcwd(), 'windows', 'SPBasePaths.py') dest = os.getcwd() - shutil.copy(src, dest) + shutil.copy(src, PREFIX[:-4] + pdest) else: print "Writing the SPBasePaths module...", filelines = ["# AUTO-GENERATED MODULE, DON'T EDIT", \ "# This module holds all the paths needed for childsplay_sp.\n"] for k, v in modulepaths.items(): - filelines.append("%s = '%s'" % (k, v)) + filelines.append("%s = '%s'" % (k, v.replace(PREFIX[:-4], ''))) f = open(module, 'w') f.write("\n".join(filelines)) f.close()