Skip to content

Commit

Permalink
Moved system requirements functionality into scripts/requirements
Browse files Browse the repository at this point in the history
Removed text now in scripts/requirements from scripts/notes
Added display_requirements() function to installer function
Added display_requirements to scripts/install
Reordered text display in scripts/install to display the notes first and
then the requirements per platform, such that most pertinent information
is displayed first. This WILL be revisisted! This is just to partially
deal with the "Wall of Text" syndrome. Tested on local system. Works as
expected.
  • Loading branch information
Deryl R. Doucette committed Sep 27, 2011
1 parent dfeecb0 commit c6e79b3
Show file tree
Hide file tree
Showing 4 changed files with 171 additions and 183 deletions.
10 changes: 10 additions & 0 deletions scripts/functions/installer
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,16 @@ display_notes()
fi
}

display_requirements()
{
true ${upgrade_flag:=0}
if [[ $upgrade_flag -eq 0 ]]
then
chmod +x ./scripts/requirements # Sometimes things don't clone properly :/
./scripts/requirements
fi
}

#
# root install functions.
#
Expand Down
5 changes: 3 additions & 2 deletions scripts/install
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ setup_user_profile

cleanup_tmp_files

display_notes

display_thank_you

display_notes

display_requiremenets
182 changes: 1 addition & 181 deletions scripts/notes
Original file line number Diff line number Diff line change
@@ -1,185 +1,5 @@
#!/usr/bin/env bash

system="$(uname)"

