#! /bin/sh


umask 0

PATH=/usr/bin:/bin:$PATH

quit() {
    echo "Exiting..."
    exit 1
}

R64=`cat -s .r64`

INSTALL_DIR=`cat -s .emos`

mkdir -p $INSTALL_DIR | true

echo
echo "*******************************************************************"
echo  "If you have choosen default directories for BUFR tables or "
echo  "libbufr$R64.a you must have root permission to do that."
echo "*******************************************************************"
echo

echo "Installing Bufr library and  tables in $INSTALL_DIR ..."

trap "" 2 3

cp -r bufrtables $INSTALL_DIR
cp libbufr$R64.a $INSTALL_DIR
echo

echo "*******************************************************************"
echo
echo "Installation complete!"
echo
echo "*******************************************************************"
echo
echo "   You can see examples of decoding/encoding BUFR data and how to "
echo "make Makefile for that purpose in example directory. "
echo
echo "./bufr_decode_all -i ../data/ISMD01_OKPR.bufr"
echo
echo "*******************************************************************"

exit 0


