release.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. # Create and package a clean, release-mode build of the application
  3. # Must be run from the git source directory.
  4. # Create a .packagingrc file to define:
  5. # TOR_BINARY Path to tor binary to copy into bundle.
  6. # Should be built with --enable-static-libevent
  7. # You can also set other environment, e.g. MAKEOPTS and PATH (for qmake)
  8. set -e
  9. if [ ! -d .git ] || [ ! -f ricochet.pro ]; then
  10. echo "Must be run from source directory"
  11. exit 1
  12. fi
  13. VERSION=`git describe --tags HEAD`
  14. . .packagingrc
  15. if [ -z "$TOR_BINARY" ] || [ ! -f "$TOR_BINARY" ]; then
  16. echo "Missing TOR_BINARY: $TOR_BINARY"
  17. exit 1
  18. fi
  19. rm -r build || true
  20. mkdir build
  21. cd build
  22. qmake CONFIG+=release ${QMAKEOPTS} ..
  23. make
  24. strip ricochet
  25. mkdir -p staging/ricochet
  26. # Copy binaries to staging area
  27. cp ricochet staging/ricochet/
  28. cp "$TOR_BINARY" staging/ricochet/
  29. # Copy extra files
  30. cp -r ../packaging/linux-static/content/* staging/ricochet/
  31. cd staging
  32. tar cfj ricochet-${VERSION}-static.tar.bz2 ricochet
  33. mv *.bz2 ..
  34. cd ..
  35. echo "---------"
  36. tar fjt *.bz2
  37. echo
  38. echo "Output: ./build/ricochet-${VERSION}-static.tar.bz2"