1
0

package_binaries.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/bin/sh
  2. ## Copyright (c) 2014 Minoca Corp. All Rights Reserved.
  3. ##
  4. ## Script Name:
  5. ##
  6. ## package_binaries.sh
  7. ##
  8. ## Abstract:
  9. ##
  10. ## This script archives the native build artifacts.
  11. ##
  12. ## Author:
  13. ##
  14. ## Evan Green 13-Jun-2014
  15. ##
  16. ## Environment:
  17. ##
  18. ## Minoca Build
  19. ##
  20. set -e
  21. if test -z "$SRCROOT"; then
  22. SRCROOT=`pwd`/src
  23. fi
  24. if test -z "$ARCH"; then
  25. echo "ARCH must be set."
  26. exit 1
  27. fi
  28. if test -z "$DEBUG"; then
  29. echo "DEBUG must be set."
  30. exit 1
  31. fi
  32. export TMPDIR=$PWD
  33. export TEMP=$TMPDIR
  34. ARCHIVE_LOCATION=$PWD/..
  35. cd $SRCROOT/$ARCH$VARIANT$DEBUG
  36. ##
  37. ## Move all the packages over, so they get saved beyond this task and aren't in
  38. ## the archive.
  39. ##
  40. cp "./bin/kernel-version" "./bin/packages/"
  41. if test -d "./bin/packages"; then
  42. rm -rf "$ARCHIVE_LOCATION/packages/"
  43. mv "./bin/packages/" "$ARCHIVE_LOCATION/"
  44. fi
  45. ##
  46. ## Remove unimportant stuff from the archive.
  47. ##
  48. rm -rf ./bin/dep
  49. ##
  50. ## Archive the bin folder.
  51. ##
  52. date > ./bin/build-date
  53. cp $SRCROOT/os/revision ./bin/build-revision
  54. echo $ARCH$VARIANT$DEBUG > ./bin/build-flavor
  55. file=$ARCHIVE_LOCATION/minoca-bin-$ARCH$VARIANT$DEBUG.tar.gz
  56. tar -cz -f $file ./bin
  57. echo "Completed packaging $file"