Statistics
| Branch: | Revision:

janus-gateway / install.sh @ 5e9e29e0

History | View | Annotate | Download (2.88 KB)

1
#!/bin/sh
2

    
3
PKG_CONFIG=`which pkg-config`
4
MAKE=`which make`
5
GENGETOPT=`which gengetopt`
6
DOXYGEN=`which doxygen`
7
DOT=`which dot`
8
WGET=`which wget`
9
CURL=`which curl`
10

    
11
echo "Installing the Janus WebRTC gateway..."
12

    
13
if [ -z "$PKG_CONFIG" ]
14
then
15
	echo "pkg-config is missing, please install it";
16
	exit 1;
17
fi
18
if [ -z "$MAKE" ]
19
then
20
	echo "No make?? please install it...";
21
	exit 1;
22
fi
23

    
24
echo
25
echo "Checking dependencies..."
26
for x in glib-2.0 nice libmicrohttpd jansson libssl libcrypto sofia-sip-ua ini_config
27
do
28
	DEPENDENCY=`pkg-config --cflags --libs $x`
29
	if [ -z "$DEPENDENCY" ]
30
	then
31
		echo "$x is missing, please install it"
32
		exit 1;
33
	fi
34
done
35
pkg-config --atleast-version=2.32 glib-2.0
36
if [ $? != 0 ]
37
then
38
	echo "  -- The installed glib-2.0 version (`pkg-config --modversion glib-2.0`) is outdated, at least 2.32 is required"
39
	exit 1
40
fi
41
pkg-config --atleast-version=1.0.1e openssl
42
if [ $? != 0 ]
43
then
44
	echo "  -- The installed openssl version (`pkg-config --modversion openssl`) is outdated, at least 1.0.1e is required"
45
	exit 1
46
fi
47
pkg-config --exists opus
48
if [ $? != 0 ]
49
then
50
	echo "  -- opus is not installed, the AudioBridge plugin will not be built"
51
	sleep 2
52
else
53
	export HAVE_OPUS=1
54
fi
55
pkg-config --exists ogg
56
if [ $? != 0 ]
57
then
58
	echo "  -- libogg is not installed, the VoiceMail plugin will not be built"
59
	sleep 2
60
else
61
	export HAVE_OGG=1
62
fi
63
LIBNICE=( `ldconfig -p | grep libnice.so | tail -n 1` )
64
PORTRANGE=`nm -AD ${LIBNICE[3]} | grep nice_agent_set_port_range`
65
if [ -z "$PORTRANGE" ]
66
then
67
	echo "  -- Your version of libnice does not have nice_agent_set_port_range: support for configuring an RTP/RTCP range will be disabled"
68
	sleep 2
69
else
70
	export HAVE_PORTRANGE="-DHAVE_PORTRANGE"
71
fi
72

    
73
echo
74
echo "Compiling..."
75
$MAKE
76
if test $? -eq 0
77
then
78
	echo "Built!"
79
else
80
	echo "Error compiling, giving up..."
81
	exit 1
82
fi
83

    
84
echo
85
echo "Generating documentation..."
86
if [ -z "$DOXYGEN" ] || [ -z "$DOT" ]
87
then
88
	echo "Doxygen or graphviz missing, no documentation will be built...";
89
else
90
	$MAKE docs
91
fi
92

    
93
echo
94
echo "Downlading samples for the streaming demo..."
95
if [ -n "$WGET" ]
96
then
97
	$WGET -c -O ./plugins/streams/radio.alaw http://janus.conf.meetecho.com/samples/radio.alaw
98
	$WGET -c -O ./plugins/streams/music.mulaw http://janus.conf.meetecho.com/samples/music.mulaw
99
elif [ -n "$CURL" ]
100
then
101
	$CURL -C - -o ./plugins/streams/radio.alaw http://janus.conf.meetecho.com/samples/radio.alaw
102
	$CURL -C - -o ./plugins/streams/music.mulaw http://janus.conf.meetecho.com/samples/music.mulaw
103
else
104
	echo "  Couldn't find wget or curl, please download the following files"
105
	echo "  yourself and place them in the plugins/streams/ folder if you want to"
106
	echo "  test the default configuration of the Streaming plugin:"
107
	echo "   -- http://janus.conf.meetecho.com/samples/radio.alaw"
108
	echo "   -- http://janus.conf.meetecho.com/samples/music.mulaw"
109
fi
110

    
111
echo
112
echo "Done! Check the configuration files for both the gateway and the plugins in the 'conf' folder."
113
./janus -h