2
0

src_tarball.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/bin/sh
  2. ##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*-
  3. sdir="."
  4. [ -n "${0%/*}" ] && sdir="${0%/*}"
  5. . $sdir/common.sh
  6. check_pwd
  7. version=`cat build/next-release.txt`
  8. if [ $# -gt 0 ]; then
  9. version="$version.$1"
  10. fi
  11. eval $(parse_version "$version")
  12. if [ -n "$grev" ]; then
  13. dst_name="freeswitch-$cmajor.$cminor.$cmicro.$grev"
  14. else
  15. dst_name="freeswitch-$cmajor.$cminor.$cmicro"
  16. fi
  17. check_input_ver_build $version
  18. #This should be a RAM Drive
  19. build_dir="jenkins.$$"
  20. dst_dir="${tmp_dir}/${build_dir}/$dst_name"
  21. if [ -d "$dst_dir" ]; then
  22. echo "error: destination directory $dst_dir already exists." 1>&2
  23. exit 1;
  24. fi
  25. mkdir -p $dst_dir
  26. cp -r . $dst_dir
  27. cd $dst_dir
  28. set_fs_ver "$gver" "$gmajor" "$gminor" "$gmicro" "$grev"
  29. echo "$gver" > .version
  30. gnuize
  31. cd ..
  32. ls
  33. tar -cvf ${dst_name}.tar $dst_name
  34. gzip -9 -c ${dst_name}.tar > $dst_name.tar.gz || echo "gzip not available"
  35. bzip2 -z -k ${dst_name}.tar || echo "bzip2 not available"
  36. xz -z -9 -k ${dst_name}.tar || echo "xz / xz-utils not available"
  37. zip -r $dst_name.zip $dst_name
  38. mkdir -p ${src_repo}/../src_dist
  39. mv -f ${dst_name}.tar.* ${src_repo}/../src_dist
  40. mv -f $dst_name.zip ${src_repo}/../src_dist
  41. cp -f ${dst_dir}/freeswitch.spec ${src_repo}/../src_dist
  42. cp -f ${dst_dir}/freeswitch-config-rayo.spec ${src_repo}/../src_dist
  43. rm -rf ${dst_name}.tar $dst_dir
  44. cd ${tmp_dir}
  45. ls -al
  46. rm -rf ${build_dir}
  47. ls -al
  48. cat 1>&2 <<EOF
  49. ----------------------------------------------------------------------
  50. The freeswitch-${cver} tarballs have been rolled,
  51. now we just need to roll packages with them
  52. ----------------------------------------------------------------------
  53. EOF