mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-02 03:47:53 +08:00
optimize rpm building for CentOS
This commit is contained in:
parent
0f8e3cd676
commit
bbb9b6da29
@ -11,14 +11,17 @@ PKG_VERSION = $(shell grep '^Version:' $(PKG_NAME).spec | awk '{print $$2}')
|
||||
|
||||
PWD = $(shell pwd)
|
||||
|
||||
DEBUGINFO=$(shell ./control debuginfo )
|
||||
|
||||
all: libs
|
||||
|
||||
debuginfo:
|
||||
tar:
|
||||
@./control pack ${PKG_NAME}
|
||||
|
||||
libs: tar
|
||||
@mkdir -p {BUILD,BUILDROOT,SRPMS,SPECS}
|
||||
@rpmbuild --define "_topdir ${PWD}" --define "_sourcedir ${PWD}" --define "_rpmdir ${PWD}" --nodebuginfo -bb $(PKG_NAME).spec
|
||||
@rpmbuild --define "_topdir ${PWD}" --define "_sourcedir ${PWD}" --define "_rpmdir ${PWD}" ${DEBUGINFO} -bb $(PKG_NAME).spec
|
||||
@echo Binary PRM for $(PKG_NAME) has been created under ${PWD}/`rpm --eval '%{_arch}'`
|
||||
|
||||
clean cl:
|
||||
|
12
packaging/control
Executable file → Normal file
12
packaging/control
Executable file → Normal file
@ -20,6 +20,16 @@ function help() {
|
||||
echo "$0 build|pack"
|
||||
}
|
||||
|
||||
# 检测rpmbuild是否可使用--nodebuginfo参数
|
||||
function debuginfo() {
|
||||
local exist_debuginfo=`rpmbuild --help |grep 'nodebuginfo' |wc -l`
|
||||
if [ ${exist_debuginfo} -eq 1 ]; then
|
||||
echo "--nodebuginfo"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
function help() {
|
||||
echo "$0 build|pack"
|
||||
@ -29,6 +39,8 @@ if [ "$1" == "" ]; then
|
||||
help
|
||||
elif [ "$1" == "pack" ];then
|
||||
pack $2
|
||||
elif [ "$1" == "debuginfo" ];then
|
||||
debuginfo
|
||||
elif [ "$1" == "test" ];then
|
||||
run_test
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user