mkit.sh 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. . "$MKIT_DIR/include/build.sh" || die "cannot import build.sh"
  3. . "$MKIT_DIR/include/deploy.sh" || die "cannot import deploy.sh"
  4. . "$MKIT_DIR/include/release.sh" || die "cannot import release.sh"
  5. . "$MKIT_DIR/include/ini.sh" || die "cannot import ini.sh"
  6. MKIT_INI=${MKIT_INI:-mkit.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. mkit_init() {
  12. #
  13. # Do basic initialization
  14. #
  15. # Check for ini file, load variables from config.mk
  16. #
  17. test -f "$MKIT_INI" || die "cannot find mkit.ini: $MKIT_INI"
  18. tmp=$(mktemp)
  19. sed -e 's/ = /=/' < config.mk > "$tmp"
  20. . "$tmp"
  21. rm -f "$tmp"
  22. }
  23. die() {
  24. #
  25. # Exit with message and non-zero exit status
  26. #
  27. echo "fatal: $*" >&2
  28. exit 4
  29. }
  30. warn() {
  31. #
  32. # Print warning message
  33. #
  34. echo "$@" >&2
  35. }
  36. route() {
  37. #
  38. # Call correct function based on $1
  39. #
  40. case $1 in
  41. build|build_manpages|clean|dist|install|release_?|uninstall)
  42. $1
  43. ;;
  44. *)
  45. echo "usage: $(basename "$0") build|clean|dist|install|uninstall" >&2
  46. esac
  47. }