makerelease.sh 932 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. srcdir="$(dirname "$0")"
  3. [ "$(echo "$srcdir" | cut -c1)" = '/' ] || srcdir="$PWD/$srcdir"
  4. die() { echo "$*"; exit 1; }
  5. # Import the makerelease.lib
  6. # http://bues.ch/gitweb?p=misc.git;a=blob_plain;f=makerelease.lib;hb=HEAD
  7. for path in $(echo "$PATH" | tr ':' ' '); do
  8. [ -f "$MAKERELEASE_LIB" ] && break
  9. MAKERELEASE_LIB="$path/makerelease.lib"
  10. done
  11. [ -f "$MAKERELEASE_LIB" ] && . "$MAKERELEASE_LIB" || die "makerelease.lib not found."
  12. hook_get_version()
  13. {
  14. local file="$1/host/pymoistcontrol/util.py"
  15. local v="$(cat "$file" | grep -e VERSION | head -n1 | awk '{print $3;}' | cut -d'"' -f2)"
  16. version=v"$v"
  17. }
  18. hook_pre_archives()
  19. {
  20. # Build the hex file before packing the tarball.
  21. default_hook_testbuild "$2"/firmware/
  22. cp "$2"/firmware/moistcontrol.hex "$2"/firmware-progmem.hex
  23. cp "$2"/firmware/moistcontrol.eep.hex "$2"/firmware-eeprom.hex
  24. cd "$2"/firmware
  25. make clean
  26. }
  27. project=moistcontrol
  28. makerelease "$@"