# SWIG 2.0.10 (Simplified Wrapper and Interface Generator)
# ===========
# Prerequisites:
# PCRE
# boost >= 1.20.0
# SWILL (optional; I don't have it...)
# XFree86 or X.org (optional)
# TCL (optional)
# Python (optional)
# Perl (optional)
# Java (optional)
# Guile (optional)
# mzscheme (optional)
# Ruby (optional)
# PHP (optional) (here is my apache 1.x howto, here is my apache 2.x howto)
# OCaml (optional)
# pike (optional)
# chicken (optional)
# Mono (optional)
# Lua (optional)
# ...
# zlib
# Get it
cd
test -f installed/swig-2.0.10.tar.gz &&
mv installed/swig-2.0.10.tar.gz .
test ! -f swig-2.0.10.tar.gz &&
wget http://downloads.sf.net/swig/swig-2.0.10.tar.gz
# Extract the source
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "swig-*" -exec rm -r {} \;
tar xzvf ~/swig-2.0.10.tar.gz
cd swig-2.0.10
test $UID = 0 && chown -R root:root .
# Configure the build and build it
./configure --mandir=/usr/local/man
make
# Test it (takes a while)
make -k check
# Become root to install it
su
# If this is an upgrade, you may want to clean up /usr/local/share/swig/*
# directories from older versions
# Install it
make install
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become your non-root user again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/swig-*.tar.*
mv swig-2.0.10.tar.gz installed/
# If you ever want to uninstall SWIG, this should do it:
cd
su
test -d src/swig-* && ( cd src/swig-* ; make uninstall )
( cd /usr/local/bin ; ccache-swig swig )
rm -f /usr/local/man/man1/ccache-swig.1
test -d /usr/local/share/swig && rm -r /usr/local/share/swig
exit
find ~/src -maxdepth 1 -type d -name "swig-*" -exec rm -r {} \;
rm -f ~/installed/swig-*.tar.*