Fedora Setup

This commit is contained in:
MangoPig
2026-05-29 15:57:17 +01:00
parent d5bcda270d
commit 3f753d0dd0
8 changed files with 338 additions and 98 deletions

View File

@@ -9,30 +9,38 @@ GREEN='\033[1;32m'
RED='\033[1;31m'
NC='\033[0m'
# OS Detection
if [ -f /etc/os-release ]; then
. /etc/os-release
OS=$ID
fi
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$SCRIPT_DIR/lib/distro.sh"
echo -e "${BLUE} LOG:${YELLOW} Detecting R installation strategy for $OS...${NC}"
if [ "$OS" == "arch" ] || [ "$OS" == "manjaro" ]; then
if is_arch_family; then
echo -e "${BLUE} LOG:${YELLOW} Arch Linux detected. Using system R (Pacman)...${NC}"
# Install R + Build Tools
sudo pacman -S --noconfirm --needed r gcc-fortran curl tar
install_status=0
install_packages r gcc-fortran curl tar || install_status=$?
if [ "$install_status" -eq 42 ]; then
exit 0
elif [ "$install_status" -ne 0 ]; then
exit "$install_status"
fi
echo -e "${GREEN} SUCCESS:${NC} R installed via Pacman."
R_BIN="R"
elif [ "$OS" == "ubuntu" ] || [ "$OS" == "debian" ]; then
elif is_debian_family; then
echo -e "${BLUE} LOG:${YELLOW} Installing Debian build dependencies...${NC}"
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y gfortran curl tar ca-certificates
install_status=0
install_packages gfortran curl tar ca-certificates || install_status=$?
if [ "$install_status" -eq 42 ]; then
exit 0
elif [ "$install_status" -ne 0 ]; then
exit "$install_status"
fi
if ! command -v rig >/dev/null 2>&1; then
echo -e "${BLUE} LOG:${YELLOW} Installing Rig for Debian/Ubuntu...${NC}"
@@ -69,6 +77,23 @@ elif [ "$OS" == "ubuntu" ] || [ "$OS" == "debian" ]; then
fi
R_BIN="rig run"
elif is_fedora_family; then
echo -e "${BLUE} LOG:${YELLOW} Fedora detected. Using system R...${NC}"
install_status=0
install_packages R gcc-gfortran curl tar || install_status=$?
if [ "$install_status" -eq 42 ]; then
exit 0
elif [ "$install_status" -ne 0 ]; then
exit "$install_status"
fi
R_BIN="R"
else
echo -e "${RED} ERROR:${NC} Unsupported OS: $OS"
exit 1
fi
echo -e "${BLUE} LOG:${YELLOW} Installing 'renv' package globally...${NC}"