acl/packaging/control

49 lines
973 B
Plaintext
Raw Permalink Normal View History

#!/usr/bin/env bash
set -x
set -euo pipefail
IFS=$'\n\t'
function pack() {
PKG_NAME=${1}
PKG_VERSION=$(grep '^Version:' ${PKG_NAME}.spec | awk '{print $2}')
cd ..
PROJECT_NAME="${PKG_NAME}-${PKG_VERSION}"
2022-07-13 19:02:44 +08:00
git archive --format=tar --prefix=$PROJECT_NAME/ HEAD | (tar xpf -)
2023-03-13 11:08:28 +08:00
tar zcpf ${PROJECT_NAME}.tar.gz ${PROJECT_NAME}
/bin/mv -f ${PROJECT_NAME}.tar.gz packaging/
2017-06-23 12:46:49 +08:00
rm -rf ${PKG_NAME}-${PKG_VERSION}
cd -
}
function help() {
echo "$0 build|pack"
}
2022-07-13 18:57:58 +08:00
# 检测rpmbuild是否可使用--nodebuginfo参数
function debuginfo() {
2023-03-13 11:08:28 +08:00
local exist_debuginfo=`rpmbuild --help | grep 'nodebuginfo' | wc -l`
if [ ${exist_debuginfo} -eq 1 ]; then
echo "--nodebuginfo"
else
echo ""
fi
2022-07-13 18:57:58 +08:00
}
function help() {
echo "$0 build|pack"
}
if [ "$1" == "" ]; then
help
elif [ "$1" == "pack" ];then
pack $2
2022-07-13 18:57:58 +08:00
elif [ "$1" == "debuginfo" ];then
2023-03-13 11:08:28 +08:00
debuginfo
elif [ "$1" == "test" ];then
run_test
else
help
fi