File ketchup.spec of Package ketchup
Name: ketchup
# This will be set by osc services, that will run after this.
Version: 2.0.0~0
Release: 0
Summary: A kubernetes configuration scrapper.
# If you know the license, put it's SPDX string here.
# Alternately, you can use cargo lock2rpmprovides to help generate this.
License: Apache-2.0
Url: https://github.com/Gagrio/ketchup
Source0: %{name}-%{version}.tar.zst
Source1: vendor.tar.zst
# Pull in the latest rust/cargo toolchain
BuildRequires: cargo
# This contains rpm macros to assist with building
BuildRequires: cargo-packaging
# Disable this line if you wish to support all platforms.
# In most situations, you will likely only target tier1 arches for user facing components.
ExclusiveArch: %{rust_tier1_arches}
%description
A kubernetes configuration scrapper.
%prep
# The number passed to -a (a stands for "after") should be equivalent to the Source tag number
# of the vendor tarball, 1 in this case (from Source1).
%autosetup -p1 -a1
# Set up cargo config for vendored dependencies
mkdir -p .cargo
cat > .cargo/config.toml <<EOF
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "vendor"
EOF
%build
export CARGO_HOME=$PWD/.cargo
%{cargo_build}
%install
# using cargo_install (only supports bindir)
export CARGO_HOME=$PWD/.cargo
%{cargo_install}
%check
export CARGO_HOME=$PWD/.cargo
%{cargo_test}
%files
%license LICENSE
%{_bindir}/%{name}
%changelog