Packager: Patrick Laimbock <vc-rpms@voipconsulting.nl>
URL: http://www.freeswitch.org
Source0:http://files.freeswitch.org/%{name}-48000-%{version}.tar.gz
+Source1:http://files.freeswitch.org/%{name}-32000-%{version}.tar.gz
+Source2:http://files.freeswitch.org/%{name}-16000-%{version}.tar.gz
+Source3:http://files.freeswitch.org/%{name}-8000-%{version}.tar.gz
BuildArch: noarch
BuildRequires: sox
Requires: freeswitch
##############################################################################
%prep
-%setup -b0 -q -n en
-mkdir -p ./usr/callie
-# create buildsounds-callie.sh script in working dir
-echo '#!/bin/bash
-
-sounds_location=$1
-for rate in 32000 16000 8000
-do
- for i in ascii base256 conference currency digits directory ivr misc phonetic-ascii time voicemail zrtp
- do
- mkdir -p $sounds_location/$i/$rate
- for f in `find $sounds_location/$i/48000 -name \*.wav`
- do
- echo "generating" $sounds_location/$i/$rate/`basename $f`
- sox $f -r $rate $sounds_location/$i/$rate/`basename $f`
- done
- done
-done' > ./us/callie/buildsounds-callie.sh
-%{__chmod} 0750 ./us/callie/buildsounds-callie.sh
+%setup -n en
+%setup -T -D -b 0 -n en
+%setup -T -D -b 1 -n en
+%setup -T -D -b 2 -n en
+%setup -T -D -b 3 -n en
##############################################################################
# Build
# first install the 48KHz sounds
%{__cp} -prv ./* %{buildroot}%{SOUNDSDIR}/en/us/callie
# now resample the 48KHz ones to 8KHz, 16KHz and 32KHz
-./buildsounds-callie.sh %{buildroot}%{SOUNDSDIR}/en/us/callie
popd
##############################################################################
%post
# generate the 8KHz, 16KHz and 32KHz prompts from the 48KHz ones
-cd %{SOUNDSDIR}/en/us/callie
-./buildsounds-callie.sh %{SOUNDSDIR}/en/us/callie
##############################################################################
# Postun
%files
%defattr(-,root,root)
-%attr(0750,freeswitch,daemon) %{SOUNDSDIR}/en/us/callie/buildsounds-callie.sh
%files -n freeswitch-sounds-en-us-callie-8000
%defattr(-,root,root,-)
basedir=$(pwd);
+(mkdir -p rpmbuild && cd rpmbuild && mkdir -p SOURCES BUILD BUILDROOT i386 x86_64 SPECS)
+
if [ ! -d "$basedir/../freeswitch-sounds" ]; then
cd $basedir/..
git clone https://stash.freeswitch.org/scm/fs/freeswitch-sounds.git
fi
cd $basedir/../freeswitch-sounds/sounds/trunk
-perl dist.pl
+# perl dist.pl
-cp * freeswitch-sounds-*48000*.tar.gz $basedir/rpmbuild/SOURCES
+mv freeswitch-sounds-*48000*.tar.gz $basedir/rpmbuild/SOURCES
+mv freeswitch-sounds-*32000*.tar.gz $basedir/rpmbuild/SOURCES
+mv freeswitch-sounds-*16000*.tar.gz $basedir/rpmbuild/SOURCES
+mv freeswitch-sounds-*8000*.tar.gz $basedir/rpmbuild/SOURCES
cd $basedir