Package sccache: Specfile

%define _unpackaged_files_terminate_build 1
%define _customdocdir %_docdir/%name

%ifarch x86_64 aarch64 %ix86
%def_with gcs
%def_with s3
# gcs feature depends on ring crate, which is not very portable
%def_without gcs
%def_without s3

Name:    sccache
Version: 0.3.3
Release: alt1

Summary: sccache is ccache with cloud storage
License: Apache-2.0
Group:   Development/Tools

Source:   %name-%version.tar

# cargo-vendor-filterer --all-features false --offline \
#  --platform x86_64-unknown-linux-gnu --exclude-crate-path zstd-sys#zstd
Source1:  vendor.tar

Patch: %name-%version-%release.patch

BuildRequires(pre): rpm-build-rust
BuildRequires: /proc

BuildRequires: pkgconfig(libzstd)
BuildRequires: pkgconfig(openssl)

sccache is a ccache-like compiler caching tool. It is used as a
compiler wrapper and avoids compilation when possible, storing
cached results either on local disk or in one of several cloud
storage backends.

sccache includes support for caching the compilation of C/C++
code, Rust, as well as NVIDIA's CUDA using nvcc.

%patch -p1

tar -xf %SOURCE1

mkdir -p .cargo
cat >> .cargo/config <<EOF
replace-with = "vendored-sources"

directory = "vendor"

%if_with gcs
%if_with s3
%rust_build --no-default-features --features="$features"


%doc docs

* Tue Dec 13 2022 Ivan A. Melnikov <> 0.3.3-alt1
- 0.3.3
- Restrict use of s3 feature to selected architectures,
  due to problems with building ring.

* Sun Oct 16 2022 Ivan A. Melnikov <> 0.3.0-alt2
- Restrict use of gcs feature to build on more architectures

* Wed Oct 12 2022 Ivan A. Melnikov <> 0.3.0-alt1
- Initial build for Sisyphus