pclinuxos 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #!/usr/bin/env bash
  2. requirements_pclinuxos_lib_installed()
  3. {
  4. rpm -q --whatprovides "$1" >/dev/null || return $?
  5. # Alternative: rpm -qa | grep "$1" >/dev/null || return $?
  6. }
  7. requirements_pclinuxos_lib_available()
  8. {
  9. apt-cache search "$1" >/dev/null 2>&1 || return $?
  10. }
  11. requirements_pclinuxos_version_list()
  12. {
  13. rpm -q --whatprovides "$1" | sed -e "s#^$1-##"
  14. }
  15. requirements_pclinuxos_libs_install()
  16. {
  17. __rvm_try_sudo apt-get -y install "$@" || return $?
  18. }
  19. requirements_pclinuxos_update_system()
  20. {
  21. true
  22. }
  23. requirements_pclinuxos_check_binary()
  24. {
  25. {
  26. __rvm_which update-alternatives >/dev/null &&
  27. update-alternatives --display "$1" >/dev/null 2>&1
  28. } ||
  29. __rvm_which "$1" >/dev/null || return $?
  30. }
  31. requirements_pclinuxos_define()
  32. {
  33. case "$1" in
  34. (rvm)
  35. requirements_check bash curl patch
  36. ;;
  37. (jruby*)
  38. requirements_check make
  39. if
  40. is_head_or_disable_binary "$1"
  41. then
  42. requirements_pclinuxos_check_binary javac ||
  43. requirements_check_fallback java-1.7.0-openjdk-devel java-devel
  44. requirements_check git
  45. case $( jruby_installation_method "$1" ) in
  46. mvn) requirements_check_custom_after mvn=maven ;;
  47. esac
  48. else
  49. requirements_pclinuxos_check_binary java ||
  50. requirements_check_fallback java-1.7.0-openjdk java
  51. fi
  52. ;;
  53. (ir*)
  54. true # not that easy
  55. ;;
  56. (opal)
  57. true # not that easy
  58. ;;
  59. (rbx*|rubinius*)
  60. requirements_check clang clang-devel llvm llvm-devel
  61. ;;
  62. (truffleruby*)
  63. requirements_check lib64openssl-devel zlib zlib-devel make gcc libxml2
  64. ;;
  65. (*-head)
  66. requirements_check git
  67. requirements_pclinuxos_define "${1%-head}"
  68. ;;
  69. (*)
  70. if [[ ${#rvm_patch_names[@]} -gt 0 || "$1" == *"-head" ]]
  71. then requirements_version_minimal autoconf 2.67
  72. else requirements_check autoconf
  73. fi
  74. case "${_system_arch}" in
  75. (x86_64)
  76. requirements_check lib64yaml-devel lib64ffi-devel lib64readline-devel lib64openssl-devel
  77. ;;
  78. (*)
  79. requirements_check libyaml-devel libffi5-devel readline-devel libopenssl-devel
  80. ;;
  81. esac
  82. requirements_check automake bison bzip2 gcc-c++ glibc-devel glibc-headers-devel libtool make patch \
  83. zlib zlib-devel
  84. ;;
  85. esac
  86. }