1 Star 0 Fork 128

actor168/sysom

forked from anolis/sysom 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
package_rpm_offline.sh 1.41 KB
一键复制 编辑 原始数据 按行查看 历史
SunnyQjm 提交于 2023-10-16 14:54 . release: Upgrade rpm spec to 3.0
#!/bin/bash
version=2.2
echo "Not support offline rpm, please use online rpm or docker image"
exit 1
check_cmd() {
local cmd="$1"
if ! command -v "${cmd}" >/dev/null 2>&1; then
echo >&2 "I require ${cmd} but it's not installed. Aborting."
exit 1
fi
}
green() {
printf '\33[1;32m%b\n\33[0m' "$1"
}
if [ "$UID" -ne 0 ]; then
echo "Please run as root"
exit 1
fi
basedir=`dirname $0`
pushd ${basedir}
###nodejs version should >= 16###
check_cmd yarn
check_cmd tar
check_cmd wget
check_cmd rpmbuild
check_cmd /usr/bin/python3
###rpmbuild will call brp-python-bytecompile, need /usr/bin/python
###/usr/lib/rpm/brp-python-bytecompile /usr/bin/python
###sysom run by python3, we should set /usr/bin/python link to /usr/bin/python3
mv /usr/bin/python /usr/bin/python.bak
ln -s /usr/bin/python3 /usr/bin/python
rm -rf /root/rpmbuild
mkdir -p /root/rpmbuild/BUILD
mkdir -p /root/rpmbuild/SOURCES
mkdir -p /root/rpmbuild/BUILDROOT
mkdir -p /root/rpmbuild/SPECS
mkdir -p /root/rpmbuild/RPMS
mkdir -p /root/rpmbuild/SRPMS
cp tools/deploy/sysom-offline.spec /root/rpmbuild/SPECS
pushd ..
rm -rf sysom-${version}
rm -f sysom-${version}.tar.gz
cp -a sysom sysom-${version}
tar -zcf sysom-${version}.tar.gz sysom-${version}
cp sysom-${version}.tar.gz /root/rpmbuild/SOURCES/
pushd /root/rpmbuild/SPECS
rpmbuild -ba sysom-offline.spec
rm -f /usr/bin/python
mv /usr/bin/python.bak /usr/bin/python
popd
popd
popd
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/actor168/sysom.git
git@gitee.com:actor168/sysom.git
actor168
sysom
sysom
main

搜索帮助