Skip to content

Commit

Permalink
update grpc 1.46.7
Browse files Browse the repository at this point in the history
  • Loading branch information
huaixin.lmy committed Sep 25, 2024
1 parent 1e6ca85 commit ca4d486
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 12 deletions.
51 changes: 41 additions & 10 deletions rpm/devdeps-grpc-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,53 @@ CUR_DIR=$(dirname $(readlink -f "$0"))
ROOT_DIR=$CUR_DIR/../
PROJECT_DIR=${1:-"$CUR_DIR"}
PROJECT_NAME=${2:-"devdeps-grpc"}
VERSION=${3:-"1.20.1"}
VERSION=${3:-"1.46.7"}
RELEASE=${4:-"1"}

# check source code
if [[ -z `find $ROOT_DIR -maxdepth 1 -regex ".*/grpc-$VERSION.*[tar|gz|bz2|xz|zip]$"` ]]; then
echo "Download source code"
cd $ROOT_DIR
git clone https://github.com/grpc/grpc.git -b v1.20.1 --depth 1 grpc-$VERSION
cd grpc-$VERSION
git submodule update --init --recursive
cd $ROOT_DIR
tar -zcvf grpc-$VERSION.tar.gz grpc-$VERSION
bash $CUR_DIR/download.sh $PROJECT_NAME $VERSION $ROOT_DIR
fi

# build dependencies
OS_RELEASE=`grep -Po '(?<=release )\d' /etc/redhat-release`

if [[ x"$OS_RELEASE" == x"3" ]]; then
arch=`uname -p`
target_dir_3rd=${PROJECT_DIR}/deps/3rd
pkg_dir=$target_dir_3rd/pkg
mkdir -p $pkg_dir

dep_pkgs=(obdevtools-cmake-3.22.1-112024083015.al)
download_base_url="http://yum-test.obvos.alibaba-inc.com/oceanbase/development-kit/al"
os_release=8
for dep_pkg in ${dep_pkgs[@]}
do
TEMP=$(mktemp -p "/" -u ".XXXX")
deps_url=${download_base_url}/${os_release}/${arch}
pkg=${dep_pkg}${os_release}.${arch}.rpm
wget $deps_url/$pkg -O $pkg_dir/$TEMP
if [[ $? == 0 ]]; then
mv -f $pkg_dir/$TEMP $pkg_dir/$pkg
fi
(cd $target_dir_3rd && rpm2cpio $pkg_dir/$pkg | cpio -di -u --quiet)
done

# environmental parameters
export PATH=$target_dir_3rd/usr/local/oceanbase/devtools/bin:$PATH

ln -sf $target_dir_3rd/usr/local/oceanbase/devtools/bin/cmake /usr/bin/cmake

else
# prepare building environment
# please prepare environment yourself if the following solution does not work for you.
# depends on cmake(suggest 2.6.0 or higher)
wget http://yum-test.obvos.alibaba-inc.com/oceanbase/OceanBaseTest.repo -P /etc/yum.repos.d/
yum remove cmake -y
yum install cmake-3.11.4 -y
fi

# prepare building environment
# please prepare environment yourself if the following solution does not work for you.

cd $CUR_DIR
bash $CUR_DIR/rpmbuild.sh $PROJECT_DIR $PROJECT_NAME $VERSION $RELEASE
bash $CUR_DIR/rpmbuild.sh $PROJECT_DIR $PROJECT_NAME $VERSION $RELEASE
4 changes: 2 additions & 2 deletions rpm/devdeps-grpc.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: devdeps-grpc
Version: 1.20.1
Version: 1.46.7
Release: %(echo $RELEASE)%{?dist}
Url: https://github.com/grpc/grpc
Summary: gRPC is a modern, open source, high-performance remote procedure call (RPC) framework that can run anywhere.
Expand Down Expand Up @@ -83,4 +83,4 @@ make -j${CPU_CORES} install

%changelog
* Mon Apr 12 2021 oceanbase
- add spec of grpc
- add spec of grpc

0 comments on commit ca4d486

Please sign in to comment.