Skip to content

Commit

Permalink
Merge branch aws-sdk-s3 into master
Browse files Browse the repository at this point in the history
Title: add aws-cpp-sdk-s3 static library
  • Loading branch information
ob-robot-pre committed Apr 3, 2024
2 parents cdd4594 + 19d6281 commit 07e3618
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rpm/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ bash devdeps-boost-build.sh
bash devdeps-s2geometry-build.sh
bash devdeps-icu-build.sh
bash devdeps-cos-c-sdk-build.sh

bash devdeps-s3-cpp-sdk-build.sh


if [ ${NEED_BUILD_COMPILER} = 1 ]; then
Expand Down
31 changes: 31 additions & 0 deletions rpm/devdeps-s3-cpp-sdk-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

CUR_DIR=$(dirname $(readlink -f "$0"))
ROOT_DIR=$CUR_DIR/../
PROJECT_DIR=${1:-"$CUR_DIR"}
PROJECT_NAME=${2:-"devdeps-s3-cpp-sdk"}
VERSION=${3:-"1.11.156"}
RELEASE=${4:-"1"}

# check source code
if [[ -z `find $ROOT_DIR -maxdepth 1 -regex ".*/aws-sdk-cpp-$VERSION.*[tar|gz|bz2|xz|zip]$"` ]]; then
echo "Download source code"
cd $ROOT_DIR
wget https://github.com/aws/aws-sdk-cpp/archive/refs/tags/$VERSION.tar.gz \
--no-check-certificate -O aws-sdk-cpp-$VERSION.tar.gz
fi

# depends on cmake(suggest 3.13.0 or higher)
cd $ROOT_DIR
wget http://yum-test.obvos.alibaba-inc.com/oceanbase/OceanBaseTest.repo -P /etc/yum.repos.d/
yum install obdevtools-cmake-3.22.1 -y
yum install zlib -y
yum install zlib-devel -y
yum install obdevtools-gcc9-9.3.0 -y
yum install devdeps-openssl-static-1.1.1u -y
yum install devdeps-libcurl-static-8.2.1 -y

export PATH=/usr/local/oceanbase/devtools/bin:$PATH

cd $CUR_DIR
bash $CUR_DIR/rpmbuild.sh $PROJECT_DIR $PROJECT_NAME $VERSION $RELEASE
67 changes: 67 additions & 0 deletions rpm/devdeps-s3-cpp-sdk.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Name: devdeps-s3-cpp-sdk
Version: 1.11.156
Release: %(echo $RELEASE)%{?dist}
Url: https://github.com/aws/aws-sdk-cpp
Summary: This library supports the interface to operate with amazon simple storage service with C++ language.

Group: oceanbase-devel/dependencies
License: Apache 2.0

%undefine _missing_build_ids_terminate_build
%define _build_id_links compat

# disable check-buildroot
%define __arch_install_post %{nil}

%define _prefix /usr/local/oceanbase/deps/devel
%define _src aws-sdk-cpp-%{version}

%define _buliddir %{_topdir}/BUILD
%define _tmpdir %{_buliddir}/_tmp
%define _root_dir $RPM_BUILD_ROOT%{_prefix}
%define _openssl_path /usr/local/oceanbase/deps/devel
%define _curl_path /usr/local/oceanbase/deps/devel

%define debug_package %{nil}
%define __strip /bin/true

%description
This library aims to enable operation with amazon simple storage service.
It supports multi interface, like put_object、get_object, etc.

%build
rm -rf %{_root_dir}

rm -rf %{_tmpdir}
mkdir -p %{_tmpdir}

cd $OLDPWD/..;
rm -rf %{_src}
tar -zxf %{_src}.tar.gz
cd %{_src}
sh prefetch_crt_dependency.sh
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=%{_openssl_path} \
-DCURL_INCLUDE_DIR=%{_curl_path}/include -DCURL_LIBRARY=%{_curl_path}/lib/libcurl.a \
-DCMAKE_INSTALL_PREFIX=%{_tmpdir} -DCMAKE_PREFIX_PATH=%{_openssl_path} \
-DBUILD_ONLY="s3" -DBUILD_SHARED_LIBS=0 -DENABLE_TESTING=0 \
-DCUSTOM_MEMORY_MANAGEMENT=1 -DAWS_CUSTOM_MEMORY_MANAGEMENT=1
make %{_smp_mflags}
make install

%install
mkdir -p %{_root_dir}
cp -r %{_tmpdir}/lib64 %{_tmpdir}/include %{_root_dir}

%files

%defattr(-,root,root)
%{_prefix}

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%changelog
* Wed Sep 9 2023 oceanbase
- add spec of aws-cpp-sdk for s3

0 comments on commit 07e3618

Please sign in to comment.