# Generated by rust2rpm 27 %bcond_without check %bcond bundled_rust_deps %{defined:rhel} %global crate vhost-device-gpu Name: rust-vhost-device-gpu Version: 0.1.0 Release: %autorelease Summary: Virtio-gpu device using the vhost-user protocol License: Apache-2.0 OR BSD-3-Clause URL: https://crates.io/crates/vhost-device-gpu Source0: %{crates_source} # Manually created patch for downstream crate metadata changes # allow mockall 0.11.4 and tempfile <= 3.16.0 for now Patch: vhost-device-gpu-fix-metadata.diff %if %{with bundled_rust_deps} # The vendor tarball is created using cargo-vendor-filterer to remove Windows # related files (https://github.com/cgwalters/cargo-vendor-filterer) # spectool -g rust-vhost-device-gpu.spec # tar xzf vhost-device-gpu-%%{version}.crate # cd vhost-device-gpu-%%{version} # 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 # # Trying to make a reproducible tarball: # tar --sort=name \ # --mtime='2025-03-11' \ # --owner=0 --group=0 --numeric-owner \ # -Jcf rust-vhost-device-gpu-%%{version}-vendor.tar.xz vendor Source1: rust-vhost-device-gpu-%{version}-vendor.tar.xz %endif # Upstream doesn't provide man pages Patch: man-page.patch # Package dependencies vmm-sys-util not built for s390x # Upstream Package dependency vm-memory only support 64bit # The spec fail to build for ppc64le and s390x, due to # the package dependency rust-rutabaga-gfx not built for # these architecture. ExcludeArch: %{ix86} s390x ppc64le %if %{with bundled_rust_deps} BuildRequires: rust-toolset # vendored crates dependencies: %else BuildRequires: cargo-rpm-macros >= 24 %endif BuildRequires: virglrenderer-devel BuildRequires: gfxstream-devel %global _description %{expand: A virtio-gpu device using the vhost-user protocol.} %description %{_description} %package -n %{crate} Summary: %{summary} # (MIT OR Apache-2.0) AND Unicode-DFS-2016 # Apache-2.0 # Apache-2.0 AND BSD-3-Clause # Apache-2.0 OR BSD-3-Clause # Apache-2.0 OR MIT # BSD-2-Clause OR Apache-2.0 OR MIT # BSD-3-Clause # BSD-3-Clause OR Apache-2.0 # MIT # MIT OR Apache-2.0 # Unlicense OR MIT License: (Apache-2.0 OR BSD-3-Clause) AND ((MIT OR Apache-2.0) AND Unicode-DFS-2016) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND Apache-2.0 AND BSD-3-Clause AND MIT AND (Unlicense 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 %{with bundled_rust_deps} %license cargo-vendor.txt %endif %doc CHANGELOG.md %doc README.md %{_bindir}/vhost-device-gpu %{_mandir}/man1/* %package devel Summary: %{summary} BuildArch: noarch %description devel %{_description} This package contains library source intended for building other packages which use the "%{crate}" crate. %files devel %license %{crate_instdir}/LICENSE-APACHE %license %{crate_instdir}/LICENSE-BSD-3-Clause %if %{with bundled_rust_deps} %license cargo-vendor.txt %endif %doc %{crate_instdir}/CHANGELOG.md %doc %{crate_instdir}/README.md %{crate_instdir}/ %package -n %{name}+default-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+default-devel %{_description} This package contains library source intended for building other packages which use the "default" feature of the "%{crate}" crate. %files -n %{name}+default-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+gfxstream-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+gfxstream-devel %{_description} This package contains library source intended for building other packages which use the "gfxstream" feature of the "%{crate}" crate. %files -n %{name}+gfxstream-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+xen-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+xen-devel %{_description} This package contains library source intended for building other packages which use the "xen" feature of the "%{crate}" crate. %files -n %{name}+xen-devel %ghost %{crate_instdir}/Cargo.toml %prep # Source1 is vendored dependencies %autosetup -n %{crate}-%{version_no_tilde} -p1 %{?with_bundled_rust_deps:-a1} %cargo_prep %{?with_bundled_rust_deps:-v vendor} %if %{without bundled_rust_deps} %generate_buildrequires %cargo_generate_buildrequires %endif %build %cargo_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %if %{with bundled_rust_deps} %cargo_vendor_manifest %endif %install %cargo_install mkdir -p %{buildroot}/%{_mandir}/man1 install -p -m 644 vhost-device-gpu.1 %{buildroot}/%{_mandir}/man1/ %if %{with check} %check %cargo_test %endif %changelog %autochangelog