# Ruby 1.8.6pl14
# ==============
# Slackware 11.0's 'ruby' package includes version 1.8.4, 12.0's includes
# 1.8.6
# Before there were Slackware packages for Ruby, this howto used to use
# the configure script's defaults (/usr/local) for installing Ruby, but
# now it puts it in /usr to match where Slackware puts it - so we don't
# break things that use Ruby. If you have a /usr/local installed copy
# of Ruby, run something like "find /usr/local | grep ruby" and zap all
# of that.
# If you want to remove _everything_ from Ruby in /usr and /usr/local,
# skip down to the bottom. That (in /usr) will include things that
# KDE packages put there.
cd
test -f installed/ruby-1.8.6-p114.tar.gz &&
mv installed/ruby-1.8.6-p114.tar.gz .
test ! -f ruby-1.8.6-p114.tar.gz &&
wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p114.tar.gz
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "ruby-*" -exec rm -r {} \;
tar xzvf ~/ruby-1.8.6-p114.tar.gz
cd ruby-1.8.6-p114
test $UID = 0 && chown -R root:root .
# If you don't want/need the 'rdoc' docs, or if you're in a hurry
# (it takes a while to generate them), leave off --enable-install-doc
./configure --prefix=/usr --datadir=/usr/share --mandir=/usr/man \
--enable-shared --enable-install-doc
make
make test
# Become root to install it
su
# Remove the Slackware package, if there is one, old library files
test -x /sbin/removepkg && /sbin/removepkg ruby
rm -f /usr/lib/libruby.so* /usr/lib/libruby-static.a
# Install it
make install
ldconfig
# Make sure your non-root account can remove the source later
chown -R $USER .
chmod -R u+w .
# Become your non-root self again
exit
# To read Ruby-related info:
# Run 'man ruby'
# Run 'ri'
# Go to the Ruby web site (link at the top)
# If you ever want to uninstall Ruby, this should do it:
cd
su
for pfx in /usr /usr/local;
do
( cd ${pfx}/bin ; rm -f erb irb rdoc ri ruby testrb )
test -d ${pfx}/lib/ruby && rm -r ${pfx}/lib/ruby
test -d ${pfx}/lib/ruby_lib && rm -r ${pfx}/lib/ruby_lib
rm -f ${pfx}/lib/libruby-static.a ${pfx}/man/man1/ruby.1
done
exit
find ~/src -maxdepth 1 -type d -name "ruby-*" -exec rm -r {} \;
rm -f ~/installed/ruby-*.tar.*