2
0

debpkgs.sh 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #!/bin/bash
  2. a='amd64 i386'
  3. c='wheezy jessie stretch sid'
  4. n='1'
  5. T='/tmp/fs.sources.list'
  6. K='/tmp/fs.asc'
  7. while getopts "a:c:n:" flag
  8. do
  9. case $flag in
  10. a) a=$OPTARG;;
  11. c) c=$OPTARG;;
  12. n) n=$OPTARG;;
  13. T) T=$OPTARG;;
  14. K) K=$OPTARG;;
  15. esac
  16. done
  17. if [ "$EUID" -ne 0 ]
  18. then
  19. echo "Build script must be run as root or under sudo"
  20. exit 1
  21. fi
  22. echo "./build/debpkgs.sh script is building FreeSWITCH Debian packages"
  23. VERSION=`cat ./build/next-release.txt`
  24. echo "This Version: $VERSION"
  25. HASH=`git log -n 1 --oneline |cut -d ' ' -f 1`
  26. echo "Commit hash $HASH"
  27. # Use the FreeSWITCH release repo for dependency testing
  28. # The release codename here does not matter, since the util.sh script
  29. # will adapt to the release being built
  30. if [ ! -r "$T" ]
  31. then
  32. echo "deb http://files.freeswitch.org/repo/deb/debian/ jessie main" >> "$T"
  33. fi
  34. # Use the FreeSWITCH release repo key
  35. if [ ! -r "$K" ]
  36. then
  37. cat << EOF > "$K"
  38. -----BEGIN PGP PUBLIC KEY BLOCK-----
  39. Version: GnuPG v1.4.12 (GNU/Linux)
  40. mQGiBE8jEfIRBAC+Cca0fPQxhyhn0NMsPaMQJgTvqhWb5/f4Mel++kosmUQQ4fJq
  41. 4U9NFvpfNyLp5MoHpnlDfAb+e57B2sr47NOJLTh83yQIAnvU+8O0Q4kvMaiiesX5
  42. CisApLBs6Vx28y7VWmLsY3vWu8mC7M+PORKfpBV8DWy/7569wQPx2SCsIwCgzv2T
  43. 8YsnYsSVRrrmh46J1o4/ngsD/13ETX4ws/wNN+82RdqUxu7fjc0fNbUAb6XYddAb
  44. 1hrw5npQulgUNWkpnVmIDRHDXLNMeT8nZDkxsA8AsT+u7ACfPFa2o3R8w9zOPSO+
  45. oSO0+Puhop2+z1gm6lmfMKq9HpeXG3yt/8zsEVUmOYT9m+vYEVghfpXtACVYheDq
  46. LzUuA/9E9HBiNPVhJ/mEpOk9bZ1gpwr3mjlpUbvX5aGwTJJ+YoTfZOCL7go3uQHn
  47. /sT35WoJ23wJCRlW0SYTFJqCoris9AhI+qw7xRTw9wb+txSI96uhafUUMCn6GLkN
  48. +yAixqDwNHKkdax3GSGJtLB0t67QoBDIpcGog7ZfRMvWP3QLNLQ4RnJlZVNXSVRD
  49. SCBQYWNrYWdlIFNpZ25pbmcgS2V5IDxwYWNrYWdlc0BmcmVlc3dpdGNoLm9yZz6I
  50. YgQTEQIAIgUCTyMR8gIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQ127c
  51. dyXgEM879ACffY0HFi+mACtfFYmX/Uk/qGELSP4An1B8D5L4dLFFr1zV9YawQUbz
  52. O9/MuQENBE8jEfIQBAC7vnn855YDuz1gTsUMYDxfIRH5KPmDDEAf1WXoD3QG4qOQ
  53. xVW5nhp/bolh2CacAxdOjZePdhGkkdNOBpcu9NlTNRru0myGN8etbnzP3O5dq0io
  54. VMf23C5u9KPbxwRWS+WFtC4CRFn6DafDI1qa3Gv3CkiBWtKR0Wid2SQLzl3mVwAF
  55. EQP9HlwGjhBfFA26LlSMPhSo0Ll+sdcOJupJ21zmGeg7c0GpBnzDzyyJg04gbahs
  56. xWtW3Y/+B4LGM97o6lnu0OQI7MX5gY1G4Jgu6pgYv8tQd5XyU/CAJUA5VWTxUMIi
  57. JP6qlzm1bz4AAPmGw4mkS1u4N+vai21Zl4iyFIQFeiuU/K2ISQQYEQIACQUCTyMR
  58. 8gIbDAAKCRDXbtx3JeAQzxReAJ4uvms1n7xV3CcJPQlM7ndX5MZU3QCgxp8zubcL
  59. /SsMvw7XApSHFs5ooYc=
  60. =Xc8P
  61. -----END PGP PUBLIC KEY BLOCK-----
  62. EOF
  63. fi
  64. ./debian/util.sh build-all -a "$a" -c "$c" -T $T -K $K -f ./build/modules.conf.most -j -bn -z9 -v$VERSION-$n~$HASH
  65. if [ $(ls -al ../freeswitch-mod* | wc -l) -lt 10 ]; then false; else true; fi