2
0

mk-sounds-rpms.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/sh
  2. ##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*-
  3. declare -a specfiles=('freeswitch-sounds-en-ca-june.spec' 'freeswitch-sounds-en-us-allison.spec' 'freeswitch-sounds-fr-ca-june.spec' 'freeswitch-sounds-music.spec' 'freeswitch-sounds-pt-BR-karina.spec' 'freeswitch-sounds-ru-RU-elena.spec' 'freeswitch-sounds-en-us-callie.spec' 'freeswitch-sounds-sv-se-jakob.spec')
  4. sdir="."
  5. [ -n "${0%/*}" ] && sdir="${0%/*}"
  6. . $sdir/common.sh
  7. check_pwd
  8. basedir=$(pwd);
  9. (mkdir -p rpmbuild && cd rpmbuild && mkdir -p SOURCES BUILD BUILDROOT i386 x86_64 SPECS)
  10. if [ ! -d "$basedir/../freeswitch-sounds" ]; then
  11. cd $basedir/..
  12. git clone https://freeswitch.org/stash/scm/fs/freeswitch-sounds.git
  13. else
  14. cd $basedir/../freeswitch-sounds
  15. git clean -fdx
  16. git pull
  17. fi
  18. for i in "${specfiles[@]}"
  19. do
  20. cd $basedir/../freeswitch-sounds/
  21. ./dist.pl `echo $i|sed -e 's/freeswitch-sounds-//g' -e 's/\.spec//g' -e 's/-/\//g'`
  22. mv `echo $i|sed -e's/\.spec//g'`*.tar.* $basedir/rpmbuild/SOURCES
  23. cd $basedir
  24. rpmbuild --define "_topdir %(pwd)/rpmbuild" \
  25. --define "_rpmdir %{_topdir}" \
  26. --define "_srcrpmdir %{_topdir}" \
  27. -ba $i
  28. done
  29. mkdir $src_repo/RPMS
  30. mv $src_repo/rpmbuild/*/*.rpm $src_repo/RPMS/.
  31. cat 1>&2 <<EOF
  32. ----------------------------------------------------------------------
  33. The Sound RPMs have been rolled
  34. ----------------------------------------------------------------------
  35. EOF