package_sbs.sh 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #!/bin/bash
  2. # Copyright (c) 2006-2011 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. export SBS_HOME=$(cd "${0%/*}/../../" && echo $PWD)
  26. echo "SBS_HOME is $SBS_HOME - this is the version that will be packaged."
  27. export FULLVERSION=`$SBS_HOME/bin/sbs -v` # this also generates all the pyc files
  28. export VERSION=`echo "$FULLVERSION" | sed 's#.*sbs version *\([^ ]*\).*#\1#'`
  29. if [ -z "$VERSION" ]; then
  30. echo "Version could not be automatically determined - check that SBS_HOME is set correctly" 1>&2
  31. exit 1
  32. else
  33. echo "Packaging version $FULLVERSION"
  34. fi
  35. HOSTPLATFORM_DIR=$($SBS_HOME/bin/gethost.sh -d)
  36. if [[ "$packtype" == "source" ]]; then
  37. HOSTPLATFORM_DIR="linux_source"
  38. fi
  39. export DIRNAME=sbs-$VERSION-$HOSTPLATFORM_DIR
  40. export TMPSBS=/tmp/$DIRNAME
  41. if [ -d "$TMPSBS" ]; then
  42. rm -rf "$TMPSBS"
  43. fi
  44. set -x
  45. mkdir -p "$TMPSBS" &&
  46. (
  47. BINARIES="$HOSTPLATFORM_DIR"
  48. if [[ "$packtype" == "source" ]]; then
  49. BINARIES=""
  50. fi
  51. cd $SBS_HOME && find license.txt RELEASE-NOTES.html bin examples lib notes $BINARIES python raptor schema style util |
  52. grep -v "$TMPSBS"'/python/\.py$' |
  53. grep -v 'flm/test' |
  54. grep -v 'util/build' |
  55. grep -v 'test/epocroot/epoc32/build' |
  56. grep -v 'pvm' |
  57. grep -v '.*/bash' |
  58. grep -v 'linux-.*-libc/bin/sh$' |
  59. grep -v 'install-windows' |
  60. grep -v '~$' | cpio -o --quiet 2>/dev/null
  61. ) | ( cd "$TMPSBS" && cpio -i --make-directories --quiet >/dev/null 2>&1)
  62. # store the version number
  63. echo "FULLVERSION=\"$FULLVERSION\"" > $TMPSBS/.version
  64. echo "VERSION=\"$VERSION\"" >> $TMPSBS/.version
  65. if [[ "$packtype" == "binary" ]]; then
  66. chmod a+x $TMPSBS/bin/* $TMPSBS/$HOSTPLATFORM_DIR/bin/* $TMPSBS/$HOSTPLATFORM_DIR/python27/bin/*
  67. chmod a+x $TMPSBS/$HOSTPLATFORM_DIR/cw_build470msl19/release/Symbian_Tools/Command_Line_Tools/*
  68. fi
  69. cd $TMPSBS/.. && bash "$PACKAGER_HOME"/makeself.sh $DIRNAME $DIRNAME.run "$FULLVERSION\n" ./bin/install_raptor.sh