synology 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/usr/bin/env bash
  2. source "$rvm_scripts_path/functions/pkg"
  3. requirements_synology_lib_installed()
  4. {
  5. ipkg list_installed | __rvm_grep "^$1 - " >/dev/null 2>&1 || return $?
  6. }
  7. requirements_synology_lib_available()
  8. {
  9. ipkg list | __rvm_grep "^$1 - " >/dev/null 2>&1 || return $?
  10. }
  11. requirements_synology_libs_install()
  12. {
  13. __rvm_try_sudo ipkg add -z "$@" || return $?
  14. }
  15. requirements_synology_install_custom()
  16. {
  17. requirements_rvm_pkg_libs_install "$@" || return $?
  18. }
  19. requirements_synology_check_binaries()
  20. {
  21. \typeset -a __missing_binaries
  22. __missing_binaries=()
  23. while
  24. (( $# ))
  25. do
  26. __rvm_which $1 >/dev/null || __missing_binaries+=( $1 )
  27. shift
  28. done
  29. if
  30. (( ${#__missing_binaries[@]} ))
  31. then
  32. rvm_error "Missing required binaries: ${__missing_binaries[*]} - make sure those are installed to continue."
  33. return ${#__missing_binaries[@]}
  34. fi
  35. true
  36. }
  37. requirements_synology_define()
  38. {
  39. case "$1" in
  40. (rvm)
  41. true
  42. ;;
  43. (jruby*)
  44. requirements_check make
  45. if
  46. is_head_or_disable_binary "$1"
  47. then
  48. case $( jruby_installation_method "$1" ) in
  49. ant) requirements_synology_check_binaries java git ant || return $? ;;
  50. mvn) requirements_synology_check_binaries java git mvn || return $? ;;
  51. esac
  52. else
  53. requirements_synology_check_binaries java || return $?
  54. fi
  55. ;;
  56. (ir*)
  57. requirements_synology_check_binaries mono || return $?
  58. ;;
  59. (opal)
  60. requirements_synology_check_binaries node || return $?
  61. ;;
  62. (*-head)
  63. requirements_check git
  64. requirements_synology_define "${1%-head}"
  65. ;;
  66. (*)
  67. requirements_check gcc autoconf automake libtool bison readline openssl
  68. requirements_rvm_pkg_lib_installed_custom yaml
  69. __rvm_update_configure_opt_dir "$1" "/usr/local"
  70. ;;
  71. esac
  72. }