mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
add tools to install dependencies
This commit is contained in:
13
tools/config.sh
Executable file
13
tools/config.sh
Executable file
@ -0,0 +1,13 @@
|
||||
# prefix is without slash
|
||||
# default for redhat is /usr
|
||||
SFL_PREFIX=/home/$USER/sflphone
|
||||
SFL_INSTALL_USER=$USER # could be root too...
|
||||
LD_LIBRARY_PATH=$SFL_PREFIX/lib:$LD_LIBRARY_PATH
|
||||
|
||||
SFL_FILE_CCPP2=http://easynews.dl.sourceforge.net/sourceforge/gnutelephony/commoncpp2-1.3.20.tar.gz
|
||||
SFL_FILE_CCRTP=ftp://ftp.gnu.org/pub/gnu/ccrtp/ccrtp-1.3.5.tar.gz
|
||||
SFL_FILE_LIBOSIP2=http://ftp.gnu.org/gnu/osip/libosip2-2.2.1.tar.gz
|
||||
SFL_FILE_LIBEXOSIP2=http://www.antisip.com/download/libeXosip2-1.9.1-pre16.tar.gz
|
||||
SFL_FILE_PA_V19=http://www.portaudio.com/archives/pa_snapshot_v19.tar.gz
|
||||
SFL_DIR_PA='portaudio'
|
||||
|
65
tools/download.sh
Executable file
65
tools/download.sh
Executable file
@ -0,0 +1,65 @@
|
||||
#!/bin/sh
|
||||
. ./config.sh
|
||||
|
||||
download()
|
||||
{
|
||||
filename=`basename $1`
|
||||
echo -n "Checking for $filename..."
|
||||
if [ ! -e $filename ]; then
|
||||
echo -en "\nDownloading $filename..."
|
||||
wget -q $1 -U "http://www.sflphone.org/" && echo -en " OK "
|
||||
fi
|
||||
echo ""
|
||||
}
|
||||
|
||||
untar()
|
||||
{
|
||||
filename=`basename $1`
|
||||
if [ -z $2 ]; then
|
||||
dirname=`basename $filename '.tar.gz'`
|
||||
else
|
||||
dirname=$2
|
||||
fi
|
||||
echo -n "Checking for directory $dirname"
|
||||
if [ -e $filename -a ! -e $dirname ]; then
|
||||
echo -en "\nExtracting..."
|
||||
tar xzf $filename
|
||||
fi
|
||||
echo " OK"
|
||||
}
|
||||
backupdir()
|
||||
{
|
||||
if [ -z $2 ]; then
|
||||
dirname=`basename $1 '.tar.gz'`
|
||||
else
|
||||
dirname=$2
|
||||
fi
|
||||
echo -n "Checking for backup for $dirname"
|
||||
if [ ! -e "$dirname.orig" ]; then
|
||||
echo -en "\nCopying..."
|
||||
cp -R $dirname "$dirname.orig"
|
||||
fi
|
||||
echo " OK"
|
||||
}
|
||||
configure() {
|
||||
./configure --prefix=$PREFIX
|
||||
}
|
||||
|
||||
prepare()
|
||||
{
|
||||
if [ -z $1 ]; then
|
||||
echo 'ERROR: prepare need a file URI not empty'
|
||||
else
|
||||
echo 'Preparation for' $1
|
||||
download $1
|
||||
untar $1 $2
|
||||
# backupdir $1 $2
|
||||
fi
|
||||
}
|
||||
|
||||
prepare $SFL_FILE_CCPP2 ''
|
||||
prepare $SFL_FILE_CCRTP ''
|
||||
prepare $SFL_FILE_LIBOSIP2 ''
|
||||
prepare $SFL_FILE_LIBEXOSIP2 ''
|
||||
prepare $SFL_FILE_PA_V19 $SFL_DIR_PA
|
||||
|
56
tools/install.sh
Executable file
56
tools/install.sh
Executable file
@ -0,0 +1,56 @@
|
||||
. ./config.sh
|
||||
|
||||
# configure, make and make install
|
||||
cmmi() {
|
||||
dirname=
|
||||
configparam=
|
||||
|
||||
if [ -z $2 ]; then
|
||||
dirname=`basename $1 '.tar.gz'`
|
||||
else
|
||||
dirname=$2
|
||||
fi
|
||||
|
||||
configok=0
|
||||
cd $dirname
|
||||
if [ ! -e Makefile ]; then
|
||||
configok=2
|
||||
echo "Configuring and installing: $dirname"
|
||||
if [ ! -z $3 ]; then
|
||||
configparam=$3
|
||||
fi
|
||||
./configure $configparam --prefix=$SFL_PREFIX || exit
|
||||
else
|
||||
echo "$dirname is already configure. Remove the Makefile to reinstall"
|
||||
fi
|
||||
if [ $configok -eq 0 ]; then
|
||||
echo -en 'Do you want to make and make install the package? (y/n) '
|
||||
read r
|
||||
if [ "$r" != "y" ]; then
|
||||
configok=2
|
||||
fi
|
||||
fi
|
||||
if [ $configok -eq 0 ]; then
|
||||
make || return
|
||||
echo "Enter you password to install the package as $USER (make install): "
|
||||
if [ "$SFL_INSTALL_USER" = "$USER" ]; then
|
||||
make install || exit
|
||||
else
|
||||
su $SFL_INSTALL_USER -c 'make install' || exit;
|
||||
fi
|
||||
fi
|
||||
cd ..
|
||||
}
|
||||
|
||||
|
||||
cmmi $SFL_FILE_CCPP2 ''
|
||||
CPPFLAGS="-I$SFL_PREFIX/include/cc++2"
|
||||
echo "Settings CPPFLAGS to $CPPFLAGS"
|
||||
cmmi $SFL_FILE_CCRTP ''
|
||||
cmmi $SFL_FILE_LIBOSIP2 ''
|
||||
cmmi $SFL_FILE_LIBEXOSIP2 '' --disable-josua
|
||||
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$SFL_PREFIX/lib/pkgconfig
|
||||
cmmi $SFL_FILE_PA_V19 $SFL_DIR_PA
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user