if [[ "Linux" = "$system" ]]
then
for file in /etc/*-release
do
release="( $(cat $file) )"
break
done
printf "\n\nNotes for ${system} $release\n"

rvm_apt_binary="$(command -v apt-get)"
rvm_emerge_binary="$(command -v emerge)"
rvm_pacman_binary="$(command -v pacman)"
rvm_yum_binary="$(command -v yum)"
rvm_zypper_binary="$(command -v zypper)"
rvm_free_ram_mb="$(free -m | awk '{if (NR==3) print $4}')"

printf "
NOTE: 'ruby' represents Matz's Ruby Interpreter (MRI) (1.8.X, 1.9.X)
This is the *original* / standard Ruby Language Interpreter
'ree' represents Ruby Enterprise Edition
'rbx' represents Rubinius
bash >= 3.2 is required
curl is required
git is required (>= 1.7 recommended)
patch is required (for ree and some ruby-head's).
If you wish to install rbx and/or Ruby 1.9 head (MRI) (eg. 1.9.2-head),
then you must install and use rvm 1.8.7 first.
If you wish to have the 'pretty colors' again,
set 'export rvm_pretty_print_flag=1' in ~/.rvmrc.
"

if [[ ! -z "$rvm_apt_binary" ]]
then
printf "
dependencies:
# For RVM
rvm: bash curl git
# For Ruby (MRI, Rubinius, & REE) you should install the following OS dependencies:
ruby: ${rvm_apt_binary} install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison
# For JRuby (if you wish to use it) you will need:
jruby: ${rvm_apt_binary} install curl g++ openjdk-6-jre-headless
jruby-head: ${rvm_apt_binary} install ant openjdk-6-jdk
# In addition to ruby: dependencies,
ruby-head: subversion
# For IronRuby (if you wish to use it) you will need:
ironruby: ${rvm_apt_binary} install curl mono-2.0-devel
"

elif [[ ! -z "$rvm_emerge_binary" ]]
then
printf "
dependencies:
# For RVM
rvm: bash curl git
# For MRI based rubies you will need:
ruby: emerge libiconv readline zlib openssl curl git libyaml sqlite libxslt libtool bison
ruby-head: gcc bison autoconf automake m4
# For JRuby (if you wish to use it) you will need:
jruby: emerge dev-java/sun-jdk dev-java/sun-jre-bin
# For IronRuby (if you wish to use it) you will need:
ironruby: emerge dev-lang/mono
"

elif [[ ! -z "$rvm_pacman_binary" ]]
then
printf "
dependencies:
# For RVM itself
rvm: bash curl git
# For Ruby (MRI & Ree) you should install the following OS dependencies:
ruby: pacman -Sy --noconfirm gcc patch curl zlib readline libxml2 libxslt git autoconf diffutils make libtool bison
ruby-head: pacman -Sy --noconfirm subversion
# For JRuby (if you wish to use it) you will need:
jruby: pacman -Sy --noconfirm jdk jre curl
# For IronRuby (if you wish to use it) you will need:
ironruby: pacman -Sy --noconfirm mono
"

elif [[ ! -z "$rvm_yum_binary" ]]
then
printf "
dependencies:
# For RVM
rvm: yum install -y bash curl git libxslt # NOTE: For git you need the EPEL repository enabled
# For Ruby (MRI & Ree) you should install the following OS dependencies:
ruby: yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel ;
yum install -y make bzip2 autoconf automake libtool bison ; # libtool, automake, autoconf, bison required for ruby-head
yum install -y iconv-devel # NOTE: For centos >= 5.4 inconv-devel is provided by glibc
# For JRuby (if you wish to use it) you will need:
jruby: yum install -y java
"

elif [[ ! -z "$rvm_zypper_binary" ]]
then
printf "
dependencies:
# For RVM
rvm: sudo zypper install -y bash curl git
# For Ruby (MRI & Ree) you should install the following OS dependencies:
ruby: sudo zypper install -y patterns-openSUSE-devel_basis gcc-c++ bzip2 readline-devel zlib-devel \\
libxml2-devel libxslt-devel libyaml-devel libopenssl-devel libffi45-devel \\
libtool bison
# For JRuby (if you wish to use it) you will need:
jruby: sudo zypper install -y java-1_6_0-sun # Non-Oss repository required
"

else
printf "
dependencies:
# RVM
rvm: bash curl git
# For Ruby (MRI & Ree) you should install the following OS dependencies:
ruby: # gcc-c++ patch readline zlib libyaml iconv libxml2 libxslt libtool bison
# For JRuby (if you wish to use it) you will need:
jruby: # The SUN java runtime environment and development kit.
# For IronRuby (if you wish to use it) you will need:
ironruby: #The Mono Runtime and Development Platform (version 2.6 or greater is recommended).
"
fi
if [[ $rvm_free_ram_mb -le 600 ]]
then
printf "\nFor rbx (Rubinius) more than 600MB of free RAM is required.\n"
fi
elif [[ "$MACHTYPE" = *darwin* ]]
then

release="( $(sw_vers -productName) )"

printf "
Notes for ${system} $release
For Snow Leopard be sure to have Xcode Tools Version 3.2.1 (1613) or later
You should download the latest Xcode tools from developer.apple.com.
(This is since the dvd install for Snow Leopard contained bugs).
If you intend on installing MacRuby you must install LLVM first.
If you intend on installing JRuby you must install the JDK.
If you intend on installing IronRuby you must install Mono
(version 2.6 or greater is recommended).
To use an RVM installed Ruby as default instead of the system ruby:
rvm install 1.8.7 # installs patch 352: closest supported version
rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system # migrate your gems
rvm --default 1.8.7
"
if (( UID == 0 ))
then
echo "
NOTE:
You have installed RVM as a multi-user install. You MUST add users to the rvm group.
Run the following commands as a user to make this happen
root# dscl localhost -append /Local/Default/Groups/rvm GroupMembership \"{{the username goes here}}\"\n
"
fi
fi
printf "\n\033[32mNOTE:\033[0m
As of 1.8.0 RVM once again loads .rvmrc files, by default, after asking your
permission to trust it of course. If you do not wish to be enabled, simply set:
Expand All @@ -190,6 +10,6 @@ cd/pushd hooks when sourcing the rvm() function into your shell.

printf "\n\r \033[32mExample: echo 'export rvm_project_rvmrc=0' >> \$HOME/.rvmrc;
(Then close the current shell and open a new one.)\n"
printf " If you wish to add this for all users, exchange \$HOME/.rvmrc for /etc/rvmrc\033[0m\n"
printf " If you wish to add this for all users, exchange \$HOME/.rvmrc with /etc/rvmrc\033[0m\n"

echo
157 changes: 157 additions & 0 deletions scripts/requirements
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
#!/usr/bin/env bash

system="$(uname)"

if [[ "Linux" = "$system" ]]
then
for file in /etc/*-release
do
release="( $(cat $file) )"
break
done
printf "\n\nRequirements for ${system} $release\n"

rvm_apt_binary="$(command -v apt-get)"
rvm_emerge_binary="$(command -v emerge)"
rvm_pacman_binary="$(command -v pacman)"
rvm_yum_binary="$(command -v yum)"
rvm_zypper_binary="$(command -v zypper)"
rvm_free_ram_mb="$(free -m | awk '{if (NR==3) print $4}')"

printf "
NOTE: 'ruby' represents Matz's Ruby Interpreter (MRI) (1.8.X, 1.9.X)
This is the *original* / standard Ruby Language Interpreter
'ree' represents Ruby Enterprise Edition
'rbx' represents Rubinius
bash >= 3.2 is required
curl is required
git is required (>= 1.7 recommended)
patch is required (for ree and some ruby-head's).
If you wish to install rbx and/or Ruby 1.9 head (MRI) (eg. 1.9.2-head),
then you must install and use rvm 1.8.7 first.
"

if [[ ! -z "$rvm_apt_binary" ]]
then
printf "
dependencies:
# For Ruby (MRI, Rubinius, & REE) you should install the following OS dependencies:
ruby: ${rvm_apt_binary} install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison
# For JRuby (if you wish to use it) you will need:
jruby: ${rvm_apt_binary} install curl g++ openjdk-6-jre-headless
jruby-head: ${rvm_apt_binary} install ant openjdk-6-jdk
# In addition to ruby: dependencies,
ruby-head: subversion
# For IronRuby (if you wish to use it) you will need:
ironruby: ${rvm_apt_binary} install curl mono-2.0-devel
"

elif [[ ! -z "$rvm_emerge_binary" ]]
then
printf "
dependencies:
# For MRI based rubies you will need:
ruby: emerge libiconv readline zlib openssl curl git libyaml sqlite libxslt libtool bison
ruby-head: gcc bison autoconf automake m4
# For JRuby (if you wish to use it) you will need:
jruby: emerge dev-java/sun-jdk dev-java/sun-jre-bin
# For IronRuby (if you wish to use it) you will need:
ironruby: emerge dev-lang/mono
"

elif [[ ! -z "$rvm_pacman_binary" ]]
then
printf "
# For Ruby (MRI & Ree) you should install the following OS dependencies:
ruby: pacman -Sy --noconfirm gcc patch curl zlib readline libxml2 libxslt git autoconf diffutils make libtool bison
ruby-head: pacman -Sy --noconfirm subversion
# For JRuby (if you wish to use it) you will need:
jruby: pacman -Sy --noconfirm jdk jre curl
# For IronRuby (if you wish to use it) you will need:
ironruby: pacman -Sy --noconfirm mono
"

elif [[ ! -z "$rvm_yum_binary" ]]
then
printf "
dependencies:
# For Ruby (MRI & Ree) you should install the following OS dependencies:
ruby: yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel ;
yum install -y make bzip2 autoconf automake libtool bison ; # libtool, automake, autoconf, bison required for ruby-head
yum install -y iconv-devel # NOTE: For centos >= 5.4 inconv-devel is provided by glibc
# For JRuby (if you wish to use it) you will need:
jruby: yum install -y java
"

elif [[ ! -z "$rvm_zypper_binary" ]]
then
printf "
dependencies:
# For Ruby (MRI & Ree) you should install the following OS dependencies:
ruby: sudo zypper install -y patterns-openSUSE-devel_basis gcc-c++ bzip2 readline-devel zlib-devel \\
libxml2-devel libxslt-devel libyaml-devel libopenssl-devel libffi45-devel \\
libtool bison
# For JRuby (if you wish to use it) you will need:
jruby: sudo zypper install -y java-1_6_0-sun # Non-Oss repository required
"

else
printf "
dependencies:
# For Ruby (MRI & Ree) you should install the following OS dependencies:
ruby: # gcc-c++ patch readline zlib libyaml iconv libxml2 libxslt libtool bison
# For JRuby (if you wish to use it) you will need:
jruby: # The SUN java runtime environment and development kit.
# For IronRuby (if you wish to use it) you will need:
ironruby: #The Mono Runtime and Development Platform (version 2.6 or greater is recommended).
"
fi
elif [[ "$MACHTYPE" = *darwin* ]]
then

release="( $(sw_vers -productName) )"

printf "
Notes for ${system} $release
For Snow Leopard be sure to have Xcode Tools Version 3.2.1 (1613) or later
You should download the latest Xcode tools from developer.apple.com.
(This is since the dvd install for Snow Leopard contained bugs).
If you intend on installing MacRuby you must install LLVM first.
If you intend on installing JRuby you must install the JDK.
If you intend on installing IronRuby you must install Mono
(version 2.6 or greater is recommended).
To use an RVM installed Ruby as default instead of the system ruby:
rvm install 1.8.7 # installs patch 352: closest supported version
rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system # migrate your gems
rvm --default 1.8.7
"
if (( UID == 0 ))
then
echo "
NOTE:
You have installed RVM as a multi-user install. You MUST add users to the rvm group.
Run the following commands as a user to make this happen
root# dscl localhost -append /Local/Default/Groups/rvm GroupMembership \"{{the username goes here}}\"\n
"
fi
fi

0 comments on commit c6e79b3

Please sign in to comment.