sabato 4 dicembre 2010

BASH: script per installare Maxima su RHEL

Installare maxima (e clisp) su Red Hat Enterprise Linux con un solo script.

 #!/bin/bash

rpmurl=http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/
rpmname=rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

url=http://sourceforge.net/projects/maxima/files/Maxima-source/
versionurl=5.22.1-source/maxima-5.22.1.tar.gz/download

yum search clisp

if [ $? -ne 0 ] ; then
rpm -Uhv ${rpmurl}${rpmname}

if [ $? -ne 0 ] ; then
echo "[install.sh] Unable to install rpm repository."
exit 1
fi
fi

yum -y install clisp

if [ $? -ne 0 ] ; then
echo "[install.sh] Unable to install clisp."
exit 1
fi

if [ ! -f "maxima-5.22.1.tar.gz" ] ; then
wget ${url}${versionurl}

if [ $? -ne 0 ] ; then
echo "[install.sh] Unable to download Maxima source."
exit 1
fi
fi


if [ ! -d "maxima-5.22.1" ] ; then
tar xzvf maxima-5.22.1.tar.gz

if [ $? -ne 0 ] ; then
echo "[install.sh] Unable to extract Maxima archive."
exit 1
fi
fi

cd maxima-5.22.1

./configure

if [ $? -ne 0 ] ; then
echo "[install.sh] Maxima configure failed."
exit 1
fi

make

if [ $? -ne 0 ] ; then
echo "[install.sh] Maxima make failed."
exit 1
fi

make install

if [ $? -ne 0 ] ; then
echo "[install.sh] Maxima make install failed."
exit 1
fi

cd ..

rm -r maxima-5.22.1
rm maxima-5.22.1.tar.gz

exit 0


NOTA: su alcuni sistemi il metodo qui utilizzato per l'installazione di CLISP non funziona, di conseguenza fallisce l'intera installazione.

Nessun commento:

Posta un commento