11#! /bin/bash
22clear
3- # 权限检查
3+ m_EnvRelease=0
4+ # 检查
45function InstallEnv_CheckRoot()
56{
67 echo -e " \033[34m检查你的执行权限中。。。\033[0m"
@@ -12,13 +13,60 @@ function InstallEnv_CheckRoot()
1213 exit 0
1314 fi
1415}
16+ function InstallEnv_CheckSystem()
17+ {
18+ if [ $( uname) == " Linux" ] ; then
19+ if [ -f /etc/redhat-release ]; then
20+ if grep -Eq " CentOS" /etc/redhat-release; then
21+ m_EnvRelease=1
22+ m_EnvCurrent=$( cat /etc/redhat-release)
23+ elif grep -Eq " Rocky Linux" /etc/redhat-release; then
24+ m_EnvRelease=1
25+ m_EnvCurrent=$( cat /etc/redhat-release)
26+ elif grep -Eq " Red Hat Enterprise Linux Server" /etc/redhat-release; then
27+ m_EnvRelease=1
28+ m_EnvCurrent=$( cat /etc/redhat-release)
29+ else
30+ echo -e " 不支持的发行版本,无法继续"
31+ exit
32+ fi
33+ elif [ -f /etc/os-release ]; then
34+ SystemID=$( grep " ^ID=" /etc/os-release | cut -d ' =' -f 2 | tr -d ' "' )
35+ if [ " $SystemID " = " ubuntu" ]; then
36+ m_EnvRelease=2
37+ m_EnvCurrent=$( grep " VERSION=" /etc/os-release | cut -d ' "' -f 2)
38+ else
39+ echo -e " 不支持的发行版本,无法继续"
40+ exit
41+ fi
42+ fi
43+ elif [ $( uname) == " Darwin" ] ; then
44+ m_EnvRelease=3
45+ m_EnvCurrent=$( sw_vers)
46+ else
47+ echo -e " 不支持的发行版本,无法继续"
48+ exit
49+ fi
50+ }
1551# 安装框架
1652function InstallEnv_XEngine()
1753{
1854 cd XEngine_Package
19- rm -rf ./XEngine_UBuntu_24.04_x86-64
20- unzip ./XEngine_UBuntu_24.04_x86-64.zip -d ./XEngine_UBuntu_24.04_x86-64
21- cd ./XEngine_UBuntu_24.04_x86-64
55+
56+ if [ " $m_EnvRelease " -eq " 1" ] ; then
57+ rm -rf ./XEngine_RockyLinux_10_x86-64
58+ unzip ./XEngine_RockyLinux_10_x86-64.zip -d ./XEngine_RockyLinux_10_x86-64
59+ cd ./XEngine_RockyLinux_10_x86-64
60+ elif [ " $m_EnvRelease " -eq " 2" ] ; then
61+ rm -rf ./XEngine_UBuntu_24.04_x86-64
62+ unzip ./XEngine_UBuntu_24.04_x86-64.zip -d ./XEngine_UBuntu_24.04_x86-64
63+ cd ./XEngine_UBuntu_24.04_x86-64
64+ elif [ " $m_EnvRelease " -eq " 3" ] ; then
65+ echo -e " not support"
66+ else
67+ echo -e " not support"
68+ fi
69+
2270 chmod 777 ./XEngine_LINEnv.sh
2371 ./XEngine_LINEnv.sh -b -i 6
2472 ./XEngine_LINEnv.sh -i 3
@@ -27,14 +75,23 @@ function InstallEnv_XEngine()
2775# 安装tsduck
2876function InstallEnv_Execution()
2977{
30- apt install libopencv-dev libsdl2-dev -y
31- # 不管有没有安装过,都执行 -i(dpkg 会自动覆盖旧版本)
32- dpkg -i ./tsduck.ubuntu24_amd64.deb ./tsduck-dev.ubuntu24_amd64.deb
33- # 如果依赖未满足,自动修复
34- apt -f install -y
78+ if [ " $m_EnvRelease " -eq " 1" ] ; then
79+ dnf remove sdl2-compat -y
80+ dnf install SDL2-devel opencv-devel ffmpeg-devel --allowerasing -y
81+ dnf install ./tsduck-el10.x86_64.rpm ./tsduck-devel-el10.x86_64.rpm -y
82+ elif [ " $m_EnvRelease " -eq " 2" ] ; then
83+ apt install libopencv-dev libsdl2-dev -y
84+ dpkg -i ./tsduck.ubuntu24_amd64.deb ./tsduck-dev.ubuntu24_amd64.deb
85+ apt -f install -y
86+ elif [ " $m_EnvRelease " -eq " 3" ] ; then
87+ echo -e " not support"
88+ else
89+ echo -e " not support"
90+ fi
3591}
3692
3793InstallEnv_CheckRoot
94+ InstallEnv_CheckSystem
3895InstallEnv_XEngine
3996InstallEnv_Execution
4097
0 commit comments