]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add 'make sounds' and 'make sounds-install' makefile targets to download and install...
authorMichael Jerris <mike@jerris.com>
Mon, 10 Dec 2007 23:38:42 +0000 (23:38 +0000)
committerMichael Jerris <mike@jerris.com>
Mon, 10 Dec 2007 23:38:42 +0000 (23:38 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6611 d0543943-73ff-0310-b7d9-9358b9ac24b2

Makefile.am
build/getsounds.sh.in [new file with mode: 0755]
configure.in

index 4c65a8df823f556469429a5a4d8ece49f34920d6..f209dc739c1503c5dee9409f573a13b58d994286 100644 (file)
@@ -10,10 +10,21 @@ AM_LDFLAGS  = $(SWITCH_AM_LDFLAGS)
 BASE        = $(switch_srcdir)
 OSARCH=`uname -s`
 
+DEFAULT_SOUNDS=en-us-callie-8000
+
 .DEFAULT:
        @target=`echo $@ | sed -e 's|^.*-||'`; \
-         if test "$$target" = "install"; then $(MAKE) $(AM_MAKEFLAGS) core_install; else $(MAKE) $(AM_MAKEFLAGS) core ; fi;
-       @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@
+        target_prefix=`echo $@ | sed -e 's|-.*$$||'`; \
+        sound_perfix=`echo $@ | sed -e 's|-.*||'`; \
+        full_sound_dir=`echo $@ | sed -e 's|^sounds-||' | sed -e 's|-install$$||'`; \
+        test -z "$$full_sound_dir" || full_sound_dir=`echo $(DEFAULT_SOUNDS)`; \
+        soundfile=`echo freeswitch-sounds-$$full_sound_dir-$(PACKAGE_VERSION).tar.gz`; \
+         if test "$$target" = "install"; then $(MAKE) $(AM_MAKEFLAGS) core_install; else $(MAKE) $(AM_MAKEFLAGS) core ; fi; \
+         if test "$$target_prefix" = "sounds"; then \
+          if test "$$target" = "install"; then $(GETSOUNDS) $$soundfile $(PREFIX)/sounds/; else $(GETSOUNDS) $$soundfile ; fi; \
+        else \
+          cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@ ;\
+        fi
 
 libfreeswitch_la_SOURCES       = \
 src/switch_apr.c \
diff --git a/build/getsounds.sh.in b/build/getsounds.sh.in
new file mode 100755 (executable)
index 0000000..e2384da
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+TAR=@TAR@
+ZCAT=@ZCAT@
+WGET=@WGET@
+CURL=@CURL@
+
+DIR=`pwd`
+
+if [ -f $WGET ] ; then
+    DOWNLOAD_CMD=$WGET
+else
+    if [ -f $CURL ] ; then
+        DOWNLOAD_CMD="$CURL -O"
+    fi
+fi
+
+base=http://files.freeswitch.org/
+tarfile=$1
+install=$2
+
+if [ ! -f $tarfile ] ; then
+    $DOWNLOAD_CMD $base$tarfile
+    if [ ! -f $tarfile ] ; then
+        echo cannot find $tarfile
+       exit 1
+    fi
+fi
+
+if [ ! -z $install ] ; then
+   test -d $install || mkdir $install
+   cd $install && $ZCAT -c -d $DIR/$tarfile | $TAR x
+fi
+
+exit 0
+
index 44493d3a6befb7e2abbbd78d8b5129e86b7462b0..31cc9ef43f66fca9bda9c8f385f2abd2fd05512e 100644 (file)
@@ -382,6 +382,8 @@ AC_PATH_PROGS(WGET, wget)
 AC_PATH_PROGS(CURL, curl)
 GETLIB="cd $switch_srcdir/libs && ${SHELL} $switch_srcdir/build/getlib.sh"
 AC_SUBST(GETLIB)
+GETSOUNDS="${SHELL} $switch_srcdir/build/getsounds.sh"
+AC_SUBST(GETSOUNDS)
 
 
 LIBCURL_CHECK_CONFIG([yes], [7.13.0], [LIBCURL_DEPS=''], [LIBCURL_DEPS='${switch_srcdir}/libs/curl/lib/libcurl.la';LIBCURL='${switch_srcdir}/libs/curl/lib/libcurl.la';LIBCURL_CPPFLAGS='-I${switch_srcdir}/libs/curl/include'])
@@ -414,6 +416,7 @@ AC_CONFIG_FILES([Makefile
                 src/mod/event_handlers/mod_radius_cdr/Makefile
                 src/mod/languages/mod_java/Makefile
                 src/include/switch_am_config.h
+                build/getsounds.sh
                 build/getlib.sh
                 build/modmake.rules])