freeswitch/scripts/ci/sounds-music.sh

47 lines
1.2 KiB
Bash
Raw Permalink Normal View History

#!/bin/sh
##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*-
src_repo="$(pwd)"
if [ ! -d .git ]; then
echo "error: must be run from within the top level of a FreeSWITCH git tree." 1>&2
exit 1;
fi
2014-09-11 22:21:26 +00:00
ver="1.0.50"
2014-09-11 22:21:26 +00:00
basedir=$(pwd);
2014-09-11 22:21:26 +00:00
(mkdir -p rpmbuild && cd rpmbuild && mkdir -p SOURCES BUILD BUILDROOT i386 x86_64 SPECS)
2014-09-11 22:21:26 +00:00
if [ ! -d "$basedir/../freeswitch-sounds" ]; then
cd $basedir/..
git clone https://freeswitch.org/stash/scm/fs/freeswitch-sounds.git
2014-09-11 22:21:26 +00:00
else
cd $basedir/../freeswitch-sounds
git pull
fi
cd $basedir/../freeswitch-sounds/sounds/trunk
2014-09-11 22:33:01 +00:00
./dist.pl music
2014-09-11 22:21:26 +00:00
mv freeswitch-sounds-music-*.tar.gz $basedir/rpmbuild/SOURCES
cd $basedir
rpmbuild --define "VERSION_NUMBER $ver" \
--define "BUILD_NUMBER 1" \
--define "_topdir %(pwd)/rpmbuild" \
--define "_rpmdir %{_topdir}" \
--define "_srcrpmdir %{_topdir}" \
-ba freeswitch-sounds-music.spec
mkdir $src_repo/RPMS
mv $src_repo/rpmbuild/*/*.rpm $src_repo/RPMS/.
cat 1>&2 <<EOF
----------------------------------------------------------------------
The Sound RPMs have been rolled
----------------------------------------------------------------------
EOF