assaultcube.sh 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #!/bin/sh
  2. # CUBE_DIR should refer to the directory in which AssaultCube is placed.
  3. #CUBE_DIR=~/assaultcube
  4. #CUBE_DIR=/usr/local/assaultcube
  5. #CUBE_DIR=./
  6. CUBE_DIR=$(dirname "$(readlink -f "${0}")")
  7. # CUBE_OPTIONS starts AssaultCube with any command line options you choose.
  8. #CUBE_OPTIONS="-f"
  9. CUBE_OPTIONS="--home=${HOME}/.assaultcube_v1.2 --init"
  10. # SYSTEM_NAME should be set to the name of your operating system.
  11. #SYSTEM_NAME=Linux
  12. SYSTEM_NAME=`uname -s`
  13. # MACHINE_NAME should be set to the architecture of your processor.
  14. #MACHINE_NAME=i686
  15. MACHINE_NAME=`uname -m`
  16. case ${SYSTEM_NAME} in
  17. Linux)
  18. SYSTEM_NAME=linux_
  19. ;;
  20. *)
  21. SYSTEM_NAME=unknown_
  22. ;;
  23. esac
  24. case ${MACHINE_NAME} in
  25. i486|i586|i686)
  26. MACHINE_NAME=
  27. ;;
  28. x86_64)
  29. MACHINE_NAME=64_
  30. ;;
  31. *)
  32. if [ ${SYSTEM_NAME} != native_ ]
  33. then
  34. SYSTEM_NAME=native_
  35. fi
  36. MACHINE_NAME=
  37. ;;
  38. esac
  39. if [ -x "${CUBE_DIR}/bin_unix/native_client" ]
  40. then
  41. SYSTEM_NAME=native_
  42. MACHINE_NAME=
  43. fi
  44. if [ -x "/sbin/ldconfig" ]; then
  45. if [ -z "$(/sbin/ldconfig -p | grep "libX11")" ]; then
  46. echo "To run AssaultCube, please ensure X11 libraries are installed."
  47. exit 1
  48. fi
  49. if [ -z "$(/sbin/ldconfig -p | grep "libSDL-1.2")" ]; then
  50. echo "To run AssaultCube, please ensure SDL v1.2 libraries are installed."
  51. exit 1
  52. fi
  53. if [ -z "$(/sbin/ldconfig -p | grep "libSDL_image")" ]; then
  54. echo "To run AssaultCube, please ensure SDL_image libraries are installed."
  55. exit 1
  56. fi
  57. if [ -z "$(/sbin/ldconfig -p | grep "libz")" ]; then
  58. echo "To run AssaultCube, please ensure z libraries are installed."
  59. exit 1
  60. fi
  61. if [ -z "$(/sbin/ldconfig -p | grep "libogg")" ]; then
  62. echo "To run AssaultCube, please ensure ogg libraries are installed."
  63. exit 1
  64. fi
  65. if [ -z "$(/sbin/ldconfig -p | grep "libvorbis")" ]; then
  66. echo "To run AssaultCube, please ensure vorbis libraries are installed."
  67. exit 1
  68. fi
  69. if [ -z "$(/sbin/ldconfig -p | grep "libopenal")" ]; then
  70. echo "To run AssaultCube, please ensure OpenAL-Soft libraries are installed."
  71. exit 1
  72. fi
  73. if [ -z "$(/sbin/ldconfig -p | grep "libcurl")" ]; then
  74. echo "To run AssaultCube, please ensure Curl libraries are installed."
  75. exit 1
  76. fi
  77. fi
  78. if [ -x "${CUBE_DIR}/bin_unix/${SYSTEM_NAME}${MACHINE_NAME}client" ]; then
  79. cd "${CUBE_DIR}"
  80. exec "${CUBE_DIR}/bin_unix/${SYSTEM_NAME}${MACHINE_NAME}client" ${CUBE_OPTIONS} "$@"
  81. elif [ -e "${CUBE_DIR}/bin_unix/${SYSTEM_NAME}${MACHINE_NAME}client" ]; then
  82. echo "Insufficient permissons to run AssaultCube."
  83. echo "Please change (chmod) the AssaultCube client in the bin_unix folder to be readable/executable."
  84. else
  85. echo "Your platform does not have a pre-compiled AssaultCube client."
  86. echo "Please follow the following steps to build a native client:"
  87. echo "1) Ensure you have the following DEVELOPMENT libraries installed:"
  88. echo " OpenGL, SDL, SDL_image, zlib, libogg, libvorbis, OpenAL Soft, libcurl"
  89. echo "2) Ensure clang++ and any other required build tools are installed."
  90. echo "3) Change directory to ./source/src/ and type \"make install\"."
  91. echo "4) If the compile succeeds, return to this directory and re-run this script."
  92. exit 1
  93. fi