Changeset 2179 for trunk/SConstruct


Ignore:
Timestamp:
05/24/11 12:03:43 (14 years ago)
Author:
Malte Marquarding
Message:

derive moduledir from prefix by default. Also added some more debian packaging details

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SConstruct

    r2166 r2179  
    2222    return ""
    2323
    24 moduledir = distutils.sysconfig.get_python_lib()
    25 
    26 if sys.platform.startswith('linux') and platform.architecture()[0] == '64bit':
    27     # hack to install into /usr/lib64 if scons is in the 32bit /usr/lib/
    28     if moduledir.startswith("/usr/lib/"):
    29         moduledir = moduledir.replace("lib", "lib64")
     24def get_moduledir(prefix="/usr/local"):
     25    moduledir = distutils.sysconfig.get_python_lib(1,0, prefix)
     26    if sys.platform.startswith('linux') \
     27            and platform.architecture()[0] == '64bit' \
     28            and platform.dist()[0].lower() not in ['debian', 'ubuntu']:
     29        # hack to install into /usr/lib64 if scons is in the 32bit /usr/lib/
     30        if moduledir.startswith("/usr"):
     31           moduledir = moduledir.replace("lib", "lib64")
     32    return moduledir
    3033
    3134EnsureSConsVersion(1,0,0)
     
    3841                "The root installation path",
    3942                           distutils.sysconfig.PREFIX),
    40                 PathVariable("moduledir",
    41                             "The python module path (site-packages))",
    42                             moduledir),
     43                ("moduledir",
     44                 "The python module path (site-packages))",
     45                 None),
    4346                PathVariable("casacoreroot", "The location of casacore",
    4447                             "/usr/local"),
     
    186189    if conf.env["alma"]:
    187190        conf.env.Append(CPPFLAGS=['-DUSE_ALMA'])
     191    if not conf.env.get("moduledir"):
     192        mdir = get_moduledir(conf.env.get("prefix"))
     193        if env["PLATFORM"] == "darwin":
     194            mdir = distutils.sysconfig.get_python_lib(1,0)           
     195        conf.env["moduledir"] =  mdir
    188196    env = conf.Finish()
    189197
    190 env["version"] = "3.1.0"
     198env["version"] = "3.1.x"
    191199
    192200if env['mode'] == 'release':
     
    195203    env.Append(CCFLAGS=["-O2"])
    196204else:
    197     env.Append(CCFLAGS=["-g", "-Wall"])
     205    env.Append(CCFLAGS=["-g", "-W", "-Wall"])
    198206
    199207# Export for SConscript files
     
    203211env.SConscript("external-alma/SConscript")
    204212# build library
    205 so = env.SConscript("src/SConscript", build_dir="build", duplicate=0)
     213so = env.SConscript("src/SConscript", variant_dir="build", duplicate=0)
    206214# test module import, to see if there are unresolved symbols
    207215def test_module(target,source,env):
     
    243251# make binary distribution
    244252if len(env["makedist"]):
    245     env["stagedir"] = "asap-%s-%s" % (env["version"], env["makedist"])
     253    env["stagedir"] = "asap-%s" % (env["version"])
    246254    env.Command('Staging distribution for archive in %s' % env["stagedir"],
    247255                '', env.MessageAction)
    248     st0 = env.QInstall("$stagedir/asap", [so,  env.SGlob("python/*.py")] )
     256    env.QInstall("$stagedir/asap", [so,  env.SGlob("python/*.py")] )
    249257    env.QInstall("$stagedir/bin", ["bin/asap", "bin/asap_update_data"])
    250258    env.QInstall("$stagedir", ["packaging/setup.py"])
     259    env.QInstall("$stagedir/debian", env.SGlob("packaging/debian/*") )
    251260    env.QInstall("$stagedir/asap/data", "share/ipythonrc-asap")
    252261    env.QInstall("$stagedir/asap/data", "share/ipy_user_conf.py")
     
    261270        env.Command("No data tables available. Use 'asap_update_data' after install",
    262271                    '', env.MessageAction)
    263     arch = env.Archiver(os.path.join("dist",env["stagedir"]),
     272    arch = env.Archiver(os.path.join("dist",
     273                                     env["stagedir"]+"_"+env["makedist"]),
    264274                        env["stagedir"])
    265     env.AddPostAction(arch, Delete("$stagedir"))
     275#    env.AddPostAction(arch, Delete("$stagedir"))
    266276
    267277if env["apps"]:
Note: See TracChangeset for help on using the changeset viewer.