-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Title: add aws-cpp-sdk-s3 static library
- Loading branch information
Showing
3 changed files
with
99 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |