Report abuse

#!/bin/sh
#
# Install ImageMagick and RMagick on Snow Leopard - 9/2/09
# 
#
# Install freetype

curl -O http://mirror.csclub.uwaterloo.ca/nongnu/freetype/freetype-2.3.9.tar.gz
tar zxvf freetype-2.3.9.tar.gz
cd freetype-2.3.9
./configure --prefix=/usr/local
make
sudo make install
cd ..

# Install libpng

curl -O ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.2.39.tar.bz2
tar jxvf libpng-1.2.39.tar.bz2
cd libpng-1.2.39
./configure --enable-shared --prefix=/usr/local
make
sudo make install
cd ..

# Install libjpeg

curl -O http://www.ijg.org/files/jpegsrc.v7.tar.gz
tar xzvf jpegsrc.v7.tar.gz
cd jpeg-7
ln -s `which glibtool` ./libtool
export MACOSX_DEPLOYMENT_TARGET=10.6
./configure --enable-shared --prefix=/usr/local
make
sudo make install
cd ..

# Install tiff

curl -O http://dl.maptools.org/dl/libtiff/tiff-3.8.2.tar.gz
tar xzvf tiff-3.8.2.tar.gz
cd tiff-3.8.2
./configure --prefix=/usr/local
make
sudo make install
cd .. 

# Install wmf
# download with wget; using curl -O resulted file format errors

curl -O http://ftp.gnu.org/gnu/wget/wget-latest.tar.gz
tar xzvf wget-latest.tar.gz
cd wget-*
./configure --prefix=/usr/local
make
sudo make install
cd ..

wget http://jaist.dl.sourceforge.net/sourceforge/wvware/libwmf-0.2.8.4.tar.gz
tar xzvf libwmf-0.2.8.4.tar.gz
cd libwmf-0.2.8.4
./configure --prefix=/usr/local
make
sudo make install
cd ..

# Install ghostscript fonts

curl -O http://ghostscript.com/releases/ghostscript-8.70.tar.gz
tar zxvf ghostscript-8.70.tar.gz
cd ghostscript-8.70
./configure --prefix=/usr/local
make
sudo make install
cd ..

curl -O http://surfnet.dl.sourceforge.net/project/gs-fonts/gs-fonts/8.11%20%28base%2035%2C%20GPL%29/ghostscript-fonts-std-8.11.tar.gz
tar zxvf ghostscript-fonts-std-8.11.tar.gz
sudo mv fonts /usr/local/share/ghostscript

# Install ImageMagick

curl -O ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.5.6-1.tar.gz
tar xzvf ImageMagick-6.5.6-1.tar.gz
cd ImageMagick-6.5.6-1
export CPPFLAGS=-I/usr/local/include
export LDFLAGS=-L/usr/local/lib
./configure --prefix=/usr/local --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --with-gs-font-dir=/usr/local/share/ghostscript/fonts
make
sudo make install
cd ..

# Install RMagick

sudo gem install rmagick