# Generated by rust2rpm 26 %bcond_without check %global crate vhost-device-vsock %if 0%{?rhel} # RHEL: Use bundled deps as it doesn't ship Rust libraries %global bundled_rust_deps 1 %else # Fedora: Use only system Rust libraries %global bundled_rust_deps 0 %endif Name: rust-vhost-device-vsock Version: 0.2.0 Release: %autorelease Summary: Virtio-vsock device using the vhost-user protocol License: Apache-2.0 OR BSD-3-Clause URL: https://crates.io/crates/vhost-device-vsock Source0: %{crates_source} # Dealing with missing man page within the crate Source100: https://raw.githubusercontent.com/rust-vmm/vhost-device/c5ae1f38f2261036cfa237f01197517a5b4ae67d/%{crate}/%{crate}.1 %if 0%{?bundled_rust_deps} # The source tarball is downloaded using the following commands: # spectool -g rust-vhost-device-vsock.spec Source1: https://github.com/rust-vmm/vhost-device/archive/refs/tags/%{crate}-v%{version}.tar.gz # The vendor tarball is created using cargo-vendor-filterer to remove Windows # related files (https://github.com/cgwalters/cargo-vendor-filterer) # tar xzf vhost-device-vsock-v%%{version}.tar.gz # cd vhost-device-vhost-device-vsock-v%%{version}/vhost-device-vsock/ # cargo vendor-filterer --platform x86_64-unknown-linux-gnu \ # --platform powerpc64le-unknown-linux-gnu \ # --platform aarch64-unknown-linux-gnu \ # --platform s390x-unknown-linux-gnu \ # --platform i686-unknown-linux-gnu # tar Jcf rust-vhost-device-vsock-%%{version}-vendor.tar.xz vendor Source2: rust-vhost-device-vsock-%{version}-vendor.tar.xz %endif # Package dependencies vmm-sys-util, virtio-bindings, virtio-vsock not built for s390x ExcludeArch: s390x %if 0%{?bundled_rust_deps} BuildRequires: rust-toolset # vendored crates dependencies: %else BuildRequires: cargo-rpm-macros >= 24 %endif %global _description %{expand: A virtio-vsock device using the vhost-user protocol.} %description %{_description} %package -n %{crate} Summary: %{summary} # Apache-2.0 # Apache-2.0 OR BSD-3-Clause # Apache-2.0 OR BSL-1.0 # Apache-2.0 OR MIT # Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT # BSD-3-Clause # BSD-3-Clause OR Apache-2.0 # BSD-3-Clause OR MIT OR Apache-2.0 # MIT # MIT OR Apache-2.0 # MPL-2.0 # Unlicense OR MIT # Zlib OR Apache-2.0 OR MIT License: Apache-2.0 AND (Apache-2.0 OR BSD-3-Clause) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-3-Clause AND (BSD-3-Clause OR Apache-2.0) AND (BSD-3-Clause OR MIT OR Apache-2.0) AND MIT AND (MIT OR Apache-2.0) AND MPL-2.0 AND (Unlicense OR MIT) AND (Zlib OR Apache-2.0 OR MIT) # LICENSE.dependencies contains a full license breakdown %description -n %{crate} %{_description} %files -n %{crate} %license LICENSE-APACHE %license LICENSE-BSD-3-Clause %license LICENSE.dependencies %if 0%{?bundled_rust_deps} %license cargo-vendor.txt %endif %doc CHANGELOG.md %doc README.md %{_bindir}/vhost-device-vsock %{_mandir}/man1/* %prep %if 0%{?bundled_rust_deps} # Source2 is vendored dependencies %autosetup -n %{crate}-%{version} -p1 -N %{?bundled_rust_deps:-a1} %{?bundled_rust_deps:-a2} %autopatch -p1 %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 mkdir -p %{buildroot}/%{_mandir}/man1 install -p -m 644 %{SOURCE100} %{buildroot}/%{_mandir}/man1/ %if %{with check} %check %cargo_test %endif %changelog %autochangelog