mkit.sh 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. MKIT_DEFAULT_MODE="644"
  11. configure() {
  12. #
  13. # Load variables fdom config.mk
  14. #
  15. tmp=$(mktemp)
  16. sed -e 's/ = /=/' < config.mk > $tmp
  17. . $tmp
  18. rm -f $tmp
  19. PREFIX="$(readlink -f "$PREFIX")"
  20. }
  21. die() {
  22. #
  23. # Exit with message and non-zero exit status
  24. #
  25. echo "fatal: $@" >&2
  26. exit 4
  27. }
  28. warn() {
  29. #
  30. # Print warning message
  31. #
  32. echo "$@" >&2
  33. }
  34. route() {
  35. #
  36. # Call correct function based on $1
  37. #
  38. case $1 in
  39. build|build_manpages|clean|dist|install|release_?|uninstall)
  40. $1
  41. ;;
  42. *)
  43. echo "usage: $(basename $0) build|clean|dist|install|uninstall" >&2
  44. esac
  45. }