buildframework/helium/hlm
branchwip
changeset 380 db59fc762214
parent 217 0f5e3a7fb6af
child 587 85df38eb4012
equal deleted inserted replaced
369:1248e8f6a72d 380:db59fc762214
       
     1 #!/bin/bash
       
     2 
       
     3 #
       
     4 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     5 # All rights reserved.
       
     6 # This component and the accompanying materials are made available
       
     7 # under the terms of the License "Eclipse Public License v1.0"
       
     8 # which accompanies this distribution, and is available
       
     9 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    10 #
       
    11 # Initial Contributors:
       
    12 # Nokia Corporation - initial contribution.
       
    13 #
       
    14 # Contributors:
       
    15 #
       
    16 # Description: 
       
    17 #
       
    18 if [ ! $HELIUM_HOME ] ; then
       
    19     export HELIUM_HOME=$(dirname $(readlink /proc/$$/fd/255))
       
    20 fi
       
    21 
       
    22 # For nokia specific enviroment configurations.
       
    23 if [ -f $HELIUM_HOME/extensions/nokia/env.sh ] ; then
       
    24     . $HELIUM_HOME/extensions/nokia/env.sh
       
    25 fi
       
    26 
       
    27 export LANG="en_US.UTF-8"
       
    28 export ANT_ARGS="-lib $HELIUM_HOME/extensions/nokia/external/antlibs -lib $HELIUM_HOME/extensions/nokia/external/helium-nokia-antlib/bin -lib $HELIUM_HOME/external/helium-antlib/bin -lib $HELIUM_HOME/external/antlibs -lib $HELIUM_HOME/tools/common/java/lib -logger com.nokia.ant.HeliumLogger -Dant.executor.class=com.nokia.helium.core.ant.HeliumExecutor -listener com.nokia.helium.diamonds.ant.HeliumListener -listener com.nokia.helium.logger.ant.listener.StatusAndLogListener -listener com.nokia.helium.core.ant.listener.TargetTimesLogGeneratorListener"
       
    29 
       
    30 PYTHON_VERSION=`python -c "import sys; print sys.version[:3]"`
       
    31 PYTHON_VERSION2=$PYTHON_VERSION$HOSTTYPE
       
    32 PYTHONLIB=$HELIUM_HOME/external/python/lib/linux/$PYTHON_VERSION2
       
    33 
       
    34 TEMP_PYTHONPATH="$PYTHONLIB:$HELIUM_HOME/external/python/lib/common:$HELIUM_HOME/external/helium-antlib/python/pythoncore/lib:$HELIUM_HOME/tools/common/python/scripts:$HELIUM_HOME/extensions/nokia/external/python/lib/2.5:$HELIUM_HOME/extensions/nokia/tools/common/python/lib:$HELIUM_HOME/extensions/nokia/external/helium-nokia-antlib/python:$HELIUM_HOME/extensions/nokia/external/helium-nokia-antlib/python/pythonnokia/lib"
       
    35 
       
    36 TEMP_PERL5LIB="$HELIUM_HOME/tools/common/packages"
       
    37 if [ ! $PERL5LIB ] ; then
       
    38     PERL5LIB=$TEMP_PERL5LIB
       
    39 else
       
    40     PERL5LIB="$PERL5LIB:$TEMP_PERL5LIB"
       
    41 fi
       
    42 
       
    43 
       
    44 if [ $HOST ]; then
       
    45     export COMPUTERNAME=$HOST
       
    46 elif [ $HOSTNAME ]; then
       
    47     export COMPUTERNAME=$HOSTNAME
       
    48 else
       
    49     export COMPUTERNAME=$(hostname)
       
    50 fi
       
    51 
       
    52 CWD=`pwd`
       
    53 
       
    54 if [ ! -e "$PYTHONLIB" ] ; then
       
    55     mkdir $PYTHONLIB
       
    56     cp $HELIUM_HOME/external/python/lib/common/site.py $PYTHONLIB
       
    57 fi
       
    58 
       
    59 export PYTHONPATH=$HELIUM_HOME/external/python/lib/common/setuptools-0.6c5-py2.5.egg
       
    60 
       
    61 if [ ! -e "$PYTHONLIB/4Suite_XML-1.0.2.egg" ] ; then
       
    62     cp $HELIUM_HOME/external/python/lib/linux/easy-install.pth $PYTHONLIB
       
    63     tar xvfz $HELIUM_HOME/external/python/lib/linux/4Suite-XML-1.0.2.tar.gz -C $PYTHONLIB > /dev/null
       
    64     cd $PYTHONLIB/4Suite-XML-1.0.2
       
    65     python setup.py bdist_egg > /dev/null
       
    66     mv dist/*.egg $PYTHONLIB/4Suite_XML-1.0.2.egg
       
    67 fi
       
    68 
       
    69 if [ ! -e "$PYTHONLIB/lxml-1.3.6.egg" ] ; then
       
    70     cp $HELIUM_HOME/external/python/lib/linux/easy-install.pth $PYTHONLIB
       
    71     tar xvfz $HELIUM_HOME/external/python/lib/linux/lxml-1.3.6.tgz -C $PYTHONLIB > /dev/null
       
    72     cd $PYTHONLIB/lxml-1.3.6
       
    73     python setup.py bdist_egg > /dev/null
       
    74     mv dist/*.egg $PYTHONLIB/lxml-1.3.6.egg
       
    75 fi
       
    76 
       
    77 if [ ! -e "$PYTHONLIB/PyXML-0.8.4.egg" ] ; then
       
    78     cp $HELIUM_HOME/external/python/lib/linux/easy-install.pth $PYTHONLIB
       
    79     tar xvfz $HELIUM_HOME/external/python/lib/linux/PyXML-0.8.4.tar.gz -C $PYTHONLIB > /dev/null
       
    80     cd $PYTHONLIB/PyXML-0.8.4
       
    81     python setup.py bdist > /dev/null
       
    82     mv build/lib* $PYTHONLIB/PyXML-0.8.4.egg
       
    83 fi
       
    84 
       
    85 cd $CWD
       
    86 
       
    87 if [ ! $PYTHONPATH ] ; then
       
    88     export PYTHONPATH=$TEMP_PYTHONPATH
       
    89 else
       
    90     export PYTHONPATH="$PYTHONPATH:$TEMP_PYTHONPATH"
       
    91 fi
       
    92 
       
    93 TEMP_JYTHONPATH="$HELIUM_HOME/external/python/lib/2.5/jython-2.5-py2.5.egg:$PYTHONPATH"
       
    94 
       
    95 if [ ! $JYTHONPATH ] ; then
       
    96     export JYTHONPATH=$TEMP_JYTHONPATH
       
    97 else
       
    98     export JYTHONPATH="$JYTHONPATH:$TEMP_JYTHONPATH"
       
    99 fi
       
   100 
       
   101 export USERNAME=$USER
       
   102 export SYMSEE_VERSION="not_in_use"
       
   103 export PID=$$
       
   104 export TEMP="/tmp/$USER"
       
   105 if [ $JOB_ID ] ; then
       
   106     export HELIUM_CACHE_DIR="$TEMP/helium/$USER/$JOB_ID"
       
   107 else
       
   108     export HELIUM_CACHE_DIR="$TEMP/helium/$USER"
       
   109 fi
       
   110 export ANT_OPTS="-Dlog4j.configuration=com/nokia/log4j.xml -Dlog4j.cache.dir=$HELIUM_CACHE_DIR"
       
   111 export PYTHON_CACHEDIR="$HELIUM_CACHE_DIR/python"
       
   112 
       
   113 mkdir -p $HELIUM_CACHE_DIR
       
   114 
       
   115 if [ ! $EPOCROOT ]; then
       
   116     export EPOCROOT="/"
       
   117 fi 
       
   118 
       
   119 if [ ! -f "$HELIUM_HOME/external/helium-antlib/bin/helium-checktools.jar" ] ; then
       
   120     echo helium-checktools.jar not found
       
   121 else 
       
   122     java -cp "$HELIUM_HOME/external/helium-antlib/bin/helium-checktools.jar" com.nokia.helium.checktools.HeliumToolsCheckerMain -config "$HELIUM_HOME/config/helium.basic.tools.config"
       
   123 
       
   124     if [ $? -eq 0 ] ; then
       
   125       exec ant -Dpython.cachedir=$PYTHON_CACHEDIR -Dhelium.dir=$HELIUM_HOME -Dpython.path=$PYTHONPATH -Dcache.dir=$HELIUM_CACHE_DIR $*
       
   126     else
       
   127         echo Build aborted with error
       
   128     fi    
       
   129 fi