Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 28 additions & 13 deletions core/tabs/system-setup/fedora/rpm-fusion-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,49 @@
. ../../common-script.sh

# https://rpmfusion.org/Configuration
FEDORA_VERSION=$(rpm -E %fedora)

installRPMFusion() {
case "$PACKAGER" in
dnf)
if [ ! -e /etc/yum.repos.d/rpmfusion-free.repo ] || [ ! -e /etc/yum.repos.d/rpmfusion-nonfree.repo ]; then
printf "%b\n" "${YELLOW}Installing RPM Fusion...${RC}"

"$ESCALATION_TOOL" "$PACKAGER" install -y \
"https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm" \
"https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm"

fedora_version=$(rpm -E %fedora)
if [ "$fedora_version" -ge 41 ]; then
"https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$FEDORA_VERSION).noarch.rpm" \
"https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$FEDORA_VERSION.noarch.rpm"

if [ "$FEDORA_VERSION" -ge 41 ]; then
"$ESCALATION_TOOL" "$PACKAGER" config-manager setopt fedora-cisco-openh264.enabled=1
else
"$ESCALATION_TOOL" "$PACKAGER" config-manager --enable fedora-cisco-openh264
fi

"$ESCALATION_TOOL" "$PACKAGER" install -y rpmfusion-\*-appstream-data


else
printf "%b\n" "${GREEN}RPM Fusion already installed${RC}"
fi
;;
*)
printf "%b\n" "${RED}Unsupported distribution: $DTYPE${RC}"
;;
esac
}

installRPMFusionTainted() {
case "$PACKAGER" in
dnf)
if ! rpm -q "rpmfusion-free-release-tainted" >/dev/null 2>&1 || ! rpm -q "rpmfusion-nonfree-release-tainted" >/dev/null 2>&1; then
printf "%b\n" "${YELLOW}Do you want to install tainted repositories? [y/N]: ${RC}"
read -r install_tainted

case "$install_tainted" in
[Yy]*)
printf "%b\n" "${YELLOW}Installing RPM Fusion tainted repositories...${RC}"
"$ESCALATION_TOOL" "$PACKAGER" install -y rpmfusion-free-release-tainted rpmfusion-nonfree-release-tainted
if [ "$fedora_version" -ge 41 ]; then

if [ "$FEDORA_VERSION" -ge 41 ]; then
"$ESCALATION_TOOL" "$PACKAGER" config-manager setopt rpmfusion-free-tainted.enabled=1
"$ESCALATION_TOOL" "$PACKAGER" config-manager setopt rpmfusion-nonfree-tainted.enabled=1
else
Expand All @@ -45,7 +60,7 @@ installRPMFusion() {
;;
esac
else
printf "%b\n" "${GREEN}RPM Fusion already installed${RC}"
printf "%b\n" "${GREEN}RPM Fusion Tainted already installed${RC}"
fi
;;
*)
Expand All @@ -55,5 +70,5 @@ installRPMFusion() {
}

checkEnv
checkEscalationTool
installRPMFusion
installRPMFusion
installRPMFusionTainted