Advertisement
mtrower

rvm_oi_wrapper.bash

Mar 15th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.02 KB | None | 0 0
  1. #!/usr/bin/bash
  2.  
  3. wd=`pwd`
  4. tmpdir=/tmp/rvm_wrapper
  5. ruby_deps='gawk autoconf gnu-tar gcc-3 gnu-findutils wget gnu-grep gnu-make'
  6. rvm_deps='crypto/gnupg gnu-coreutils'
  7.  
  8. if [ -d $tmpdir ]; then
  9.     echo "Temporary directory [$tmpdir] exists! Please rename or remove it."
  10.     exit 1
  11. fi
  12.  
  13. mkdir $tmpdir && cd $tmpdir
  14.  
  15.  
  16. # install some packages and libraries to get us into a known good state
  17. # for installing RVM and compiling CRuby
  18. ###############################################################################
  19. sudo pkg install $ruby_deps $rvm_deps
  20. sudo pkgadd -d http://get.opencsw.org/now CSWpkgutil
  21.  
  22. # Grab node since uglifier requires a JS engine
  23. sudo pkg set-publisher -p http://pkg.openindiana.org/sfe/ sfe
  24. sudo pkg install nodejs
  25. sudo pkg unset-publisher sfe
  26.  
  27. # Install old Sun libm
  28. wget https://download.joyent.com/pub/build/src/devpro/devpro-libm-src-20060131.tar.bz2
  29. tar xf devpro-libm-src-20060131.tar.bz2
  30. sudo cp -r usr/src/libm/inc/* /usr/include/
  31.  
  32. # Ruby and RVM expect some specifically named files to exist at specific places.
  33. sudo ln -s /usr/bin/gpg{2,}
  34. ln -s /usr/gnu/lib/libncurses.so.5 /usr/lib/
  35.  
  36.  
  37. # set up cert file
  38. ###############################################################################
  39. sudo mkdir -p /etc/curl
  40. sudo sh -c 'cat /etc/certs/CA/*.pem > /etc/curl/curlCA'
  41.  
  42.  
  43. # install RVM
  44. ###############################################################################
  45. export PATH="/usr/gnu/bin:$PATH"
  46. \curl -sSL https://get.rvm.io | bash
  47.  
  48.  
  49. # install Ruby 2.2.4
  50. #
  51. # You can try various versions, but I don't have all of them working yet.
  52. ###############################################################################
  53.  
  54. source ~/.profile
  55. rvm install 2.2.4
  56.  
  57. # It might fail installing requirements, but succeed on a second pass.
  58. # Even if it fails, you can at least get some debug info.
  59. [ -z `rvm list strings` ] && rvm install --debug 2.2.4
  60.  
  61. rvm use 2.2.4 --default
  62.  
  63.  
  64. # we're done !
  65. ###############################################################################
  66. cd $wd
  67. rm -rf $tmpdir
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement