#!/usr/bin/env bash system="$(uname)" item="$(tput setaf 2)* $(tput sgr0)" if [[ "Linux" = "$system" ]] ; then for file in /etc/*-release ; do release="( $(cat $file) )" ; break done echo -e "\n$(tput setaf 2)Notes for ${system} $release$(tput sgr0)\n" rvm_apt_get_binary="$(command -v aptitude)" rvm_emerge_binary="$(command -v emerge)" rvm_pacman_binary="$(command -v pacman)" rvm_yum_binary="$(command -v yum)" echo -e "\n $item curl is required.\n" echo -e "\n $item patch is required (for ree, some ruby head's).\n" if [[ ! -z "$rvm_apt_get_binary" ]] ; then echo -e " $item For JRuby (if you wish to use it) you will need:" echo -e "\n $ aptitude install curl sun-java6-bin sun-java6-jre sun-java6-jdk" echo -e "\n $item For MRI & ree (if you wish to use it) you will need:" echo -e "\n $ aptitude install curl bison build-essential zlib1g zlib1g-dev libssl-dev libreadline5-dev libreadline6-dev libxml2-dev git-core subversion autoconf" echo -e "\n $item For IronRuby (if you wish to use it) you will need:" echo -e "\n $ aptitude install curl mono-2.0-devel" elif [[ ! -z "$rvm_emerge_binary" ]] ; then echo -e " $item For JRuby (if you wish to use it) you will need:" echo -e "\n $ emerge dev-java/sun-jdk dev-java/sun-jre-bin" echo -e "\n $item For IronRuby (if you wish to use it) you will need:" echo -e "\n $ emerge dev-lang/mono" elif [[ ! -z "$rvm_pacman_binary" ]] ; then echo -e " $item For MRI based rubies you will need:" echo -e "\n $ pacman -Sy autoconf diffutils patch curl bison zlib readline libxml2 git" echo -e " $item For JRuby (if you wish to use it) you will need:" echo -e "\n $ pacman -Sy jdk jre curl" echo -e "\n $item For IronRuby (if you wish to use it) you will need:" echo -e "\n $ pacman -Sy mono" elif [[ ! -z "$rvm_yum_binary" ]] ; then echo -e " $item For MRI/ree (if you wish to use it) you will need:" echo -e "\n $ yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel" echo -e "\n $ yum install -y iconv-devel # NOTE: For centos 5.4 final iconv-devel might not be available :(" echo -e "\n $item For JRuby (if you wish to use it) you will need:" echo -e "\n $ yum install -y java" else echo -e " $item For JRuby (if you wish to use it) you will need:" echo -e "\n The SUN java runtime environment and development kit." echo -e "\n $item For IronRuby (if you wish to use it) you will need:" echo -e "\n The Mono Runtime and Development Platform (version 2.6 or greater is recommended)." fi elif [[ "Darwin" = "$system" ]] ; then release="( $(sw_vers -productName) )" echo -e "\n$(tput setaf 2)Notes for ${system} $release $(tput sgr0)\n" echo -e "\n $item For Snow Leopard be sure to have XCode Tools Version 3.2.1 (1613) or later (there were bugs with the dvd release version)." echo -e "\n $item You should download the latest XCode tools from developer.apple.com. This is necessary since the dvd install for Snow Leopard has bugs." echo -e "\n $item If you intend on installing MacRuby you must install LLVM first." echo -e "\n $item If you intend on installing JRuby you must install the JDK." echo -e "\n $item If you intend on installing IronRuby you must install Mono (version 2.6 or greater is recommended)." fi echo