提交 1c05ac13 编写于 作者: W wangzelin.wzl

add build rpm logic

上级 c9d4ae0f
...@@ -4,7 +4,13 @@ DEP_DIR=${TOPDIR}/deps/3rd/usr/local/oceanbase/deps/devel ...@@ -4,7 +4,13 @@ DEP_DIR=${TOPDIR}/deps/3rd/usr/local/oceanbase/deps/devel
TOOLS_DIR=${TOPDIR}/deps/3rd/usr/local/oceanbase/devtools TOOLS_DIR=${TOPDIR}/deps/3rd/usr/local/oceanbase/devtools
RUNTIME_DIR=${TOPDIR}/deps/3rd/usr RUNTIME_DIR=${TOPDIR}/deps/3rd/usr
CPU_CORES=`grep -c ^processor /proc/cpuinfo` CPU_CORES=`grep -c ^processor /proc/cpuinfo`
MAKE_ARGS=(-j $CPU_CORES) MAKE_ARGS="-j $CPU_CORES"
PACKAGE=${2:-obproxy-ce}
VERSION=${3:-`cat rpm/${PACKAGE}-VER.txt`}
RELEASE=${4:-1}
PREFIX=/home/admin/obproxy
SPEC_FILE=obproxy.spec
function sw() function sw()
{ {
...@@ -35,7 +41,7 @@ function do_init() ...@@ -35,7 +41,7 @@ function do_init()
function do_dep_init() function do_dep_init()
{ {
(cd $TOPDIR/deps/3rd && bash dep_create.sh) cd $TOPDIR/deps/3rd && bash dep_create.sh
cd $TOPDIR cd $TOPDIR
do_init do_init
} }
...@@ -83,18 +89,13 @@ function do_make() ...@@ -83,18 +89,13 @@ function do_make()
{ {
set -x set -x
sw sw
make "${MAKE_ARGS[@]}" make $MAKE_ARGS
} }
function do_rpm() function do_rpm()
{ {
set -x set -x
sw sw
PACKAGE=obproxy-ce
VERSION=3.2.0
RELEASE=1
PREFIX=/home/admin/obproxy
SPEC_FILE=obproxy.spec
echo "[BUILD] make dist..." echo "[BUILD] make dist..."
make dist-gzip || exit 1 make dist-gzip || exit 1
......
...@@ -36,7 +36,9 @@ OceanBase Database Proxy ...@@ -36,7 +36,9 @@ OceanBase Database Proxy
%build %build
./configure CXX=${CXX} CC=${CC} --with-gcc-version=5.2.0 RELEASEID=%{RELEASE} --prefix=%{_prefix} --with-test-case=no --with-release=yes --with-tblib-root=/opt/csr/common --with-easy-root=/usr --with-easy-lib-path=/usr/lib64 --with-svnfile --enable-shared=default --enable-silent-rules ./configure CXX=${CXX} CC=${CC} --with-gcc-version=5.2.0 RELEASEID=%{RELEASE} --prefix=%{_prefix} --with-test-case=no --with-release=yes --with-tblib-root=/opt/csr/common --with-easy-root=/usr --with-easy-lib-path=/usr/lib64 --with-svnfile --enable-shared=default --enable-silent-rules
mkdir -p unittest mkdir -p unittest
make %{?_smp_mflags} CPU_CORES=`grep -c ^processor /proc/cpuinfo`
MAKE_ARGS="-j $CPU_CORES"
make $MAKE_ARGS
%install %install
make DESTDIR=$RPM_BUILD_ROOT install make DESTDIR=$RPM_BUILD_ROOT install
......
3.2.0
\ No newline at end of file
#!/bin/bash
# use by rpm build platform
SCRIPT_DIR=$(cd "$(dirname "$0")";pwd)
TOP_DIR=${1:-${SCRIPT_DIR}/../}
PACKAGE=$2
VERSION=$3
RELEASE=$4
# prepare rpm build dirs
cd $TOP_DIR
sh build.sh clean
# build rpm
cd $TOP_DIR
sh build.sh rpm $PACKAGE $VERSION $RELEASE
find $TOP_DIR/ -name "*.rpm" -maxdepth 1 -exec mv {} $SCRIPT_DIR 2>/dev/null \;
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册