[Freeswitch-svn] [commit] r6611 - in freeswitch/trunk: . build
Freeswitch SVN
mikej at freeswitch.org
Mon Dec 10 18:38:42 EST 2007
Author: mikej
Date: Mon Dec 10 18:38:42 2007
New Revision: 6611
Added:
freeswitch/trunk/build/getsounds.sh.in (contents, props changed)
Modified:
freeswitch/trunk/Makefile.am
freeswitch/trunk/configure.in
Log:
add 'make sounds' and 'make sounds-install' makefile targets to download and install soundfiles (FSBUILD-28)
Modified: freeswitch/trunk/Makefile.am
==============================================================================
--- freeswitch/trunk/Makefile.am (original)
+++ freeswitch/trunk/Makefile.am Mon Dec 10 18:38:42 2007
@@ -10,10 +10,21 @@
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 \
Added: freeswitch/trunk/build/getsounds.sh.in
==============================================================================
--- (empty file)
+++ freeswitch/trunk/build/getsounds.sh.in Mon Dec 10 18:38:42 2007
@@ -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
+
Modified: freeswitch/trunk/configure.in
==============================================================================
--- freeswitch/trunk/configure.in (original)
+++ freeswitch/trunk/configure.in Mon Dec 10 18:38:42 2007
@@ -382,6 +382,8 @@
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 @@
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])
More information about the Freeswitch-svn
mailing list