#!/bin/bash
LIBDIR=/usr/local/lib
INCLUDEDIR=/usr/local/include
GREP_RESULT=`grep /usr/local/lib /etc/ld.so.conf`
if [ -z "$GREP_RESULT" ]; then
	echo >> /etc/ld.so.conf
	echo $LIBDIR >> /etc/ld.so.conf
fi
cp -f *.so $LIBDIR
cp -f *.h $INCLUDEDIR
for NAME in encore decore ; do
    LIBNAME=${LIBDIR}/libdivx${NAME}.so
    chown 0 $LIBNAME
    chmod 755 $LIBNAME
    rm -f $LIBNAME.0
    ln -s $LIBNAME $LIBNAME.0
    chown 0 $LIBNAME.0
    chmod 755 $LIBNAME.0
done
/sbin/ldconfig
