rpm-build

rpm_packaging_guide:Working with SPEC files:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html-single/rpm_packaging_guide/index#doc-wrapper

示例:https://cbs.centos.org/kojifiles/packages/gnutls/3.7.6/20.el9sbase_901/data/logs/x86_64/build.log

chmod -Rf a+rX,u+w,g-w,o-w .
git init -q
git config user.name rpm-build && git config user.email '<rpm-build>' && git config gc.auto 0
git add --force .
git commit -q --allow-empty -a --author 'rpm-build <rpm-build>' -m 'base'
xpatch=gnutls-3.6.7-no-now-guile.patch; cat $xpatch | git apply --index --reject -p1 -; git commit -q -m $xpatch --author 'rpm-build <rpm-build>'

# 如果有多个patch
# xpatch=($(grep  -E '^Patch' gnutls.spec | awk '{print $2}'))
# echo ${xpatch[@]}
# for x in ${xpatch[@]}; do echo ">>> "$x; cat /builddir/gnutls-3.3.29-9.el7_6.src/$x | git apply --index --reject -p1 -; git commit -q -m $xpatch --author 'rpm-build <rpm-build>'; done

# 打包
git archive --format tar.gz --output /xxxpath/xxx.tar.gz master
posted @ 2024-02-02 10:20  LiYanbin  阅读(6)  评论(0编辑  收藏  举报