diff --git a/.gitignore b/.gitignore index 1872255..98580dc 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /virtiofsd-1.4.0.crate /virtiofsd-1.5.0.crate /virtiofsd-1.5.1.crate +/virtiofsd-1.5.1-vendor.tar.xz diff --git a/sources b/sources index 6ffbee7..2d9e3d2 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ SHA512 (virtiofsd-1.5.1.crate) = e8a4aaaa6084b5c111333fff738ed8082cd114098dbf4ff42f48192449e899e64fc406de3872adc8e8d82c7a4f9730989e691c80f85ddabb2441908be8460873 +SHA512 (virtiofsd-1.5.1-vendor.tar.xz) = 3a1eecdd70283d003232be0e335f044236554e8155354f7debd69b7e0387dd39b4d1da22ae967bb0e8fcf920a58f023f7a5461f7637855a715ea0ebd1b51f35b diff --git a/virtiofsd.spec b/virtiofsd.spec index 3da8ab1..caee9a9 100644 --- a/virtiofsd.spec +++ b/virtiofsd.spec @@ -7,13 +7,20 @@ Summary: Virtio-fs vhost-user device daemon (Rust version) License: ASL 2.0 and BSD URL: https://gitlab.com/virtio-fs/virtiofsd Source: %{crates_source} -Patch: virtiofsd-relax-env_logger-dep.diff +# To create the vendor tarball: +# tar xf %%{name}-%%{version}.crate ; pushd %%{name}-%%{version} ; \ +# cargo vendor && tar Jcvf ../%%{name}-%%{version}-vendor.tar.xz vendor/ ; popd +Source1: %{name}-%{version}-vendor.tar.xz ExclusiveArch: %{rust_arches} # Some of our deps (i.e. vm-memory) are not available on 32 bits targets. ExcludeArch: i686 +%if 0%{?rhel} +BuildRequires: rust-toolset +%else BuildRequires: rust-packaging >= 21 +%endif BuildRequires: libcap-ng-devel BuildRequires: libseccomp-devel Requires: qemu-common @@ -29,10 +36,14 @@ Provides: qemu-virtiofsd = 2:7.2.1-1 %prep %autosetup -n %{name}-%{version_no_tilde} -p1 +%if 0%{?rhel} +%cargo_prep -V 1 +%else %cargo_prep %generate_buildrequires %cargo_generate_buildrequires +%endif %build %cargo_build