src_tarball.sh 1.8 KB

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