package_sbs.sh 2.3 KB

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