Permalink
Browse files

Merge pull request #18 from larzconwell/master

Distro install enhancements
  • Loading branch information...
2 parents d79902e + ffdfafc commit c842af602b67e4f52f6dc339f934b874199baebe @joshfng committed Feb 8, 2012
Showing with 34 additions and 15 deletions.
  1. +4 −3 railsready.sh
  2. +15 −6 recipes/centos.sh
  3. +15 −6 recipes/ubuntu.sh
View
@@ -19,6 +19,7 @@ ruby_source_dir_name="ruby-1.9.3-p0"
script_runner=$(whoami)
railsready_path=$(cd && pwd)/railsready
log_file="$railsready_path/install.log"
+railsready_recipes_path="https://raw.github.com/joshfng/railsready/master/recipes"
control_c()
{
@@ -48,7 +49,7 @@ elif [[ $MACHTYPE = *darwin* ]] ; then
if [[ ! -s /Library/Developer/Shared/XcodeTools.plist ]] ; then
echo -e "\nXCode must be installed in order to build required software.\n"
exit 1
- fi
+ fi
else
echo -e "\nRails Ready currently only supports Ubuntu and CentOS and OSX\n"
exit 1
@@ -103,9 +104,9 @@ echo "==> done..."
echo -e "\n=> Downloading and running recipe for $distro...\n"
#Download the distro specific recipe and run it, passing along all the variables as args
if [[ $MACHTYPE = *linux* ]] ; then
- wget --no-check-certificate -O $railsready_path/src/$distro.sh https://raw.github.com/joshfng/railsready/master/recipes/$distro.sh && cd $railsready_path/src && bash $distro.sh $ruby_version $ruby_version_string $ruby_source_url $ruby_source_tar_name $ruby_source_dir_name $whichRuby $railsready_path $log_file
+ wget --no-check-certificate -O $railsready_path/src/$distro.sh $railsready_recipes_path/$distro.sh && cd $railsready_path/src && bash $distro.sh $ruby_version $ruby_version_string $ruby_source_url $ruby_source_tar_name $ruby_source_dir_name $whichRuby $railsready_path $log_file
else
- cd $railsready_path/src && curl -O https://raw.github.com/joshfng/railsready/master/recipes/$distro.sh && bash $distro.sh $ruby_version $ruby_version_string $ruby_source_url $ruby_source_tar_name $ruby_source_dir_name $whichRuby $railsready_path $log_file
+ cd $railsready_path/src && curl -O $railsready_recipes_path/$distro.sh && bash $distro.sh $ruby_version $ruby_version_string $ruby_source_url $ruby_source_tar_name $ruby_source_dir_name $whichRuby $railsready_path $log_file
fi
echo -e "\n==> done running $distro specific commands..."
View
@@ -42,11 +42,20 @@ sudo yum install -y gcc-c++ patch \
echo "==> done..."
# Install imagemagick
-echo -e "\n=> Installing imagemagick (this may take a while)..."
-sudo yum install -y ImageMagick >> $log_file 2>&1
-echo "==> done..."
+# Convert is a part of imagemagick
+if [ ! -f $(which convert) ]; then
+ echo -e "\n=> Installing imagemagick (this may take a while)..."
+ sudo yum install -y ImageMagick >> $log_file 2>&1
+ echo "==> done..."
+else
+ echo "==> ImageMagick already installed..."
+fi
# Install Git
-echo -e "\n=> Installing git..."
-sudo yum install -y git >> $log_file 2>&1
-echo "==> done..."
+if [ ! -f $(which git) ]; then
+ echo -e "\n=> Installing git..."
+ sudo yum install -y git >> $log_file 2>&1
+ echo "==> done..."
+else
+ echo "==> Git already installed..."
+fi
View
@@ -52,11 +52,20 @@ sudo $pm -y install libsqlite3-0 sqlite3 libsqlite3-dev libmysqlclient16-dev lib
echo "==> done..."
# Install imagemagick
-echo -e "\n=> Installing imagemagick (this may take a while)..."
-sudo $pm -y install imagemagick libmagick9-dev >> $log_file 2>&1
-echo "==> done..."
+# Convert is a part of imagemagick
+if [ ! -f $(which convert) ]; then
+ echo -e "\n=> Installing imagemagick (this may take a while)..."
+ sudo $pm -y install imagemagick libmagick9-dev >> $log_file 2>&1
+ echo "==> done..."
+else
+ echo "==> ImageMagick already installed..."
+fi
# Install git-core
-echo -e "\n=> Installing git..."
-sudo $pm -y install git-core >> $log_file 2>&1
-echo "==> done..."
+if [ ! -f $(which git) ]; then
+ echo -e "\n=> Installing git..."
+ sudo $pm -y install git-core >> $log_file 2>&1
+ echo "==> done..."
+else
+ echo "==> Git already installed..."
+fi

0 comments on commit c842af6

Please sign in to comment.