/admin/mac/build-release-osx.sh

http://github.com/tomahawk-player/tomahawk · Shell · 59 lines · 36 code · 15 blank · 8 comment · 2 complexity · 8296b887da9eb5e1680e34d1fe234882 MD5 · raw file

  1. #!/bin/bash
  2. #
  3. # Usage: ./admin/mac/build-release-osx.sh VERSION CERT_SIGNER [--no-clean]
  4. #
  5. ################################################################################
  6. TARGET_NAME="Tomahawk"
  7. set -e
  8. function header {
  9. echo -e "\033[0;34m==>\033[0;0;1m $1 \033[0;0m"
  10. }
  11. function die {
  12. exit_code=$?
  13. echo $1
  14. exit $exit_code
  15. }
  16. ################################################################################
  17. if [ -z "$2" ]
  18. then
  19. echo This script expects the version number and cert-signer as parameters, e.g. "1.0.0 John Doe"
  20. exit 1
  21. fi
  22. ROOT=`pwd`
  23. VERSION=$1
  24. CERT_SIGNER=$2
  25. ################################################################################
  26. header "Fixing and copying libraries"
  27. $ROOT/../admin/mac/macdeploy.py "${TARGET_NAME}.app" quiet
  28. cd "${TARGET_NAME}.app"
  29. cp $ROOT/../admin/mac/qt.conf Contents/Resources/qt.conf
  30. header "Fixing fonts"
  31. mkdir "${ROOT}/${TARGET_NAME}.app/Contents/Resources/Fonts"
  32. cp -R $ROOT/../data/fonts/*.ttf "${ROOT}/${TARGET_NAME}.app/Contents/Resources/Fonts"
  33. header "Signing bundle"
  34. cd ..
  35. if [ -f ~/sign_step.sh ];
  36. then
  37. ~/sign_step.sh "$CERT_SIGNER" "${TARGET_NAME}.app"
  38. fi
  39. header "Creating DMG"
  40. $ROOT/../admin/mac/create-dmg.sh "${TARGET_NAME}.app"
  41. mv "${TARGET_NAME}.dmg" "${TARGET_NAME}-$VERSION.dmg"
  42. header "Creating signed Sparkle update"
  43. # $ROOT/../admin/mac/sign_bundle.rb "${TARGET_NAME}" $VERSION ~/tomahawk_sparkle_privkey.pem
  44. header "Done!"