Changeset 1195


Ignore:
Timestamp:
08/29/06 09:47:08 (18 years ago)
Author:
mar637
Message:

added module test action. fixed makedist target including install script.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SConstruct

    r1187 r1195  
    2626                           ["release","debug"], ignorecase=1),
    2727                ("makedist",
    28                  "Make a binary distribution giving a suffix, e.g. sarge or fc5",
     28                 "Make a binary archive giving a suffix, e.g. sarge or fc5",
    2929                 "")
    3030                )
     
    9393# build library
    9494so = env.SConscript("src/SConscript", build_dir="build", duplicate=0)
     95# test module import, to see if there are unresolved symbols
     96def test_module(target,source,env):
     97    pth = str(target[0])
     98    mod = os.path.splitext(pth)[0]
     99    sys.path.insert(2, os.path.split(mod)[0])
     100    __import__(os.path.split(mod)[1])
     101    print "ok"
     102    return 0
     103def test_str(target, source, env):
     104    return "Testing module..."
     105
     106taction = Action(test_module, test_str)
     107env.AddPostAction(so, taction)
    95108
    96109# install targets
     
    108121    rootdir = "/nfs/aips++/data"
    109122elif os.path.exists("data"):
    110     rootdir = "data"
     123    rootdir = "./data"
    111124if rootdir is not None:
    112125    ofiles, ifiles = env.WalkDirTree(outdir, rootdir, sources)
     
    119132    env.Command('Staging distribution for archive in %s' % env["stagedir"],
    120133                '', env.MessageAction)
    121     env.QInstall("$stagedir/asap", [so,  env.SGlob("python/*.py")] )
     134    st0 = env.QInstall("$stagedir/asap", [so,  env.SGlob("python/*.py")] )
    122135    env.QInstall("$stagedir/bin", ["bin/asap", "bin/asap_update_data"])
    123     env.QInstall("$stagedir/install", ["bin/install"])
    124     env.QInstall("$stagedir/data", "share/ipythonrc-asap")
    125     if os.path.exists("/nfs/aips++/data"):
    126         rootdir = "/nfs/aips++/data"
    127         sources = ['ephemerides','geodetic']
     136    env.QInstall("$stagedir", ["bin/install"])
     137    env.QInstall("$stagedir/asap/data", "share/ipythonrc-asap")
     138    if rootdir is not None:
     139        env.Command("Using data tables in %s" % rootdir,
     140                    '', env.MessageAction)       
    128141        outdir =  os.path.join(env["stagedir"],'asap','data')
    129142        ofiles, ifiles = env.WalkDirTree(outdir, rootdir, sources)
    130143        env.QInstallAs(ofiles, ifiles)
     144    else:
     145        env.Command("No data tables available. Use 'asap_update_data' after install",
     146                    '', env.MessageAction)       
    131147    arch = env.Archiver(os.path.join("dist",env["stagedir"]),
    132148                        env["stagedir"])
    133149    env.AddPostAction(arch, Delete("$stagedir"))
    134    
     150
     151if env.GetOption("clean"):
     152    Execute(Delete(".sconf_temp"))
  • trunk/bin/install

    r1181 r1195  
    1414    """
    1515
    16 def get_libs(lddcommand='/usr/bin/ldd', lib='_asap.so'):
     16def get_libs(lib='_asap.so'):
     17    lddcommand = "/usr/bin/ldd"
     18    lddopts = ""
     19    if (sys.platform == "darwin"):
     20        lddcommand = "otool"
     21        lddopts = "-L"
    1722    if not os.path.isfile(lddcommand):
    18         raise IOError("ldd not available")
     23        raise IOError("ldd/otool is not available")
    1924    if not os.path.exists(lib):
    2025        raise IOError("File %s not found" %lib)
    21     p = os.popen(lddcommand+" "+lib)
     26    p = os.popen(lddcommand+" "+lddopts+" "+lib)
    2227    resolved = []
    2328    unresolved = []
     
    115120    shutil.copy2("bin/asap", bindir)
    116121    shutil.copy2("bin/asap_update_data", bindir)
    117     shutil.copytree("data", os.path.join(moddir,"data"))
     122    if not os.path.exists("asap/data/ephemerides"):
     123        print "Warning - no data directory present"
     124        print "Please run asap_update_data after the installation is completed."
    118125    print "Installation completed."
    119126except OSError, oe:
Note: See TracChangeset for help on using the changeset viewer.