## START: Set by rpmautospec ## (rpmautospec version 0.6.0) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 3; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # Generated by rust2rpm 25 %bcond_without check %global crate vhost-device-sound %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-sound Version: 0.2.0 Release: %autorelease Summary: Virtio-sound device using the vhost-user protocol License: Apache-2.0 OR BSD-3-Clause URL: https://crates.io/crates/vhost-device-sound Source0: %{crates_source} %if 0%{?bundled_rust_deps} # The source tarball is downloaded using the following commands: # spectool -g rust-vhost-device-sound.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 xf tar xzf vhost-device-sound-v%%{version}.tar.gz # cd vhost-device-vhost-device-sound-v%%{version}/vhost-device-sound # cargo vendor-filterer --platform x86_64-unknown-linux-gnu \ # --platform powerpc64le-unknown-linux-gnu \ # --platform aarch64-unknown-linux-gnu \ # --platform i686-unknown-linux-gnu # tar jcf rust-vhost-device-sound-%%{version}-vendor.tar.xz vendor Source2: rust-vhost-device-sound-%{version}-vendor.tar.xz %else # Relax alsa and rstest dependencies, as upstream doesn't really depend # on newer features from those crates. Patch: vhost-device-sound-relax-dependencies.patch # Update rust-vmm dependencies. Patch: vhost-device-sound-update-deps.patch %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 ExcludeArch: %{ix86} s390x BuildRequires: dbus-daemon >= 1.14.10 %if 0%{?bundled_rust_deps} BuildRequires: rust-toolset # vendored crates dependencies: BuildRequires: alsa-lib-devel BuildRequires: clang-devel BuildRequires: pipewire-devel %else BuildRequires: cargo-rpm-macros >= 24 %endif %global _description %{expand: A virtio-sound 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 OR BSD-3-Clause # Apache-2.0 OR MIT # BSD-3-Clause # MIT # Unlicense OR MIT License: ((MIT OR Apache-2.0) AND Unicode-DFS-2016) AND Apache-2.0 AND (Apache-2.0 OR BSD-3-Clause) AND (Apache-2.0 OR MIT) 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 0%{?bundled_rust_deps} %license cargo-vendor.txt %endif %doc CHANGELOG.md %doc README.md %{_bindir}/vhost-device-sound %{_mandir}/man1/* %if ! 0%{?bundled_rust_deps} # Packages that build with vendored dependencies MUST NOT provide a Rust library interface # (i.e. in -devel subpackages), because the resulting packages would have broken dependencies. %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 %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}+alsa-backend-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+alsa-backend-devel %{_description} This package contains library source intended for building other packages which use the "alsa-backend" feature of the "%{crate}" crate. %files -n %{name}+alsa-backend-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+pw-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+pw-devel %{_description} This package contains library source intended for building other packages which use the "pw" feature of the "%{crate}" crate. %files -n %{name}+pw-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+pw-backend-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+pw-backend-devel %{_description} This package contains library source intended for building other packages which use the "pw-backend" feature of the "%{crate}" crate. %files -n %{name}+pw-backend-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 %endif %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 vhost-device-sound.1 %{buildroot}/%{_mandir}/man1/ %if %{with check} %check # * skip pipewire tests that fail because it requires test utility to launch a temporary dbus daemon for pipewire. # * skip alsa tests that fail because of unwrapping the result of PCM::new(), which lead to a runtime panic %cargo_test -- -- --skip audio_backends::pipewire::tests::test_pipewire_backend_invalid_stream --skip audio_backends::pipewire::tests::test_pipewire_backend_success --skip audio_backends::tests::test_alloc_audio_backend --skip audio_backends::alsa::tests::test_alsa_invalid_fmt --skip audio_backends::alsa::tests::test_alsa_valid_parameters --skip audio_backends::alsa::tests::test_alsa_ops --skip audio_backends::alsa::tests::test_alsa_invalid_rate --skip audio_backends::alsa::tests::test_alsa_invalid_state_transitions --skip audio_backends::alsa::tests::test_alsa_invalid_stream_id %endif %changelog ## START: Generated by rpmautospec * Thu Nov 14 2024 Sergio Lopez - 0.2.0-3 - Add a patch to update rust-vmm dependencies * Sun Oct 13 2024 Davide Cavalca - 0.2.0-2 - Drop alsa dependency downgrade * Thu Jul 18 2024 Sergio Lopez - 0.2.0-1 - Update to version 0.2.0 * Thu Jul 11 2024 Sandro Bonazzola - 0.1.0-3 - Introduce packaging for RHEL * Thu May 23 2024 Fabio Valentini - 0.1.0-2 - Rebuild with Rust 1.78 to fix incomplete debuginfo and backtraces * Wed May 15 2024 Dorinda Bassey - 0.1.0-1 - Initial import (fedora#2274028). ## END: Generated by rpmautospec