sbsv2/raptor/util/install-linux/package_sbs.sh
changeset 0 044383f39525
child 3 e1eecf4d390d
child 590 360bd6b35136
equal deleted inserted replaced
-1:000000000000 0:044383f39525
       
     1 #!/bin/bash
       
     2 
       
     3 # Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 # All rights reserved.
       
     5 # This component and the accompanying materials are made available
       
     6 # under the terms of the License "Eclipse Public License v1.0"
       
     7 # which accompanies this distribution, and is available
       
     8 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     9 #
       
    10 # Initial Contributors:
       
    11 # Nokia Corporation - initial contribution.
       
    12 #
       
    13 # Contributors:
       
    14 #
       
    15 # Description:
       
    16 # Package into a linux .run file
       
    17 #
       
    18 #
       
    19 
       
    20 getopts 's' packopt
       
    21 
       
    22 
       
    23 export packtype=binary
       
    24 if [[ "$packopt" == "s" ]]; then
       
    25 packtype=source
       
    26 fi
       
    27 
       
    28 echo "Raptor packager for Linux"
       
    29 export PACKAGER_HOME="$PWD"
       
    30 
       
    31 echo "SBS_HOME is $SBS_HOME - this is the version that will be packaged."
       
    32 
       
    33 export FULLVERSION=`$SBS_HOME/bin/sbs -v` # this also generates all the pyc files
       
    34 export VERSION=`echo "$FULLVERSION" | sed 's#.*sbs version *\([^ ]*\).*#\1#'`
       
    35 
       
    36 if [ -z "$VERSION" ]; then
       
    37 	echo "Version could not be automatically determined - check that SBS_HOME is set correctly" 1>&2
       
    38 	exit 1
       
    39 else
       
    40 	echo "Packaging version $FULLVERSION"
       
    41 fi
       
    42 
       
    43 HOSTPLATFORM_DIR=$($SBS_HOME/bin/gethost.sh -d)
       
    44 
       
    45 if [[ "$packtype" == "source" ]]; then
       
    46 HOSTPLATFORM_DIR="linux_source"
       
    47 fi
       
    48 
       
    49 
       
    50 export DIRNAME=sbs-$VERSION-$HOSTPLATFORM_DIR
       
    51 export TMPSBS=/tmp/$DIRNAME
       
    52 if [ -d  "$TMPSBS" ]; then
       
    53 	rm -rf "$TMPSBS"
       
    54 fi
       
    55 set -x
       
    56 mkdir -p "$TMPSBS" &&
       
    57 (
       
    58 BINARIES="$HOSTPLATFORM_DIR"
       
    59 if [[ "$packtype" == "source" ]]; then
       
    60 BINARIES=""
       
    61 fi
       
    62 
       
    63 
       
    64    echo init.xml LICENSE.txt RELEASE-NOTES.txt; cd $SBS_HOME && find bin lib $BINARIES python test schema util |
       
    65 	grep -v "$TMPSBS"'/python/\.py$' |
       
    66 	grep -v 'flm/test'  |
       
    67 	grep -v 'util/build'  | 
       
    68 	grep -v 'test/epocroot/epoc32/build'  | 
       
    69 	grep -v '~$'  |  cpio -o --quiet  2>/dev/null 
       
    70 ) | ( cd "$TMPSBS" && cpio -i --make-directories  --quiet >/dev/null 2>&1)
       
    71 
       
    72 # store the version number
       
    73 echo "FULLVERSION=\"$FULLVERSION\"" > $TMPSBS/.version
       
    74 echo "VERSION=\"$VERSION\"" >> $TMPSBS/.version
       
    75 
       
    76 if [[ "$packtype" == "binary" ]]; then
       
    77 chmod a+x $TMPSBS/bin/* $TMPSBS/util/$HOSTPLATFORM_DIR/bin/* $TMPSBS/util/$HOSTPLATFORM_DIR/python262/bin/* 
       
    78 chmod a+x $TMPSBS/util/pvm3/bin/LINUX/*
       
    79 chmod a+x $TMPSBS/util/$HOSTPLATFORM_DIR/cw_build470msl19/release/Symbian_Tools/Command_Line_Tools/*
       
    80 fi
       
    81 
       
    82 cd $TMPSBS/.. && bash "$PACKAGER_HOME"/makeself.sh $DIRNAME $DIRNAME.run "$FULLVERSION\n" ./bin/install_raptor.sh
       
    83