Use vendored dependencies for RHEL builds

This commit is contained in:
Yaakov Selkowitz 2023-04-28 00:13:05 -04:00
parent 94e8900c9b
commit 51da1368e7
3 changed files with 27 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/sevctl-*.crate /sevctl-*.crate
*.rpm *.rpm
/sevctl-0.3.2-vendor.tar.xz

View File

@ -1,17 +1,28 @@
# Generated by rust2rpm 22 # Generated by rust2rpm 22
%bcond_without check %bcond_without check
# RHEL does not have packages for Rust dependencies
%if 0%{?rhel}
%global bundled_rust_deps 1
%else
%global bundled_rust_deps 0
%endif
%global crate sevctl %global crate sevctl
Name: rust-sevctl Name: rust-sevctl
Version: 0.3.2 Version: 0.3.2
Release: 4%{?dist} Release: 5%{?dist}
Summary: Administrative utility for AMD SEV Summary: Administrative utility for AMD SEV
License: Apache-2.0 License: Apache-2.0
URL: https://crates.io/crates/sevctl URL: https://crates.io/crates/sevctl
Source0: %{crates_source} Source0: %{crates_source}
Source1: LICENSE.dependencies Source1: LICENSE.dependencies
# To create the vendor tarball:
# tar xf %%{crate}-%%{version}.crate ; pushd %%{crate}-%%{version} ; \
# cargo vendor && tar Jcvf ../%%{crate}-%%{version}-vendor.tar.xz vendor/ ; popd
Source2: %{crate}-%{version}-vendor.tar.xz
# Temporal patch to update the sev dependency # Temporal patch to update the sev dependency
Patch: sevctl-update-sev.diff Patch: sevctl-update-sev.diff
@ -19,7 +30,13 @@ Patch: sevctl-update-sev.diff
# try to build on other arches # try to build on other arches
ExclusiveArch: x86_64 ExclusiveArch: x86_64
%if 0%{?bundled_rust_deps}
BuildRequires: rust-toolset
# vendored openssl-sys
BuildRequires: openssl-devel
%else
BuildRequires: rust-packaging >= 21 BuildRequires: rust-packaging >= 21
%endif
%global _description %{expand: %global _description %{expand:
Administrative utility for AMD SEV.} Administrative utility for AMD SEV.}
@ -48,10 +65,14 @@ License: Apache-2.0 AND MIT
%prep %prep
%autosetup -n %{crate}-%{version_no_tilde} -p1 %autosetup -n %{crate}-%{version_no_tilde} -p1
cp -pav %{SOURCE1} . cp -pav %{SOURCE1} .
%if 0%{?bundled_rust_deps}
%cargo_prep -V 2
%else
%cargo_prep %cargo_prep
%generate_buildrequires %generate_buildrequires
%cargo_generate_buildrequires %cargo_generate_buildrequires
%endif
%build %build
%cargo_build %cargo_build
@ -65,6 +86,9 @@ cp -pav %{SOURCE1} .
%endif %endif
%changelog %changelog
* Mon May 15 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 0.3.2-5
- Use vendored dependencies for RHEL builds
* Wed May 03 2023 Fabio Valentini <decathorpe@gmail.com> - 0.3.2-4 * Wed May 03 2023 Fabio Valentini <decathorpe@gmail.com> - 0.3.2-4
- Rebuild for openssl crate >= v0.10.48 (RUSTSEC-2023-{0022,0023,0024}) - Rebuild for openssl crate >= v0.10.48 (RUSTSEC-2023-{0022,0023,0024})

View File

@ -1 +1,2 @@
SHA512 (sevctl-0.3.2.crate) = bd41f105a0846c268999cc7b0b93566fbca91faae8c84a09216af63aba575579a27194e4b69a113b5d08c94710a4289002f818625391630862f2963ba1bfe5ce SHA512 (sevctl-0.3.2.crate) = bd41f105a0846c268999cc7b0b93566fbca91faae8c84a09216af63aba575579a27194e4b69a113b5d08c94710a4289002f818625391630862f2963ba1bfe5ce
SHA512 (sevctl-0.3.2-vendor.tar.xz) = 6d03a079dbcdc11a92fae242fe6d51636370962033b33eb6b2ad241df4292be9c32c62a216c8d608ab3bfafca52495a38b3e6ea19d664a8a219491fbf5a7ae72