install_alephone.sh 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #!/bin/bash
  2. # fail if any commands fails
  3. set -e
  4. # debug log
  5. #set -x
  6. # Set superuser privileges command if not set
  7. if [[ -z $su ]]; then
  8. export su="sudo"
  9. fi
  10. $su apt-get install -y build-essential cmake libboost-all-dev libsdl1.2-dev libsdl-image1.2-dev \
  11. libsdl-net1.2-dev libsdl-ttf2.0-dev libspeexdsp-dev libzzip-dev \
  12. libavcodec-dev libavformat-dev libavutil-dev libswscale-dev
  13. application=alephone
  14. repository=https://github.com/Aleph-One-Marathon/alephone.git
  15. export compile=
  16. mkdir -p ~/src
  17. cd ~/src || return
  18. if [ ! -d $application ]; then
  19. git clone $repository
  20. cd $application || return
  21. export compile=true
  22. else
  23. cd $application || return
  24. #git pull
  25. pwd
  26. git fetch
  27. LOCAL=$(git rev-parse HEAD)
  28. REMOTE=$(git rev-parse @{u})
  29. if [ ! $LOCAL = $REMOTE ]; then
  30. pwd
  31. echo "Need to pull"
  32. git pull
  33. export compile=true
  34. fi
  35. fi
  36. if [ "$compile" = "true" ]; then
  37. cd ~/src/$application || return
  38. make
  39. fi
  40. # games data
  41. if [ ! -d ~/games/alephone ]; then
  42. mkdir -p ~/games/alephone
  43. cd ~/games/alephone
  44. curl -s https://api.github.com/repos/Aleph-One-Marathon/alephone/releases/latest | jq -r ".assets[] | select(.name | test(\"Data.zip\")) | .browser_download_url" | xargs -n1 curl -OL
  45. if [ ! -d marathon ]; then
  46. unzip Marathon-*-Data.zip -d marathon
  47. mv marathon/Marathon/* marathon/
  48. rm -rf marathon/Marathon
  49. fi
  50. if [ ! -d marathon2 ]; then
  51. unzip Marathon2-*-Data.zip -d marathon2
  52. mv marathon2/Marathon\ 2/* marathon2/
  53. rm -rf marathon2/Marathon\ 2
  54. fi
  55. if [ ! -d infinity ]; then
  56. unzip MarathonInfinity-*-Data.zip -d infinity
  57. mv infinity/Marathon\ Infinity/* infinity/
  58. rm -rf infinity/Marathon\ Infinity
  59. fi
  60. if [ ! -d marathon_red ]; then
  61. curl -OL "http://files3.bungie.org/trilogy/MarathonRED.zip"
  62. unzip MarathonRED.zip -d marathon_red
  63. mv marathon_red/Marathon\ RED/* marathon_red/
  64. rm -rf marathon_red/Marathon\ RED
  65. fi
  66. if [ ! -d rubicon_x ]; then
  67. curl -OL "http://files5.bungie.org/marathon/marathonRubiconX.zip"
  68. unzip marathonRubiconX.zip -d rubicon_x/
  69. mv rubicon_x/Rubicon\ X\ ƒ/* rubicon_x/
  70. rm -rf rubicon_x/__MACOSX/ rubicon_x/Rubicon\ X\ ƒ/
  71. fi
  72. if [ ! -d phoenix ]; then
  73. curl -o "Marathon_Phoenix.zip" -L "http://simplici7y.com/items/marathon-phoenix-2/download"
  74. unzip Marathon_Phoenix.zip -d phoenix/
  75. mv phoenix/Marathon\ Phoenix/* phoenix/
  76. rm -rf phoenix/Marathon\ Phoenix/
  77. fi
  78. if [ ! -d eternal ]; then
  79. curl -OL "http://eternal.bungie.org/files/_releases/EternalXv121.zip"
  80. unzip EternalXv121.zip -d eternal/
  81. mv eternal/Eternal\ 1.2.1/* eternal/
  82. rm -rf eternal/__MACOSX/ eternal/Eternal\ 1.2.1/
  83. fi
  84. if [ ! -d evil ]; then
  85. curl -OL "http://files3.bungie.org/trilogy/MarathonEvil.zip"
  86. unzip MarathonEvil.zip -d evil/
  87. mv evil/Marathon\ EVIL/* evil/
  88. rm -rf evil/Marathon\ EVIL/
  89. fi
  90. if [ ! -d pathways_into_darkness ]; then
  91. curl -o "AOPID_v1.2.zip" -L "https://simplici7y.com/items/aleph-one-pathways-into-darkness/download"
  92. unzip AOPID_v1.2.zip -d pathways_into_darkness/
  93. mv pathways_into_darkness/AOPID_v1.2/* pathways_into_darkness/
  94. rm -rf pathways_into_darkness/AOPID_v1.2/
  95. fi
  96. fi