#!/bin/sh
case $# in
  1) installdir=$1/mexplorer;;
  *) installdir=/usr/local/mexplorer;;
esac
echo Remove old files...
if test -d $installdir
then rm -rf $installdir
fi
echo Copy installation files to $installdir ...
mkdir $installdir
mkdir $installdir/bin
mkdir $installdir/resource
tar xzf meinstaller*.tar.gz -C $installdir/bin
mv -f $installdir/bin/mexplorer /usr/local/bin
(
cd $installdir/bin;
mv mexplorer.png ../resource
ln -sf libCxImage.so.7.0.2 libCxImage.so;
ln -sf libproj.so.0.4.1 libproj.so.0;
ln -sf libproj.so.0 libproj.so;
ln -sf libwgrib.so.1.8 libwgrib.so.1;
ln -sf libwgrib.so.1 libwgrib.so;
ln -sf libhdf5.so.6.0.4 libhdf5.so.6;
ln -sf libhdf5.so.6 libhdf5.so;
ln -sf libnetcdf.so.7.1.1 libnetcdf.so.7;
ln -sf libnetcdf.so.7 libnetcdf.so;
tar xvzf zht.tar.gz > /dev/null 2>&1;
)
echo Done.
