install_prboom-plus.sh 721 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. # fail if any commands fails
  3. set -e
  4. # debug log
  5. #set -x
  6. $su apt-get install -y build-essential cmake imagemagick libsdl2-dev
  7. application=prboom-plus
  8. repository=https://github.com/coelckers/prboom-plus.git
  9. export compile=
  10. mkdir -p ~/src
  11. cd ~/src || return
  12. if [ ! -d $application ]; then
  13. git clone $repository
  14. cd $application || return
  15. export compile=true
  16. else
  17. cd $application || return
  18. #git pull
  19. pwd
  20. git fetch
  21. LOCAL=$(git rev-parse HEAD)
  22. REMOTE=$(git rev-parse @{u})
  23. if [ ! $LOCAL = $REMOTE ]; then
  24. pwd
  25. echo "Need to pull"
  26. git pull
  27. export compile=true
  28. fi
  29. fi
  30. if [ "$compile" = "true" ]; then
  31. cd ~/src/$application || return
  32. cd prboom2 || return
  33. cmake .
  34. make
  35. fi