Name:           aws-c-s3
Version:        0.6.7
Release:        1%{dist}
Summary:        AWS Cross-Platform, C99 wrapper for cryptography primitives
License:        Apache-2.0

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

BuildRequires:  cmake
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-http)
BuildRequires:  cmake(aws-c-io)
BuildRequires:  cmake(aws-c-sdkutils)
BuildRequires:  cmake(aws-checksums)
BuildRequires:  cmake(s2n)
BuildRequires:  pkgconfig(libssl)
BuildRequires:  pkgconfig(numa)

Conflicts:      libs3

%description
AWS Crypto Abstraction Layer: Cross-Platform, C99 wrapper for cryptography primitives.


%package libs
Summary:        Shared library files for aws-c-s3 library


%description libs
AWS Crypto Abstraction Layer: Cross-Platform, C99 wrapper for cryptography primitives.

This package contains the dynamically linked library.

%package devel
Summary:        Development files for aws-c-s3 library
Requires:       %{name}-libs = %{version}

%description devel
AWS Crypto Abstraction Layer: Cross-Platform, C99 wrapper for cryptography primitives.

This package contains the development files.

%prep
%autosetup -p1

%build

%cmake -G Ninja \
    -DCMAKE_BUILD_TYPE=Release

%cmake_build


%install
%cmake_install

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

%files
%{_bindir}/s3

%files libs
%doc README.md
%license LICENSE
%{_libdir}/lib*.so.*

%files devel
%{_libdir}/cmake/%{name}/
%{_libdir}/*.so
%{_includedir}/*

