# Generated by rust2rpm 26 %bcond_without check %if 0%{?rhel} # RHEL: Use bundled deps as it doesn't ship Rust libraries %global bundled_rust_deps 1 # prevent library files from being installed %global cargo_install_lib 0 %else # Fedora: Use only system Rust libraries once all the deps will be available # using vendored crates in the meanwhile %global bundled_rust_deps 0 %endif %global crate cvd2img Name: rust-cvd2img Version: 0.1.1 Release: %autorelease Summary: Tool to transform Android Cuttlefish images into QEMU disk images License: GPL-3.0-or-later URL: https://crates.io/crates/cvd2img Source0: %{crates_source} %if 0%{?bundled_rust_deps} Source2: cvd2img-0.1.1-vendor.tar.xz %endif %if 0%{?bundled_rust_deps} BuildRequires: rust-toolset # vendored crates dependencies: %else BuildRequires: cargo-rpm-macros >= 26 BuildRequires: rust-packaging >= 21 %endif BuildRequires: parted-devel BuildRequires: clang-devel %global _description %{expand: A tool to transform Android Cuttlefish images into QEMU disk images.} %description %{_description} %package -n %{crate} Summary: %{summary} # FIXME: paste output of %%cargo_license_summary here License: # FIXME # LICENSE.dependencies contains a full license breakdown %description -n %{crate} %{_description} %files -n %{crate} %license COPYING %license LICENSE.dependencies %if 0%{?bundled_rust_deps} %license cargo-vendor.txt %endif %doc README.md %{_bindir}/cvd2img %prep %if 0%{?bundled_rust_deps} # Source2 is vendored dependencies %autosetup -n %{crate}-%{version} -p1 -a2 %cargo_prep -v vendor %else %autosetup -n %{crate}-%{version} -p1 %cargo_prep %endif %if ! 0%{?bundled_rust_deps} %generate_buildrequires %cargo_generate_buildrequires %endif %build %cargo_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %if 0%{?bundled_rust_deps} %{cargo_vendor_manifest} %endif %install %cargo_install %if %{with check} %check %cargo_test %endif %changelog %autochangelog