|
|
|
@ -1,10 +1,11 @@ |
|
|
|
#!/usr/bin/env bash |
|
|
|
#!/usr/bin/env bash |
|
|
|
# Local development setup for gc_index_relay. |
|
|
|
# Local development setup for gc_index_relay (run on your host — NOT inside app Docker images). |
|
|
|
|
|
|
|
# Production/runtime images get dependencies from docker/server.Dockerfile (release build + runtime packages). |
|
|
|
# Safe to run multiple times — all steps are idempotent. |
|
|
|
# Safe to run multiple times — all steps are idempotent. |
|
|
|
# |
|
|
|
# |
|
|
|
# Requirements: |
|
|
|
# Requirements: |
|
|
|
# - Docker must already be installed (https://docs.docker.com/engine/install/) |
|
|
|
# - Docker must already be installed (https://docs.docker.com/engine/install/) |
|
|
|
# - sudo access for apt-get |
|
|
|
# - sudo access to install OS packages (apt-get on Debian/Ubuntu, dnf/yum on Fedora/RHEL) |
|
|
|
# |
|
|
|
# |
|
|
|
# Usage: |
|
|
|
# Usage: |
|
|
|
# chmod +x setup.sh |
|
|
|
# chmod +x setup.sh |
|
|
|
@ -62,10 +63,10 @@ docker info &>/dev/null || err "Docker daemon is not running. Start it and try a |
|
|
|
log "Docker: $(docker --version)" |
|
|
|
log "Docker: $(docker --version)" |
|
|
|
|
|
|
|
|
|
|
|
# --------------------------------------------------------------------------- |
|
|
|
# --------------------------------------------------------------------------- |
|
|
|
# 2. System build dependencies (Debian/Ubuntu/Mint) |
|
|
|
# 2. System build dependencies (Debian/Ubuntu, Fedora, RHEL-like) |
|
|
|
# --------------------------------------------------------------------------- |
|
|
|
# --------------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
if command -v apt-get &>/dev/null; then |
|
|
|
install_system_deps_apt() { |
|
|
|
log "Installing system build dependencies via apt-get..." |
|
|
|
log "Installing system build dependencies via apt-get..." |
|
|
|
sudo apt-get update -qq |
|
|
|
sudo apt-get update -qq |
|
|
|
sudo apt-get install -y \ |
|
|
|
sudo apt-get install -y \ |
|
|
|
@ -76,9 +77,37 @@ if command -v apt-get &>/dev/null; then |
|
|
|
git \ |
|
|
|
git \ |
|
|
|
curl \ |
|
|
|
curl \ |
|
|
|
jq |
|
|
|
jq |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Fedora / RHEL / Alma / Rocky (dnf or yum). Includes openssl/ncurses headers for asdf Erlang builds. |
|
|
|
|
|
|
|
install_system_deps_rpm() { |
|
|
|
|
|
|
|
local pm="$1" |
|
|
|
|
|
|
|
log "Installing system build dependencies via $pm..." |
|
|
|
|
|
|
|
sudo "$pm" install -y \ |
|
|
|
|
|
|
|
gcc \ |
|
|
|
|
|
|
|
gcc-c++ \ |
|
|
|
|
|
|
|
make \ |
|
|
|
|
|
|
|
autoconf \ |
|
|
|
|
|
|
|
automake \ |
|
|
|
|
|
|
|
libtool \ |
|
|
|
|
|
|
|
inotify-tools \ |
|
|
|
|
|
|
|
git \ |
|
|
|
|
|
|
|
curl \ |
|
|
|
|
|
|
|
jq \ |
|
|
|
|
|
|
|
openssl-devel \ |
|
|
|
|
|
|
|
ncurses-devel |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if command -v apt-get &>/dev/null; then |
|
|
|
|
|
|
|
install_system_deps_apt |
|
|
|
|
|
|
|
elif command -v dnf &>/dev/null; then |
|
|
|
|
|
|
|
install_system_deps_rpm dnf |
|
|
|
|
|
|
|
elif command -v yum &>/dev/null; then |
|
|
|
|
|
|
|
install_system_deps_rpm yum |
|
|
|
else |
|
|
|
else |
|
|
|
warn "apt-get not found — skipping system package install." |
|
|
|
warn "No supported package manager found (apt-get, dnf, or yum) — skipping system package install." |
|
|
|
warn "Make sure these are installed manually: build-essential autoconf libtool inotify-tools git curl" |
|
|
|
warn "Install manually (names differ by distro): C toolchain, autoconf, libtool, inotify-tools, git, curl, jq" |
|
|
|
|
|
|
|
warn "For asdf Erlang on Fedora/RHEL, you typically also need: openssl-devel, ncurses-devel" |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# --------------------------------------------------------------------------- |
|
|
|
# --------------------------------------------------------------------------- |
|
|
|
|