jack2 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.2KB

  1. #/bin/sh
  2. # This script eases updating the waf build system. Make sure wget and gpg are
  3. # installed and run:
  4. # $ ./waf-update.sh <version>
  5. # This script will deploy the build system in source form as to ease downtream
  6. # maintainence at Debian/Ubuntu. For example see [1] and the pages it links to.
  7. # [1] https://wiki.debian.org/UnpackWaf
  8. script=`basename ${0}`
  9. msg() {
  10. echo "${script}: ${@}"
  11. }
  12. die() {
  13. msg "${@}"
  14. exit 1
  15. }
  16. test $# -ne 1 && die "usage: ${script} <version>"
  17. version=${1}
  18. homepage=https://waf.io
  19. # Fetch the pubkey from the main homepage.
  20. pubkey=tnagy1024.asc
  21. if ! test -e ${pubkey}
  22. then
  23. wget ${homepage}/${pubkey} || die "wget failed"
  24. fi
  25. # The key can also be found at freehackers.
  26. pubkey2=${pubkey}.2
  27. if ! test -e ${pubkey2}
  28. then
  29. wget http://freehackers.org/~tnagy/${pubkey} -O ${pubkey2} || die "wget failed"
  30. fi
  31. # Make sure the keys are identic.
  32. cmp ${pubkey} ${pubkey2}
  33. status=$?
  34. if test $status -eq 0
  35. then
  36. msg "${pubkey} and ${pubkey2} match"
  37. elif test $status -eq 1
  38. then
  39. die "${pubkey} and ${pubkey2} did not match"
  40. else
  41. die "cmp failed"
  42. fi
  43. # Now that the keys match, it is likely that this key is the real key so import
  44. # it.
  45. gpg --import ${pubkey} || die "could not import public key"
  46. waf_dir=waf-${version}
  47. waf_tar=${waf_dir}.tar.bz2
  48. waf_asc=${waf_tar}.asc
  49. if ! test -e ${waf_tar}
  50. then
  51. wget ${homepage}/${waf_tar} || die "wget failed"
  52. fi
  53. if ! test -e ${waf_asc}
  54. then
  55. wget ${homepage}/${waf_asc} || die "wget failed"
  56. fi
  57. gpg --verify ${waf_asc}
  58. if test $? -eq 0
  59. then
  60. msg "tarball verification succeeded"
  61. else
  62. die "tarball verificatin failed"
  63. fi
  64. if test -d ${waf_dir}
  65. then
  66. rm -rf ${waf_dir} || die "could not remove old waf directory"
  67. fi
  68. tar xjf ${waf_tar} || die "could not unpack tarball"
  69. # Remove the old waflib directory and replace it with the new.
  70. git rm -rf waflib || die "could not remove old waflib directory"
  71. cp -R ${waf_dir}/waflib . || die "could not copy waflib directory"
  72. git add waflib || die "could not add waflib to version control"
  73. # Copy the waf-light script to the toplevel directory and rename it to waf so
  74. # that the usual ./waf [args] can be used.
  75. cp ${waf_dir}/waf-light waf || die "could not copy waf-light"
  76. exit 0