Name:           aws-crt-cpp
Version:        0.29.5
Release:        1%{dist}
Summary:        AWS C++ wrapper for AWS SDK C libraries
License:        Apache-2.0
URL:            https://aws.amazon.com/sdk-for-cpp/

Source0:        https://github.com/awslabs/aws-crt-cpp/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0:         aws-crt-cpp-fix-cmake-files-destination.patch

BuildRequires:  cmake
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  libstdc++-devel
BuildRequires:  ninja-build
BuildRequires:  pkgconfig
BuildRequires:  cmake(aws-c-auth)
BuildRequires:  cmake(aws-c-cal)
BuildRequires:  cmake(aws-c-common)
BuildRequires:  cmake(aws-c-compression)
BuildRequires:  cmake(aws-c-event-stream)
BuildRequires:  cmake(aws-c-http)
BuildRequires:  cmake(aws-c-io)
BuildRequires:  cmake(aws-c-mqtt)
BuildRequires:  cmake(aws-c-s3)
BuildRequires:  cmake(aws-c-sdkutils)
BuildRequires:  cmake(aws-checksums)
BuildRequires:  cmake(s2n)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(libpulse)
BuildRequires:  pkgconfig(libssl)
BuildRequires:  pkgconfig(zlib)

%description
The AWS SDK for C++ provides a modern C++ (version C++ 11 or later) interface for
Amazon Web Services (AWS). It is meant to be performant and fully functioning with
low- and high-level SDKs, while minimizing dependencies and providing platform
portability (Windows, OSX, Linux, and mobile).


%package libs
Summary:        AWS C++ wrapper for AWS SDK C libraries

%description libs
AWS C++ wrapper for the following AWS SDK C libraries

 * aws-c-common: Cross-platform primitives and data structures.
 * aws-c-io: Cross-platform event-loops, non-blocking I/O, and TLS implementations.
 * aws-c-mqtt: MQTT client.
 * aws-c-auth: Auth signers such as Aws-auth sigv4
 * aws-c-http: HTTP 1.1 client, and websockets (H2 coming soon)
 * aws-checksums: Cross-Platform HW accelerated CRC32c and CRC32 with fallback to efficient SW implementations.
 * aws-c-event-stream: C99 implementation of the vnd.amazon.event-stream content-type.

This package contains the shared libraries.

%package devel
Summary:        AWS C++ wrapper for AWS SDK C libraries - development files
Requires:       %{name}-libs = %{version}

%description devel
AWS C++ wrapper for the following AWS SDK C libraries

 * aws-c-common: Cross-platform primitives and data structures.
 * aws-c-io: Cross-platform event-loops, non-blocking I/O, and TLS implementations.
 * aws-c-mqtt: MQTT client.
 * aws-c-auth: Auth signers such as Aws-auth sigv4
 * aws-c-http: HTTP 1.1 client, and websockets (H2 coming soon)
 * aws-checksums: Cross-Platform HW accelerated CRC32c and CRC32 with fallback to efficient SW implementations.
 * aws-c-event-stream: C99 implementation of the vnd.amazon.event-stream content-type.

This package contains development files.

%prep
%autosetup -p1

%build
%cmake -G Ninja \
    -DCMAKE_BUILD_TYPE=Release \
    -DBUILD_DEPS=OFF \
    -DCMAKE_MODULE_PATH=%{_libdir}/cmake

%cmake_build

%install
%cmake_install


%files
%{_bindir}/*

%files libs
%doc README.md
%{_libdir}/libaws*so

%files devel
%{_includedir}/aws
%{_libdir}/cmake
