From 8001c298dfc6c7f7010a6aad79d9fc6fa5af0c13 Mon Sep 17 00:00:00 2001 From: Sohan Kunkerkar Date: Tue, 10 Aug 2021 15:22:55 -0400 Subject: [PATCH 1/2] Update to 5.1.0 --- .gitignore | 1 + afterburn-fix-metadata.diff | 8 -------- rust-afterburn.spec | 7 ++++--- sources | 2 +- 4 files changed, 6 insertions(+), 12 deletions(-) delete mode 100644 afterburn-fix-metadata.diff diff --git a/.gitignore b/.gitignore index a48d58a..039ea79 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ /afterburn-4.5.3.crate /afterburn-4.6.0.crate /afterburn-5.0.0.crate +/afterburn-5.1.0.crate diff --git a/afterburn-fix-metadata.diff b/afterburn-fix-metadata.diff deleted file mode 100644 index 805aea5..0000000 --- a/afterburn-fix-metadata.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- afterburn-5.0.0/Cargo.toml 2021-04-09T09:31:55+00:00 -+++ afterburn-5.0.0/Cargo.toml 2021-04-09T16:15:41.384358+00:00 -@@ -122,4 +122,4 @@ - [dependencies.vmw_backdoor] - version = "0.2" - [dev-dependencies.mockito] --version = ">= 0.29, < 0.31" -+version = ">= 0.28, < 0.31" diff --git a/rust-afterburn.spec b/rust-afterburn.spec index 4e0aecf..5ea6148 100644 --- a/rust-afterburn.spec +++ b/rust-afterburn.spec @@ -7,7 +7,7 @@ %global crate afterburn Name: rust-%{crate} -Version: 5.0.0 +Version: 5.1.0 Release: 1%{?dist} Summary: Simple cloud provider agent @@ -15,8 +15,6 @@ Summary: Simple cloud provider agent License: ASL 2.0 URL: https://crates.io/crates/afterburn Source: %{crates_source} -# Initial patched metadata -Patch0: afterburn-fix-metadata.diff ExclusiveArch: %{rust_arches} @@ -114,6 +112,9 @@ cp -a dracut/* %{buildroot}%{dracutmodulesdir} %endif %changelog +* Tue Aug 10 2021 Sohan Kunkerkar - 5.1.0-1 +- Update to 5.1.0 + * Fri Apr 09 2021 Sohan Kunkerkar - 5.0.0-1 - Update to 5.0.0 diff --git a/sources b/sources index 77a939f..e5afead 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (afterburn-5.0.0.crate) = 24b824dbea2d0754111ae1431081952d4d62ebe5403a112cbb80d67b0fd55350d870e85300894c2c596e01a3dca126a0ee4deb606ce6fd5570ef2d58f8fa7966 +SHA512 (afterburn-5.1.0.crate) = 2d28b5e13c999019f9978ed80e7e43dfcd936acbb0b3baa98431e4a18141a2e825631c84595a9e24dbff32caaedfc2c409cc70595eb90116e1ad8fabec07685d From 58471669709bbfea21557576980fb366ae0df211 Mon Sep 17 00:00:00 2001 From: Sohan Kunkerkar Date: Wed, 15 Sep 2021 15:13:09 -0400 Subject: [PATCH 2/2] Vendor rust dependencies on el9 --- rust-afterburn.spec | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/rust-afterburn.spec b/rust-afterburn.spec index 5ea6148..a2d39e7 100644 --- a/rust-afterburn.spec +++ b/rust-afterburn.spec @@ -8,17 +8,28 @@ Name: rust-%{crate} Version: 5.1.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Simple cloud provider agent # Upstream license specification: Apache-2.0 License: ASL 2.0 URL: https://crates.io/crates/afterburn -Source: %{crates_source} +Source0: %{crates_source} +%if 0%{?rhel} && !0%{?eln} +Source1: https://github.com/coreos/%{crate}/releases/download/v%{version}/%{crate}-%{version}-vendor.tar.gz +%endif ExclusiveArch: %{rust_arches} - +%if 0%{?rhel} && !0%{?eln} +BuildRequires: rust-toolset +BuildRequires: openssl-devel +# This is needed because the cc crate, which is +# used for linking final build results of crates, +# does not work without it. +BuildRequires: glibc-devel +%else BuildRequires: rust-packaging +%endif BuildRequires: systemd %global _description %{expand: @@ -85,24 +96,42 @@ to run in the initramfs on boot. %prep %autosetup -n %{crate}-%{version_no_tilde} -p1 +%if 0%{?rhel} && !0%{?eln} +tar xvf %{SOURCE1} +mkdir -p .cargo +cat >.cargo/config << EOF +[source.crates-io] +replace-with = "vendored-sources" + +[source.vendored-sources] +directory = "vendor" +EOF +%else +%cargo_prep +%endif # afterburn-sshkeys@.service is by default enabled for the 'core' user in # Fedora CoreOS. # Based on https://github.com/coreos/afterburn/blob/master/Makefile. sed -e 's,@DEFAULT_INSTANCE@,core,' < \ systemd/afterburn-sshkeys@.service.in > \ systemd/afterburn-sshkeys@.service -%cargo_prep +%if !0%{?rhel} || 0%{?eln} %generate_buildrequires %cargo_generate_buildrequires +%endif %build %cargo_build %install +%if 0%{?rhel} && !0%{?eln} +%make_install INSTALL="install -p -c" +%else %cargo_install install -Dpm0644 -t %{buildroot}%{_unitdir} \ systemd/*.service systemd/*.target +%endif mkdir -p %{buildroot}%{dracutmodulesdir} cp -a dracut/* %{buildroot}%{dracutmodulesdir} @@ -112,6 +141,9 @@ cp -a dracut/* %{buildroot}%{dracutmodulesdir} %endif %changelog +* Fri Sep 24 2021 Sohan Kunkerkar - 5.1.0-2 +- Vendor rust dependencies on el9 + * Tue Aug 10 2021 Sohan Kunkerkar - 5.1.0-1 - Update to 5.1.0