diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 30 |
1 files changed, 29 insertions, 1 deletions
@@ -2,7 +2,8 @@ PREFIX = /usr/local MANPREFIX = $(PREFIX)/share/man -DEPENDENCIES = neomutt curl isync msmtp pass ca-certificates gettext +DEPENDENCIES = neomutt curl msmtp pass gettext +NON_EXEC_DEPS = isync ca-certificates check-dependencies: @for dep in $(DEPENDENCIES); do \ @@ -11,6 +12,33 @@ check-dependencies: exit 1; \ fi; \ done + @for dep in $(NON_EXEC_DEPS); do \ + if command -v pacman >/dev/null 2>&1; then \ + if ! pacman -Q $$dep >/dev/null 2>&1; then \ + echo "Error: $$dep is not installed."; \ + exit 1; \ + fi; \ + elif command -v dpkg >/dev/null 2>&1; then \ + if ! dpkg -s $$dep >/dev/null 2>&1; then \ + echo "Error: $$dep is not installed."; \ + exit 1; \ + fi; \ + elif command -v rpm >/dev/null 2>&1; then \ + if ! rpm -q $$dep >/dev/null 2>&1; then \ + echo "Error: $$dep is not installed."; \ + exit 1; \ + fi; \ + elif command -v zypper >/dev/null 2>&1; then \ + if ! zypper se -i $$dep >/dev/null 2>&1; then \ + echo "Error: $$dep is not installed."; \ + exit 1; \ + fi; \ + else \ + echo "Error: Unsupported package manager. Cannot verify installation of $$dep."; \ + exit 1; \ + fi; \ + done + @echo "All dependencies are installed." install-dependencies: @if command -v apt-get >/dev/null 2>&1; then \ |
