sounds-music.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/sh
  2. ##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*-
  3. src_repo="$(pwd)"
  4. if [ ! -d .git ]; then
  5. echo "error: must be run from within the top level of a FreeSWITCH git tree." 1>&2
  6. exit 1;
  7. fi
  8. ver="1.0.50"
  9. basedir=$(pwd);
  10. (mkdir -p rpmbuild && cd rpmbuild && mkdir -p SOURCES BUILD BUILDROOT i386 x86_64 SPECS)
  11. if [ ! -d "$basedir/../freeswitch-sounds" ]; then
  12. cd $basedir/..
  13. git clone https://freeswitch.org/stash/scm/fs/freeswitch-sounds.git
  14. else
  15. cd $basedir/../freeswitch-sounds
  16. git pull
  17. fi
  18. cd $basedir/../freeswitch-sounds/sounds/trunk
  19. ./dist.pl music
  20. mv freeswitch-sounds-music-*.tar.gz $basedir/rpmbuild/SOURCES
  21. cd $basedir
  22. rpmbuild --define "VERSION_NUMBER $ver" \
  23. --define "BUILD_NUMBER 1" \
  24. --define "_topdir %(pwd)/rpmbuild" \
  25. --define "_rpmdir %{_topdir}" \
  26. --define "_srcrpmdir %{_topdir}" \
  27. -ba freeswitch-sounds-music.spec
  28. mkdir $src_repo/RPMS
  29. mv $src_repo/rpmbuild/*/*.rpm $src_repo/RPMS/.
  30. cat 1>&2 <<EOF
  31. ----------------------------------------------------------------------
  32. The Sound RPMs have been rolled
  33. ----------------------------------------------------------------------
  34. EOF