mkit.sh 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/bash
  2. . mkit/include/build.sh || die "cannot import build.sh"
  3. . mkit/include/deploy.sh || die "cannot import deploy.sh"
  4. . mkit/include/release.sh || die "cannot import release.sh"
  5. . mkit/include/ini.sh || die "cannot import ini.sh"
  6. MKIT_INI=${MKIT_INI:-mkit/config.ini}
  7. MKIT_INI_EXPAND=2
  8. MKIT_PKGNAME=$(ini 1value "ENV:PKGNAME")
  9. MKIT_PROJNAME=$(ini 1value "ENV:PROJNAME")
  10. configure() {
  11. #
  12. # Load variables fdom config.mk
  13. #
  14. tmp=$(mktemp)
  15. sed -e 's/ = /=/' < config.mk > $tmp
  16. . $tmp
  17. rm -f $tmp
  18. PREFIX="$(readlink -f "$PREFIX")"
  19. }
  20. die() {
  21. #
  22. # Exit with message and non-zero exit status
  23. #
  24. echo "fatal: $@" >&2
  25. exit 4
  26. }
  27. warn() {
  28. #
  29. # Print warning message
  30. #
  31. echo "$@" >&2
  32. }
  33. route() {
  34. #
  35. # Call correct function based on $1
  36. #
  37. case $1 in
  38. build|build_manpages|clean|dist|install|release_?|uninstall)
  39. $1
  40. ;;
  41. *)
  42. echo "usage: $(basename $0) build|clean|dist|install|uninstall" >&2
  43. esac
  44. }