From 4df7b79969e30f50850688af0b40dbb0cc0057db Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 30 May 2023 12:57:15 -0400 Subject: [PATCH] Use vendored dependencies in RHEL builds RHEL does not ship individual Rust dependency packages. However, upstream does provide vendor tarballs which simplifies this greatly. --- .gitignore | 1 + mdevctl.spec | 12 +++++++++++- sources | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c5a2f7c..50f8298 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ /mdevctl-1.0.0.crate /mdevctl-1.1.0.crate /mdevctl-1.2.0.crate +/mdevctl-1.2.0-vendor.tar.gz diff --git a/mdevctl.spec b/mdevctl.spec index ff8fcd7..47b360d 100644 --- a/mdevctl.spec +++ b/mdevctl.spec @@ -10,8 +10,14 @@ Summary: A mediated device management utility for Linux License: LGPLv2 URL: https://crates.io/crates/mdevctl Source: %{crates_source} +Source1: https://github.com/mdevctl/mdevctl/releases/download/v%{version}/mdevctl-%{version}-vendor.tar.gz -BuildRequires: make systemd rust-packaging python3-docutils +BuildRequires: make systemd python3-docutils +%if 0%{?rhel} +BuildRequires: rust-toolset +%else +BuildRequires: rust-packaging >= 21 +%endif Requires(post,postun): %{_sbindir}/udevadm %description @@ -23,10 +29,14 @@ vfio-mdev for assignment to virtual machines. %prep %autosetup -n %{crate}-%{version_no_tilde} -p1 +%if 0%{?rhel} +%cargo_prep -V 1 +%else %cargo_prep %generate_buildrequires %cargo_generate_buildrequires +%endif %build %cargo_build diff --git a/sources b/sources index 17aec06..61b1620 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ SHA512 (mdevctl-1.2.0.crate) = e4880842780d1f3e29da1671151a8415b2b19172bbc379804e4f12a8609b6455d7da68857f9cd77a9e0473024000e80914d3158c781c4291b4814455af254175 +SHA512 (mdevctl-1.2.0-vendor.tar.gz) = 752ad0fe393d2f466dda8da1aefb04f22f447ef288873cb350f0b1ae67f8caae49315be6ea413fd2cbdd89afc1889b8d8e082fe416c45dfa1a4613e0d05943c3