2007-03-13 23:02:46 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
TAR=@TAR@
|
|
|
|
ZCAT=@ZCAT@
|
|
|
|
WGET=@WGET@
|
|
|
|
CURL=@CURL@
|
|
|
|
|
2009-02-19 23:38:54 -05:00
|
|
|
if [ -f "$WGET" ] ; then
|
2007-03-13 23:02:46 -04:00
|
|
|
DOWNLOAD_CMD=$WGET
|
|
|
|
else
|
2009-02-19 23:38:54 -05:00
|
|
|
if [ -f "$CURL" ] ; then
|
2007-03-13 23:02:46 -04:00
|
|
|
DOWNLOAD_CMD="$CURL -O"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2007-03-21 19:42:16 -04:00
|
|
|
base=http://svn.freeswitch.org/downloads/libs/
|
2007-03-13 23:02:46 -04:00
|
|
|
tarfile=$1
|
2007-03-21 19:42:16 -04:00
|
|
|
url=`echo $tarfile | grep "://"`
|
|
|
|
|
|
|
|
if [ ! -z $url ] ; then
|
|
|
|
base=$tarfile/
|
|
|
|
tarfile=$2
|
|
|
|
fi
|
2007-03-13 23:02:46 -04:00
|
|
|
|
|
|
|
if [ ! -d $tarfile ] ; then
|
|
|
|
uncompressed=`echo $tarfile | sed "s/\.tar\.gz//g"`
|
|
|
|
uncompressed=`echo $uncompressed | sed "s/\.tgz//g"`
|
|
|
|
|
|
|
|
if [ ! -f $tarfile ] ; then
|
|
|
|
rm -fr $uncompressed
|
2007-03-21 19:42:16 -04:00
|
|
|
$DOWNLOAD_CMD $base$tarfile
|
2007-03-13 23:02:46 -04:00
|
|
|
if [ ! -f $tarfile ] ; then
|
|
|
|
echo cannot find $tarfile
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ ! -d $uncompressed ] ; then
|
|
|
|
$ZCAT -c -d $tarfile | $TAR xf -
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
|