#!/bin/sh # # Rubysetup.cgi # # ### NOTE on 2005/9/11 ### # # # # PowWeb has disabled gcc and this script will not work "as is" anymore. # # # ######################### # # This script will Download, configure, build, and install Ruby in your own directorty, # step by step, automatically. # # Put it into a protected directory and set permission of 700, then access it. # The path to Ruby will be "/www/U/USER/bin/ruby" echo echo "======== Ruby setup script for PowWeb ========" exec 2>&1 exitnow () { echo " Restart (F5) this script to coninue the setup" exit } USER=`whoami` HOME="/www/${USER%${USER#?}}/$USER" cd $HOME if [ ! -e ruby-1.8.2.tar.gz ] ; then echo "Source tarball not found. Downloading 'wget -nd ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.2.tar.gz' ..." wget -nd ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.2.tar.gz exitnow fi if [ ! -d ruby-1.8.2 ] ; then echo "Source directory not found. Extracting 'tar -xzvf ruby-1.8.2.tar.gz' ..." tar -xzvf ruby-1.8.2.tar.gz exitnow fi cd ruby-1.8.2 if [ ! -e Makefile ] ; then echo "Makefile not found. Running './configure --prefix=$HOME' ..." ./configure --prefix=$HOME exitnow fi if [ ! -e ruby ] ; then echo "Ruby binary not found. Running 'make' ..." make exitnow fi if [ ! -e $HOME/bin/ruby ] ; then echo "Ruby installation not found. Running 'make install' ..." make install fi echo " All done. Test run Ruby : '$HOME/bin/ruby -v' ... " $HOME/bin/ruby -v # end