0install.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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
  17. name=oclaunch-v$(cat ./VERSION)_$(arch)
  18. final_binary_path=./$name/oclaunch
  19. final_binary_name=oclaunch
  20. cp ./_build/src/oclaunch.native $dist/$final_binary_name
  21. # Move BUILD_INFO
  22. mv $build_log ./$dist/
  23. cd $dist
  24. if [ ! -d $name ]; then
  25. mkdir $name
  26. fi
  27. # Put executable in it
  28. mv $final_binary_name $build_log $name
  29. tree > $dbg_log
  30. # Create archive
  31. echo "========= Creating first archive ========="
  32. tar -cvaf $name.tar.lzma $name >> $dbg_log
  33. # Create stripped archive
  34. strip $final_binary_path
  35. echo "========= Creating second (stripped) archive ========="
  36. tar -cvaf ${name}_stripped.tar.lzma $name >> $dbg_log