2013-11-23 15:18:36 +01:00
|
|
|
#!/bin/sh
|
2010-08-24 06:23:17 +02:00
|
|
|
|
|
|
|
# Slackware build script for linphone
|
2014-08-15 13:15:15 +02:00
|
|
|
# Was written by adev and modified by Eugene Wissner
|
|
|
|
# Now maintained by Euan Thoms <euan at potensol dot com>
|
|
|
|
|
|
|
|
# Copyright 2014 Euan Thoms United Kingdom
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use of this script, with or without modification, is
|
|
|
|
# permitted provided that the following conditions are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of this script must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
|
|
|
|
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
|
|
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
|
|
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
|
|
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
2010-08-24 06:23:17 +02:00
|
|
|
|
|
|
|
PRGNAM=linphone
|
2017-11-17 23:22:20 +01:00
|
|
|
VERSION=${VERSION:-3.12.0}
|
2015-11-21 03:10:04 +01:00
|
|
|
BUILD=${BUILD:-1}
|
2010-08-24 06:23:17 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2015-11-21 03:10:04 +01:00
|
|
|
MOD1NAME=ortp
|
2017-11-17 23:22:20 +01:00
|
|
|
MOD1VERSION=1.0.2
|
|
|
|
MOD1SRCDIRNAME=${MOD1NAME}-${MOD1VERSION}-0
|
2015-11-21 03:10:04 +01:00
|
|
|
MOD1DIRNAME=oRTP
|
|
|
|
|
|
|
|
MOD2NAME=mediastreamer
|
2017-11-17 23:22:20 +01:00
|
|
|
MOD2VERSION=2.16.1
|
|
|
|
MOD2SRCDIRNAME=${MOD2NAME}-${MOD2VERSION}
|
2015-11-21 03:10:04 +01:00
|
|
|
MOD2DIRNAME=mediastreamer2
|
|
|
|
|
2010-08-24 06:23:17 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2017-11-17 23:22:20 +01:00
|
|
|
i?86) ARCH=i586 ;;
|
2010-08-24 06:23:17 +02:00
|
|
|
arm*) ARCH=arm ;;
|
2017-11-17 23:22:20 +01:00
|
|
|
*) ARCH=$( uname -m ) ;;
|
2010-08-24 06:23:17 +02:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2017-11-17 23:22:20 +01:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2010-08-24 06:23:17 +02:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
fi
|
|
|
|
|
2012-06-30 18:08:28 +02:00
|
|
|
DOCS="ABOUT-NLS AUTHORS BUGS COPYING ChangeLog \
|
2017-11-17 23:22:20 +01:00
|
|
|
NEWS README.md TODO $CWD/$PRGNAM.SlackBuild"
|
2012-06-30 18:08:28 +02:00
|
|
|
|
2014-08-15 13:15:15 +02:00
|
|
|
# enable support for video by default, requires ffmpeg
|
|
|
|
if [ "${VIDEO:-yes}" = "yes" ]; then
|
2010-08-24 06:23:17 +02:00
|
|
|
do_video="--enable-video"
|
|
|
|
else
|
|
|
|
do_video="--disable-video"
|
|
|
|
fi
|
|
|
|
|
2014-08-17 01:53:03 +02:00
|
|
|
# enable support for UPNP by default, requires libupnp
|
|
|
|
if [ "${UPNP:-yes}" = "yes" ]; then
|
|
|
|
do_upnp="--enable-upnp"
|
|
|
|
else
|
|
|
|
do_upnp="--disable-upnp"
|
|
|
|
fi
|
|
|
|
|
2014-08-15 13:15:15 +02:00
|
|
|
# disable support for truespeech by default
|
|
|
|
if [ "${TRUESPEECH:-no}" = "yes" ]; then
|
|
|
|
do_truespeech="--enable-truespeech"
|
|
|
|
else
|
|
|
|
do_truespeech="--disable-truespeech"
|
|
|
|
fi
|
|
|
|
|
2010-08-24 06:23:17 +02:00
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
2015-11-21 03:10:04 +01:00
|
|
|
tar xvf $CWD/$MOD1NAME-$MOD1VERSION.tar.gz
|
2017-11-17 23:22:20 +01:00
|
|
|
mv $MOD1SRCDIRNAME $MOD1DIRNAME
|
2015-11-21 03:10:04 +01:00
|
|
|
tar xvf $CWD/$MOD2NAME-$MOD2VERSION.tar.gz
|
2017-11-17 23:22:20 +01:00
|
|
|
mv $MOD2SRCDIRNAME $MOD2DIRNAME
|
|
|
|
|
|
|
|
# Some patching for silly build issues
|
|
|
|
sed -i 's|ms_message("Mediastreamer2 factory " MEDIASTREAMER_VERSION " (git: " MS2_GIT_VERSION ") initialized.");|ms_message("Mediastreamer2 factory " MEDIASTREAMER_VERSION " initialized.");|' $MOD2DIRNAME/src/base/msfactory.c
|
|
|
|
touch coreapi/gitversion.h
|
|
|
|
|
2010-08-24 06:23:17 +02:00
|
|
|
chown -R root:root .
|
2013-11-22 08:37:19 +01:00
|
|
|
find -L . \
|
2014-08-17 01:53:03 +02:00
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
|
|
|
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
|
|
|
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
2010-08-24 06:23:17 +02:00
|
|
|
|
2017-11-17 23:22:20 +01:00
|
|
|
./autogen.sh
|
2010-08-24 06:23:17 +02:00
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
--docdir=/usr/doc \
|
|
|
|
--mandir=/usr/man \
|
2016-02-29 12:14:28 +01:00
|
|
|
--disable-strict \
|
2010-08-24 06:23:17 +02:00
|
|
|
--disable-static \
|
2014-08-15 13:15:15 +02:00
|
|
|
--disable-tests \
|
|
|
|
--disable-tutorials \
|
2010-08-24 06:23:17 +02:00
|
|
|
--enable-ipv6 \
|
|
|
|
--enable-alsa \
|
2017-11-17 23:22:20 +01:00
|
|
|
--enable-pulseaudio \
|
2014-08-15 13:15:15 +02:00
|
|
|
--enable-ldap \
|
|
|
|
--enable-zrtp \
|
2015-11-21 03:10:04 +01:00
|
|
|
--with-included-gettext \
|
2014-08-15 13:15:15 +02:00
|
|
|
$do_truespeech \
|
2010-08-24 06:23:17 +02:00
|
|
|
$do_video \
|
2014-08-17 01:53:03 +02:00
|
|
|
$do_upnp \
|
2010-08-24 06:23:17 +02:00
|
|
|
--build=$ARCH-slackware-linux
|
|
|
|
|
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
2014-08-17 01:53:03 +02:00
|
|
|
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
2010-08-24 06:23:17 +02:00
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|
|
|
|
2011-05-15 06:03:58 +02:00
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
|
|
|
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
2010-08-24 06:23:17 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
chmod 0644 $PKG/usr/doc/$PRGNAM-$VERSION/*
|
2017-11-17 23:22:20 +01:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
2010-08-24 06:23:17 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
|
|
|
|
cd $PKG
|
2011-05-15 06:03:58 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|