install_prereq: Download latest Jansson.
[asterisk/asterisk.git] / contrib / scripts / get_mp3_source.sh
1 #!/bin/sh -e
2
3 if [ -f addons/mp3/mpg123.h ]; then
4     echo "***"
5     echo "The MP3 source code appears to already be present and does not"
6     echo "need to be downloaded."
7     echo "***"
8
9     # Manually patch interface.c if not done yet.
10     if ! grep -q ASTMM_LIBC addons/mp3/interface.c; then
11         sed -i -e '/#include "asterisk.h"/i#define ASTMM_LIBC ASTMM_REDIRECT' \
12             addons/mp3/interface.c
13     fi
14
15     exit 1
16 fi
17
18 svn export http://svn.digium.com/svn/thirdparty/mp3/trunk addons/mp3 $@
19
20 # Manually patch interface.c if not done yet.
21 if ! grep -q ASTMM_LIBC addons/mp3/interface.c; then
22     sed -i -e '/#include "asterisk.h"/i#define ASTMM_LIBC ASTMM_REDIRECT' \
23         addons/mp3/interface.c
24 fi
25
26 exit 0