forked from Mirrors/freeswitch
0fd698a347
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@192 d0543943-73ff-0310-b7d9-9358b9ac24b2
72 lines
906 B
Bash
Executable File
72 lines
906 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ -f .nodepends ] ; then
|
|
exit 0
|
|
fi
|
|
|
|
root=$1
|
|
shift
|
|
|
|
|
|
install=
|
|
base=http://www.sofaswitch.com/mikej
|
|
|
|
if [ ! -z $1 ] && [ $1 = install ] ; then
|
|
install=1
|
|
shift
|
|
fi
|
|
|
|
tar=$1
|
|
shift
|
|
|
|
cd $root/libs/.
|
|
CFLAGS=
|
|
LDFLAGS=
|
|
MAKEFLAGS=
|
|
|
|
if [ -d $tar ] ; then
|
|
uncompressed=$tar
|
|
tar=
|
|
else
|
|
uncompressed=`echo $tar | sed "s/\.tar\.gz//g"`
|
|
if [ ! -f $tar ] ; then
|
|
rm -fr $uncompressed
|
|
wget $base/$tar
|
|
if [ ! -f $tar ] ; then
|
|
echo cannot find $tar
|
|
exit
|
|
fi
|
|
tar -zxvf $tar
|
|
fi
|
|
fi
|
|
|
|
if [ -f $uncompressed/.complete ] ; then
|
|
echo $uncompressed already installed
|
|
exit 0
|
|
fi
|
|
|
|
cd $uncompressed
|
|
make clean 2>&1
|
|
sh ./configure --prefix=/usr/local $@
|
|
|
|
if [ $? == 0 ] ; then
|
|
make
|
|
else
|
|
echo ERROR
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -z $install ] ; then
|
|
make install
|
|
ldconfig 2>&1
|
|
fi
|
|
|
|
if [ $? == 0 ] ; then
|
|
touch .complete
|
|
else
|
|
echo ERROR
|
|
exit 1
|
|
fi
|
|
|
|
exit 0
|