Changeset 1181 for trunk/bin


Ignore:
Timestamp:
08/24/06 11:45:27 (18 years ago)
Author:
mar637
Message:

finishing touches to making scons makedist=xyz work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/install

    r1173 r1181  
    1313              [-h] this message
    1414    """
     15
     16def get_libs(lddcommand='/usr/bin/ldd', lib='_asap.so'):
     17    if not os.path.isfile(lddcommand):
     18        raise IOError("ldd not available")
     19    if not os.path.exists(lib):
     20        raise IOError("File %s not found" %lib)
     21    p = os.popen(lddcommand+" "+lib)
     22    resolved = []
     23    unresolved = []
     24    for l in p.readlines():
     25        lsp = l.split()
     26        if lsp[2] == "not":
     27            unresolved.append(lsp[0])
     28        else:
     29            resolved.append(lsp[2])
     30    return resolved, unresolved
    1531
    1632try:
     
    4763        moduledir = v
    4864
    49 print 'Looking for dependent modules...'
     65print "Looking fo all required libraries..."
     66try:
     67    libs, missing = get_libs(lib="asap/_asap.so")
     68    if len(missing):
     69        print " The following libraries are missing:"
     70        print missing
     71        sys.exit(1)
     72    else:
     73        print "   All required libraries are present."
     74except IOError,msg:
     75    print msg+" Skipping test."
     76
     77print 'Looking for dependent python modules...'
    5078try:
    5179    import matplotlib
     
    75103    sys.exit(1)
    76104
    77 print "All required modules were found."
     105print "   All required modules were found."
    78106moddir = os.path.join(moduledir, "asap")
    79107bindir =  os.path.join(execprefix, "bin")
     
    84112    print "Installing asap module in %s" % moddir
    85113    shutil.copytree("asap", moddir)
    86     print "Installing asap startup script in %s" % bindir
     114    print "Installing asap  scripts in %s" % bindir
    87115    shutil.copy2("bin/asap", bindir)
     116    shutil.copy2("bin/asap_update_data", bindir)
    88117    shutil.copytree("data", os.path.join(moddir,"data"))
    89118    print "Installation completed."
Note: See TracChangeset for help on using the changeset viewer.