0install.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. # Script to create 0install archives
  3. ### parameter variables ###
  4. build_log=BUILD_INFO.txt # Logs included in distributed archive
  5. dbg_log=dbg.log #To debug this script, dropped sometimes
  6. echo "========= Building ========="
  7. # Get and set compilation settings
  8. ./configure --disable-debug --disable-docs --disable-profile --disable-tests > $build_log
  9. # First compile
  10. make
  11. # Copy in distribution directory (if exists)
  12. dist=./dist
  13. if [ ! -d $dist ]; then
  14. mkdir $dist
  15. fi
  16. # Archive name, _the bin emphasis the difference with source tarball
  17. id=`git describe --abbrev=40 --candidates=50 HEAD`
  18. name=oclaunch-${id}_$(arch)_bin
  19. final_binary_path=./$name/oclaunch
  20. final_binary_name=oclaunch
  21. cp ./_build/src/oclaunch.native $dist/$final_binary_name
  22. # Move BUILD_INFO
  23. mv $build_log ./$dist/
  24. cd $dist
  25. if [ ! -d $name ]; then
  26. mkdir $name
  27. fi
  28. # Put executable in it
  29. mv $final_binary_name $build_log $name
  30. tree > $dbg_log
  31. # Create archive
  32. echo "========= Creating first archive ========="
  33. tar -cvaf $name.tar.lzma $name >> $dbg_log
  34. # Create stripped archive
  35. strip $final_binary_path
  36. echo "========= Creating second (stripped) archive ========="
  37. tar -cvaf ${name}_stripped.tar.lzma $name >> $dbg_log