1
0

fix: support openEuler build

This commit is contained in:
zhangsz
2025-02-20 19:50:18 +08:00
parent d9c16a616c
commit 1efc851b39

View File

@@ -66,7 +66,7 @@ DebPkgName=${ProjectL}-r${RelVer}-ub*.deb
EmsBEDir=${GitLocalRoot}/be.ems
EmsBuildRoot=${GitLocalRoot}/build.ems
RpmArch=`arch`
RpmsDir=${EmsBuildRoot}/rpmbuild/RPMS/
RpmsDir=${EmsBuildRoot}/rpmbuild/RPMS
ReleaseDir=${EmsBuildRoot}/release
DumpToolDir=${EmsBEDir}/tools/misc
ProjectTag=""
@@ -102,12 +102,69 @@ FrontBuildDir=${BuildOMCDir}/htdocs
FrontSrcDir=${EmsBEDir}/front
BinWriterDir=${HOME}/bin
if [[ ${RpmArch} =~ "x86_64" ]];then
# Get the output of uname -a
UnameOutput=$(uname -a)
# Extract hardware architecture
if [[ $UnameOutput =~ "x86_64" ]]; then
RelArch=amd64
elif [[ ${RpmArch} =~ "aarch64" ]];then
RpmArch=x86_64
elif [[ $UnameOutput =~ "aarch64" ]]; then
RelArch=arm64
RpmArch=aarch64
else
echo "Unsupported hardware architecture"
exit 1
fi
get_os_info() {
if [ -f /etc/os-release ]; then
. /etc/os-release
echo $ID
else
echo "unknown"
fi
}
get_os_version() {
if [ -f /etc/os-release ]; then
. /etc/os-release
echo $VERSION_ID
else
echo "unknown"
fi
}
OSVersion=$(get_os_version)
case $(get_os_info) in
ubuntu|debian)
pkgtype=deb
if [[ "$OSVersion" == "22.04" ]]; then
RelOS=ub22
elif [[ "$OSVersion" == "18.04" ]]; then
RelOS=ub18
else
echo "Unsupported Ubuntu version: $OSVersion"
exit 1
fi
;;
centos|rhel)
pkgtype=rpm
RelOS=ct8
RpmPkgRename=${ProjectL}-${RelVer}.${RelOS}.${RelArch}.${pkgtype}
;;
openEuler)
pkgtype=rpm
RelOS=oe20
RpmPkgName=${ProjectL}-${RelVer}.${RpmArch}.rpm
RpmPkgRename=${ProjectL}-${RelVer}.${RelOS}.${RelArch}.${pkgtype}
;;
*)
echo "Unsupported OS"
exit 1
;;
esac
case "${pkgtype}" in
rpm)
echo "Begin to make ${pkgtype} package ======>"