netbsd 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #!/usr/bin/env bash
  2. requirements_netbsd_lib_installed()
  3. {
  4. [[ -f /etc/mtree/set.$1 ]] || return $?
  5. }
  6. requirements_netbsd_libs_install()
  7. {
  8. \typeset _set_base_url _set _set_url _set_md5
  9. _set_base_url="http://ftp.netbsd.org/pub/NetBSD/NetBSD-${_system_version_full}/${_system_arch/x86_64/amd64}/binary/sets"
  10. for _set in "$@"
  11. do
  12. _set_url="${_set_base_url}/${_set}.tgz"
  13. _set_md5="$(__rvm_curl -s ${_set_base_url}/MD5 | __rvm_grep "(${_set}.tgz)" | __rvm_awk '{print $NF}')"
  14. __rvm_curl ${_set_url} -o ${rvm_archives_path}/${_set}.tgz || return $?
  15. [[ "$(__rvm_md5_calculate ${rvm_archives_path}/${_set}.tgz)" == ${_set_md5} ]] ||
  16. {
  17. \typeset result=$?
  18. rvm_error "Set checksum verification failed"
  19. return $result
  20. }
  21. __rvm_try_sudo tar xzf ${rvm_archives_path}/${_set}.tgz -C / || return $?
  22. done
  23. }
  24. requirements_netbsd_check_custom()
  25. {
  26. \typeset _lib
  27. for _lib in "$@"
  28. do
  29. [[ " ${packages_custom[*]} " == *" ${_lib} "* ]] ||
  30. requirements_netbsd_custom_lib_installed "${_lib}" ||
  31. __rvm_add_once packages_custom "${_lib}"
  32. done
  33. }
  34. requirements_netbsd_custom_lib_installed()
  35. {
  36. pkg_info -qE "$1" || return $?
  37. }
  38. requirements_netbsd_install_custom()
  39. {
  40. __rvm_try_sudo \
  41. PKG_PATH="http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/${_system_version}/All/" \
  42. pkg_add "$@" || return $?
  43. }
  44. requirements_netbsd_after()
  45. {
  46. \typeset _certs
  47. _certs="$(__rvm_ls /etc/openssl/certs)"
  48. [[ ! -n "${certs}" && -f /etc/ssl/certs/ca-certificates.crt ]] ||
  49. __rvm_try_sudo mozilla-rootcerts install >/dev/null 2>&1 || return $?
  50. }
  51. requirements_netbsd_define()
  52. {
  53. case "$1" in
  54. (rvm)
  55. requirements_netbsd_check_custom bash curl mozilla-rootcerts p5-Digest-SHA
  56. ;;
  57. (jruby*)
  58. requirements_netbsd_check_custom openjdk7 make
  59. if
  60. is_head_or_disable_binary "$1"
  61. then
  62. case $( jruby_installation_method "$1" ) in
  63. ant) __rvm_which ant >/dev/null || requirements_netbsd_check_custom apache-ant ;;
  64. mvn) __rvm_which mvn >/dev/null || requirements_netbsd_check_custom apache-maven ;;
  65. esac
  66. fi
  67. ;;
  68. (ir*)
  69. true
  70. ;;
  71. (opal)
  72. true
  73. ;;
  74. (*-head)
  75. requirements_check comp
  76. requirements_netbsd_check_custom automake autoconf libtool bison gdbm libffi libyaml scmgit
  77. __rvm_update_configure_opt_dir "$1" "/usr/pkg"
  78. ;;
  79. (*)
  80. requirements_check comp
  81. requirements_netbsd_check_custom automake autoconf libtool bison gdbm libffi libyaml
  82. __rvm_update_configure_opt_dir "$1" "/usr/pkg"
  83. ;;
  84. esac
  85. }