check_deps.sh 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. #!/bin/bash
  2. # LinuxGSM check_deps.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://linuxgsm.com
  5. # Description: Checks if required dependencies are installed for LinuxGSM.
  6. local commandname="CHECK"
  7. fn_install_mono_repo(){
  8. if [ "${monostatus}" != "0" ]; then
  9. fn_print_dots "Adding Mono repository"
  10. sleep 0.5
  11. sudo -v > /dev/null 2>&1
  12. if [ $? -eq 0 ]; then
  13. fn_print_info_nl "Automatically adding Mono repository."
  14. fn_script_log_info "Automatically adding Mono repository."
  15. echo -en ".\r"
  16. sleep 1
  17. echo -en "..\r"
  18. sleep 1
  19. echo -en "...\r"
  20. sleep 1
  21. echo -en " \r"
  22. if [ "${distroid}" == "ubuntu" ]; then
  23. if [ "${distroversion}" == "18.04" ]; then
  24. cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-bionic main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
  25. eval ${cmd}
  26. elif [ "${distroversion}" == "16.04" ]; then
  27. cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt install apt-transport-https;echo 'deb https://download.mono-project.com/repo/ubuntu stable-xenial main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
  28. eval ${cmd}
  29. elif [ "${distroversion}" == "14.04" ]; then
  30. cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt install apt-transport-https;echo 'deb https://download.mono-project.com/repo/ubuntu stable-trusty main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
  31. eval ${cmd}
  32. else
  33. fn_print_warn_nl "Installing Mono repository"
  34. echo "Mono auto install not available for ${distroname}"
  35. echo " Follow instructions on mono site to install the latest version of Mono."
  36. echo " https://www.mono-project.com/download/stable/#download-lin"
  37. monoautoinstall="1"
  38. fi
  39. elif [ "${distroid}" == "debian" ]; then
  40. if [ "${distroversion}" == "9" ]; then
  41. cmd="sudo apt install apt-transport-https dirmngr;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-stretch main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
  42. eval ${cmd}
  43. elif [ "${distroversion}" == "8" ]; then
  44. cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt install apt-transport-https;echo 'deb https://download.mono-project.com/repo/debian stable-jessie main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
  45. eval ${cmd}
  46. else
  47. echo "Mono auto install not available for ${distroname}"
  48. echo " Follow instructions on mono site to install the latest version of Mono."
  49. echo " https://www.mono-project.com/download/stable/#download-lin"
  50. monoautoinstall="1"
  51. fi
  52. elif [ "${distroid}" == "centos" ]; then
  53. if [ "${distroversion}" == "7" ]; then
  54. cmd="rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'"
  55. eval ${cmd}
  56. elif [ "${distroversion}" == "6" ]; then
  57. cmd="rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos6-stable.repo | tee /etc/yum.repos.d/mono-centos6-stable.repo'"
  58. eval ${cmd}
  59. else
  60. echo "Mono auto install not available for ${distroname}"
  61. echo " Follow instructions on mono site to install the latest version of Mono."
  62. echo " https://www.mono-project.com/download/stable/#download-lin"
  63. monoautoinstall="1"
  64. fi
  65. elif [ "${distroid}" == "fedora" ]; then
  66. cmd="rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF'; su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'; dnf update"
  67. eval ${cmd}
  68. else
  69. echo "Mono auto install not available for ${distroname}"
  70. echo " Follow instructions on mono site to install the latest version of Mono."
  71. echo " https://www.mono-project.com/download/stable/#download-lin"
  72. monoautoinstall="1"
  73. fi
  74. if [ "${monoautoinstall}" != "1" ];then
  75. if [ $? != 0 ]; then
  76. fn_print_failure_nl "Unable to install Mono repository."
  77. fn_script_log_fatal "Unable to installMono repository."
  78. monoautoinstall=1
  79. else
  80. fn_print_complete_nl "Installing Mono repository completed."
  81. fn_script_log_pass "Installing Mono repository completed."
  82. monoautoinstall=0
  83. fi
  84. fi
  85. else
  86. fn_print_information_nl "Installing Mono repository"
  87. echo ""
  88. fn_print_warning_nl "$(whoami) does not have sudo access. Manually install Mono repository."
  89. fn_script_log_warn "$(whoami) does not have sudo access. Manually install Mono repository."
  90. echo " Follow instructions on mono site to install the latest version of Mono."
  91. echo " https://www.mono-project.com/download/stable/#download-lin"
  92. fi
  93. fi
  94. }
  95. fn_deps_detector(){
  96. # Checks if dependency is missing
  97. if [ "${tmuxcheck}" == "1" ]; then
  98. # Added for users compiling tmux from source to bypass check.
  99. depstatus=0
  100. deptocheck="tmux"
  101. unset tmuxcheck
  102. elif [ "${javacheck}" == "1" ]; then
  103. # Added for users using Oracle JRE to bypass check.
  104. depstatus=0
  105. deptocheck="${javaversion}"
  106. unset javacheck
  107. elif [ "${deptocheck}" == "mono-complete" ]; then
  108. if [ "$(command -v mono 2>/dev/null)" ]&&[ "$(mono --version 2>&1 | grep -Po '(?<=version )\d')" -ge 5 ]; then
  109. # Mono >= 5.0.0 already installed
  110. depstatus=0
  111. else
  112. # Mono not installed or installed Mono < 5.0.0
  113. depstatus=1
  114. monostatus=1
  115. fi
  116. elif [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
  117. dpkg-query -W -f='${Status}' "${deptocheck}" 2>/dev/null | grep -q -P '^install ok installed'
  118. depstatus=$?
  119. elif [ -n "$(command -v rpm 2>/dev/null)" ]; then
  120. rpm -q "${deptocheck}" > /dev/null 2>&1
  121. depstatus=$?
  122. fi
  123. if [ "${depstatus}" == "0" ]; then
  124. # if dependency is found
  125. missingdep=0
  126. if [ "${function_selfname}" == "command_install.sh" ]; then
  127. echo -e "${green}${deptocheck}${default}"
  128. sleep 0.2
  129. fi
  130. else
  131. # if dependency is not found
  132. missingdep=1
  133. if [ "${function_selfname}" == "command_install.sh" ]; then
  134. echo -e "${red}${deptocheck}${default}"
  135. sleep 0.2
  136. fi
  137. if [ "${deptocheck}" == "glibc.i686" ]||[ "${deptocheck}" == "libstdc++64.i686" ]||[ "${deptocheck}" == "lib32gcc1" ]||[ "${deptocheck}" == "libstdc++6:i386" ]; then
  138. steamcmdfail=1
  139. fi
  140. fi
  141. # Missing dependencies are added to array_deps_missing
  142. if [ "${missingdep}" == "1" ]; then
  143. array_deps_missing+=("${deptocheck}")
  144. fi
  145. }
  146. fn_deps_email(){
  147. # Adds postfix to required dependencies if email alert is enabled
  148. if [ "${emailalert}" == "on" ]; then
  149. if [ -f /usr/bin/mailx ]; then
  150. if [ -d /etc/exim4 ]; then
  151. array_deps_required+=( exim4 )
  152. elif [ -d /etc/sendmail ]; then
  153. array_deps_required+=( sendmail )
  154. elif [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
  155. array_deps_required+=( mailutils postfix )
  156. elif [ -n "$(command -v rpm 2>/dev/null)" ]; then
  157. array_deps_required+=( mailx postfix )
  158. fi
  159. else
  160. if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
  161. array_deps_required+=( mailutils postfix )
  162. elif [ -n "$(command -v rpm 2>/dev/null)" ]; then
  163. array_deps_required+=( mailx postfix )
  164. fi
  165. fi
  166. fi
  167. }
  168. fn_found_missing_deps(){
  169. if [ "${#array_deps_missing[@]}" != "0" ]; then
  170. fn_print_dots "Checking dependencies"
  171. sleep 0.5
  172. fn_print_error_nl "Checking dependencies: missing: ${red}${array_deps_missing[@]}${default}"
  173. fn_script_log_error "Checking dependencies: missing: ${array_deps_missing[@]}"
  174. sleep 0.5
  175. if [ -n "${monostatus}" ]; then
  176. fn_install_mono_repo
  177. fi
  178. sudo -v > /dev/null 2>&1
  179. if [ $? -eq 0 ]; then
  180. fn_print_information_nl "Automatically installing missing dependencies."
  181. fn_script_log_info "Automatically installing missing dependencies."
  182. echo -en ".\r"
  183. sleep 1
  184. echo -en "..\r"
  185. sleep 1
  186. echo -en "...\r"
  187. sleep 1
  188. echo -en " \r"
  189. if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
  190. cmd="sudo dpkg --add-architecture i386; sudo apt update; sudo apt -y install ${array_deps_missing[@]}"
  191. eval "${cmd}"
  192. elif [ -n "$(command -v dnf 2>/dev/null)" ]; then
  193. cmd="sudo dnf -y install ${array_deps_missing[@]}"
  194. eval "${cmd}"
  195. elif [ -n "$(command -v yum 2>/dev/null)" ]; then
  196. cmd="sudo yum -y install ${array_deps_missing[@]}"
  197. eval "${cmd}"
  198. fi
  199. if [ $? != 0 ]; then
  200. fn_print_failure_nl "Unable to install dependencies"
  201. fn_script_log_fatal "Unable to install dependencies"
  202. echo ""
  203. fn_print_warning_nl "Manually install dependencies."
  204. fn_script_log_warn "Manually install dependencies."
  205. if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
  206. echo " sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[@]}"
  207. elif [ -n "$(command -v dnf 2>/dev/null)" ]; then
  208. echo " sudo dnf install ${array_deps_missing[@]}"
  209. elif [ -n "$(command -v yum 2>/dev/null)" ]; then
  210. echo " sudo yum install ${array_deps_missing[@]}"
  211. fi
  212. if [ "${steamcmdfail}" ]; then
  213. echo ""
  214. fn_print_failure_nl "Missing dependencies required to run SteamCMD."
  215. fn_script_log_fatal "Missing dependencies required to run SteamCMD."
  216. core_exit.sh
  217. fi
  218. else
  219. fn_print_complete_nl "Install dependencies completed"
  220. fn_script_log_pass "Install dependencies completed"
  221. fi
  222. else
  223. echo ""
  224. fn_print_warning_nl "$(whoami) does not have sudo access. Manually install dependencies."
  225. fn_script_log_warn "$(whoami) does not have sudo access. Manually install dependencies."
  226. if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
  227. echo " sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[@]}"
  228. elif [ -n "$(command -v dnf 2>/dev/null)" ]; then
  229. echo " sudo dnf install ${array_deps_missing[@]}"
  230. elif [ -n "$(command -v yum 2>/dev/null)" ]; then
  231. echo " sudo yum install ${array_deps_missing[@]}"
  232. fi
  233. if [ "${steamcmdfail}" ]; then
  234. echo ""
  235. fn_print_failure_nl "Missing dependencies required to run SteamCMD."
  236. fn_script_log_fatal "Missing dependencies required to run SteamCMD."
  237. core_exit.sh
  238. fi
  239. echo ""
  240. fi
  241. if [ "${function_selfname}" == "command_install.sh" ]; then
  242. sleep 5
  243. fi
  244. fi
  245. }
  246. fn_check_loop(){
  247. # Loop though required depenencies
  248. for deptocheck in "${array_deps_required[@]}"
  249. do
  250. fn_deps_detector
  251. done
  252. # user to be informed of any missing dependencies
  253. fn_found_missing_deps
  254. }
  255. # Generate require dependencies for debian based systems
  256. fn_deps_build_debian(){
  257. # Generate array of missing deps
  258. array_deps_missing=()
  259. ## LinuxGSM requirements
  260. array_deps_required=( curl wget ca-certificates file bsdmainutils util-linux python bzip2 gzip unzip binutils bc )
  261. # All servers except ts3 require tmux
  262. if [ "${shortname}" != "ts3" ]; then
  263. if [ "$(command -v tmux 2>/dev/null)" ]; then
  264. tmuxcheck=1 # Added for users compiling tmux from source to bypass check.
  265. else
  266. array_deps_required+=( tmux )
  267. fi
  268. fi
  269. # All servers except ts3, mumble, GTA and minecraft servers require libstdc++6 and lib32gcc1
  270. if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${shortname}" != "mc" ]&&[ "${engine}" != "renderware" ]; then
  271. if [ "${arch}" == "x86_64" ]; then
  272. array_deps_required+=( lib32gcc1 libstdc++6:i386 )
  273. else
  274. array_deps_required+=( libstdc++6:i386 )
  275. fi
  276. fi
  277. ## Game Specific requirements
  278. # Natural Selection 2 - x64 only
  279. if [ "${shortname}" == "ns2" ]; then
  280. array_deps_required+=( speex libtbb2 )
  281. # NS2: Combat
  282. elif [ "${shortname}" == "ns2c" ]; then
  283. array_deps_required+=( speex:i386 libtbb2 )
  284. # 7 Days to Die
  285. elif [ "${shortname}" == "sdtd" ]; then
  286. array_deps_required+=( telnet expect )
  287. # No More Room in Hell, Counter-Strike: Source and Garry's Mod
  288. elif [ "${shortname}" == "nmrih" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "zps" ]; then
  289. if [ "${arch}" == "x86_64" ]; then
  290. array_deps_required+=( lib32tinfo5 )
  291. else
  292. array_deps_required+=( libtinfo5 )
  293. fi
  294. # Brainbread 2 ,Don't Starve Together & Team Fortress 2
  295. elif [ "${shortname}" == "bb2" ]||[ "${shortname}" == "dst" ]||[ "${shortname}" == "tf2" ]; then
  296. array_deps_required+=( libcurl4-gnutls-dev:i386 )
  297. if [ "${shortname}" == "tf2" ]; then
  298. array_deps_required+=( libtcmalloc-minimal4:i386 )
  299. fi
  300. # Battlefield: 1942
  301. elif [ "${shortname}" == "bf1942" ]; then
  302. array_deps_required+=( libncurses5:i386 )
  303. # Call of Duty
  304. elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]; then
  305. array_deps_required+=( libstdc++5:i386 )
  306. # Factorio
  307. elif [ "${shortname}" == "fctr" ]; then
  308. array_deps_required+=( xz-utils )
  309. # Hurtword/Rust
  310. elif [ "${shortname}" == "hw" ]||[ "${shortname}" == "rust" ]; then
  311. array_deps_required+=( lib32z1 )
  312. # Minecraft
  313. elif [ "${shortname}" == "mc" ]; then
  314. javaversion=$(java -version 2>&1 | grep "version")
  315. if [ "${javaversion}" ]; then
  316. javacheck=1 # Added for users using Oracle JRE to bypass the check.
  317. else
  318. array_deps_required+=( openjdk-8-jre-headless )
  319. fi
  320. # Project Zomboid
  321. elif [ "${shortname}" == "pz" ]; then
  322. if [ -n "$(java -version 2>&1 | grep "version")" ]; then
  323. javacheck=1 # Added for users using Oracle JRE to bypass the check.
  324. array_deps_required+=( rng-tools )
  325. else
  326. array_deps_required+=( default-jre rng-tools )
  327. fi
  328. # GoldenEye: Source
  329. elif [ "${shortname}" == "ges" ]; then
  330. array_deps_required+=( zlib1g:i386 libldap-2.4-2:i386 )
  331. # Serious Sam 3: BFE
  332. elif [ "${shortname}" == "ss3" ]; then
  333. array_deps_required+=( libxrandr2:i386 libglu1-mesa:i386 libxtst6:i386 libusb-1.0-0-dev:i386 libxxf86vm1:i386 libopenal1:i386 libssl1.0.0:i386 libgtk2.0-0:i386 libdbus-glib-1-2:i386 libnm-glib-dev:i386 )
  334. # Unreal Engine
  335. elif [ "${executable}" == "./ucc-bin" ]; then
  336. #UT2K4
  337. if [ -f "${executabledir}/ut2004-bin" ]; then
  338. array_deps_required+=( libsdl1.2debian libstdc++5:i386 )
  339. #UT99
  340. else
  341. array_deps_required+=( libsdl1.2debian )
  342. fi
  343. # Unreal Tournament
  344. elif [ "${shortname}" == "ut" ]; then
  345. array_deps_required+=( unzip )
  346. # Eco
  347. elif [ "${shortname}" == "eco" ]; then
  348. array_deps_required+=( mono-complete )
  349. fi
  350. fn_deps_email
  351. fn_check_loop
  352. }
  353. fn_deps_build_redhat(){
  354. # Generate array of missing deps
  355. array_deps_missing=()
  356. # LinuxGSM requirements
  357. ## CentOS 6
  358. if [ "${distroversion}" == "6" ]; then
  359. array_deps_required=( curl wget util-linux-ng python file gzip bzip2 unzip binutils bc )
  360. elif [ "${distroid}" == "fedora" ]; then
  361. array_deps_required=( curl wget util-linux python2 file gzip bzip2 unzip binutils bc )
  362. elif [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then
  363. array_deps_required=( curl wget util-linux python27 file gzip bzip2 unzip binutils bc )
  364. else
  365. array_deps_required=( curl wget util-linux python file gzip bzip2 unzip binutils bc )
  366. fi
  367. # All servers except ts3 require tmux
  368. if [ "${shortname}" != "ts3" ]; then
  369. if [ "$(command -v tmux 2>/dev/null)" ]; then
  370. tmuxcheck=1 # Added for users compiling tmux from source to bypass check.
  371. else
  372. array_deps_required+=( tmux )
  373. fi
  374. fi
  375. # All servers except ts3,mumble,multitheftauto and minecraft servers require glibc.i686 and libstdc++.i686
  376. if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${shortname}" != "nc" ]&&[ "${engine}" != "renderware" ]; then
  377. if [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then
  378. array_deps_required+=( glibc.i686 libstdc++64.i686 )
  379. else
  380. array_deps_required+=( glibc.i686 libstdc++.i686 )
  381. fi
  382. fi
  383. # Game Specific requirements
  384. # Natural Selection 2 (x64 only)
  385. if [ "${shortname}" == "ns2" ]; then
  386. array_deps_required+=( speex tbb )
  387. # NS2: Combat
  388. elif [ "${shortname}" == "ns2c" ]; then
  389. array_deps_required+=( speex.i686 tbb.i686 )
  390. # 7 Days to Die
  391. elif [ "${shortname}" == "sdtd" ]; then
  392. array_deps_required+=( telnet expect )
  393. # No More Room in Hell, Counter-Strike: Source, Garry's Mod and Zombie Panic: Source
  394. elif [ "${shortname}" == "nmrih" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "zps" ]; then
  395. array_deps_required+=( ncurses-libs.i686 )
  396. # Brainbread 2, Don't Starve Together & Team Fortress 2
  397. elif [ "${shortname}" == "bb2" ]||[ "${shortname}" == "dst" ]||[ "${shortname}" == "tf2" ]; then
  398. array_deps_required+=( libcurl.i686 )
  399. if [ "${gamename}" == "Team Fortress 2" ]; then
  400. array_deps_required+=( gperftools-libs.i686 )
  401. fi
  402. # Battlefield: 1942
  403. elif [ "${shortname}" == "bf1942" ]; then
  404. array_deps_required+=( ncurses-libs.i686 )
  405. # Call of Duty
  406. elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]; then
  407. array_deps_required+=( compat-libstdc++-33.i686 )
  408. # Factorio
  409. elif [ "${shortname}" == "fctr" ]; then
  410. array_deps_required+=( xz )
  411. elif [ "${shortname}" == "hw" ]||[ "${shortname}" == "rust" ]; then
  412. array_deps_required+=( zlib-devel )
  413. # Minecraft
  414. elif [ "${shortname}" == "mc" ]; then
  415. javaversion=$(java -version 2>&1 | grep "version")
  416. if [ "${javaversion}" ]; then
  417. javacheck=1 # Added for users using Oracle JRE to bypass the check.
  418. array_deps_required+=( rng-tools )
  419. else
  420. array_deps_required+=( java-1.8.0-openjdk rng-tools )
  421. fi
  422. # Project Zomboid & Minecraft
  423. elif [ "${shortname}" == "pz" ]; then
  424. javaversion=$(java -version 2>&1 | grep "version")
  425. if [ "${javaversion}" ]; then
  426. javacheck=1 # Added for users using Oracle JRE to bypass the check.
  427. array_deps_required+=( rng-tools )
  428. else
  429. array_deps_required+=( java-1.8.0-openjdk rng-tools )
  430. fi
  431. # GoldenEye: Source
  432. elif [ "${shortname}" == "ges" ]; then
  433. array_deps_required+=( zlib.i686 openldap.i686 )
  434. # Unreal Engine
  435. elif [ "${executable}" == "./ucc-bin" ]; then
  436. #UT2K4
  437. if [ -f "${executabledir}/ut2004-bin" ]; then
  438. array_deps_required+=( compat-libstdc++-33.i686 SDL.i686 bzip2 )
  439. #UT99
  440. else
  441. array_deps_required+=( SDL.i686 bzip2 )
  442. fi
  443. # Unreal Tournament
  444. elif [ "${shortname}" == "ut" ]; then
  445. array_deps_required+=( unzip )
  446. # Eco
  447. elif [ "${shortname}" == "eco" ]; then
  448. array_deps_required+=( mono-complete )
  449. fi
  450. fn_deps_email
  451. fn_check_loop
  452. }
  453. if [ "${function_selfname}" == "command_install.sh" ]; then
  454. echo ""
  455. echo "Checking Dependencies"
  456. echo "================================="
  457. fi
  458. # Filter checking in to Debian or Red Hat Based
  459. info_distro.sh
  460. if [ -f "/etc/debian_version" ]; then
  461. fn_deps_build_debian
  462. elif [ -f "/etc/redhat-release" ]; then
  463. fn_deps_build_redhat
  464. else
  465. fn_print_warning_nl "${distroname} dependency checking unavailable"
  466. fi