Name:             aws-sdk-cpp
Version:          1.11.327
Release:          6
Summary:          The AWS SDK for C++ provides a modern C++ interface for AWS
License:          Apache-2.0
URL:              https://github.com/aws/aws-sdk-cpp
# Source0 is generated through following steps:
# $ git clone https://github.com/aws/aws-sdk-cpp -b %%{version} --recurse-submodules --depth=1
# $ pushd aws-sdk-cpp && git-archive-all.sh --format tar --prefix aws-sdk-cpp-%%{version}/ aws-sdk-cpp-%%{version}.tar && xz aws-sdk-cpp-%%{version}.tar && popd
# where git-archive-all.sh comes from https://github.com/fabacab/git-archive-all.sh
Source0:          aws-sdk-cpp-%{version}.tar.xz
Source1:          aws-crt-cpp-0.43.2.tar.xz.part00
Source2:          aws-crt-cpp-0.43.2.tar.xz.part01
Patch0:           aws-sdk-cpp-1.11.327-port-to-newer-cmake.patch
Patch1:           fix-CVE-2025-14760.patch
Patch2:           fix-CVE-2026-19642-CVE-2026-19643.patch

BuildRequires:  cmake >= 3.13
BuildRequires:  gcc gcc-c++
BuildRequires:  libcurl-devel
BuildRequires:  openssl-devel
BuildRequires:  zlib-devel

%description
The AWS SDK for C++ provides a modern C++ (version C++ 11 or later) interface 
for Amazon Web Services (AWS). This package contains the S3 component.

%package        devel
Summary:        Development files for %{name}
Requires:       %{name} = %{version}-%{release}

%description    devel
The %{name}-devel package contains libraries and header files for %{name}.

%prep
%autosetup -p1
rm -rf crt/aws-crt-cpp
cat %{SOURCE1} %{SOURCE2} > aws-crt-cpp-0.43.2.tar.xz
tar -xJf aws-crt-cpp-0.43.2.tar.xz -C crt
mv crt/aws-crt-cpp-0.43.2 crt/aws-crt-cpp

%build
%{cmake} \
    -B %{__cmake_builddir} \
    -DBUILD_ONLY="s3" \
    -DCMAKE_CXX_FLAGS="%{build_cxxflags} -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0 -fstack-protector-strong" \
    -DCMAKE_C_FLAGS="%{build_cflags} -std=gnu99 -D_GLIBCXX_USE_CXX11_ABI=0 -fstack-protector-strong" \
    -DCMAKE_SHARED_LINKER_FLAGS="-Wl,-z,relro,-z,now %{build_ldflags}" \
    -DCMAKE_SKIP_RPATH=TRUE \
    -DCMAKE_BUILD_TYPE=Release \
    -DAUTORUN_UNIT_TESTS=OFF \
    -DENABLE_TESTING=OFF

%cmake_build

%install
%cmake_install

%files
%{_libdir}/*.so

%files devel
%{_includedir}/*
%{_libdir}/*.a
%{_libdir}/pkgconfig/*
%{_libdir}/cmake/*
%{_libdir}/*/cmake

%changelog
* Sat Aug 29 2026 yanzhicong <mryanzhicong@163.com> - 1.11.327-6
- Fix CVE-2025-14760, CVE-2026-19642, and CVE-2026-19643 with the CRT Base64 implementation

* Tue Mar 18 2025 lukeman <lukeman@qq.com> - 1.11.327-5
- update the method of obtaining and building the package

* Tue Mar 11 2025 Funda Wang <fundawang@yeah.net> - 1.11.327-4
- build with cmake 4.0
- aws-c-io actually needs gnu99 rather than c99

* Wed Nov 27 2024 Funda Wang <fundawang@yeah.net> - 1.11.327-3
- adopt to new cmake macro
- split out devel package

* Fri Nov 22 2024 liuheng <hengliue@163.com> - 1.11.327-2
- fix bug

* Thu Nov 7 2024 liuheng <hengliue@163.com> - 1.11.327-1
- Initial package