From 44e5d95c3e4c2eda6a77c7b952b5c5457f8b329e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Ravier?= Date: Thu, 6 Feb 2025 17:13:57 +0100 Subject: [PATCH 1/2] contrib/packaging/spec: Sync with Fedora changes --- contrib/packaging/bootupd.spec | 61 ++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 21 deletions(-) diff --git a/contrib/packaging/bootupd.spec b/contrib/packaging/bootupd.spec index b6db508f..6bdae6e1 100644 --- a/contrib/packaging/bootupd.spec +++ b/contrib/packaging/bootupd.spec @@ -1,5 +1,4 @@ %bcond_without check -%global __cargo_skip_build 0 %global crate bootupd @@ -8,29 +7,46 @@ Version: 0.2.9 Release: 1%{?dist} Summary: Bootloader updater -License: ASL 2.0 -URL: https://crates.io/crates/bootupd -Source0: https://github.com/coreos/bootupd/releases/download/v%{version}/bootupd-%{version}.tar.zstd -Source1: https://github.com/coreos/bootupd/releases/download/v%{version}/bootupd-%{version}-vendor.tar.zstd +License: Apache-2.0 +URL: https://github.com/coreos/bootupd +Source0: %{url}/releases/download/v%{version}/bootupd-%{version}.crate +Source1: %{url}/releases/download/v%{version}/bootupd-%{version}-vendor.tar.zstd +ExcludeArch: %{ix86} # For now, see upstream -# See https://github.com/coreos/fedora-coreos-tracker/issues/1716 -%if 0%{?fedora} || 0%{?rhel} >= 10 -ExcludeArch: %{ix86} -%endif BuildRequires: make -BuildRequires: cargo -# For autosetup -Sgit -BuildRequires: git -BuildRequires: openssl-devel -BuildRequires: systemd-devel -BuildRequires: systemd-rpm-macros +BuildRequires: openssl-devel +%if 0%{?rhel} +BuildRequires: rust-toolset +%else +BuildRequires: cargo-rpm-macros >= 25 +%endif +BuildRequires: systemd + +%global _description %{expand: +Bootloader updater} +%description %{_description} + +%package -n %{crate} +Summary: %{summary} +# Apache-2.0 +# Apache-2.0 OR BSL-1.0 +# Apache-2.0 OR MIT +# Apache-2.0 WITH LLVM-exception +# Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT +# BSD-3-Clause +# MIT +# MIT OR Apache-2.0 +# Unlicense OR MIT +License: Apache-2.0 AND (Apache-2.0 WITH LLVM-exception) AND BSD-3-Clause AND MIT AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (Unlicense OR MIT) +%{?systemd_requires} -%description -%{summary} +%description -n %{crate} %{_description} -%files +%files -n %{crate} %license LICENSE +%license LICENSE.dependencies +%license cargo-vendor.txt %doc README.md %{_bindir}/bootupctl %{_libexecdir}/bootupd @@ -50,12 +66,15 @@ directory = "vendor" EOF %build -cargo build --release +%cargo_build +%cargo_vendor_manifest +%cargo_license_summary +%{cargo_license} > LICENSE.dependencies %install %make_install INSTALL="install -p -c" -make install-grub-static DESTDIR=%{?buildroot} INSTALL="%{__install} -p" -make install-systemd-unit DESTDIR=%{?buildroot} INSTALL="%{__install} -p" +%{__make} install-grub-static DESTDIR=%{?buildroot} INSTALL="%{__install} -p" +%{__make} install-systemd-unit DESTDIR=%{?buildroot} INSTALL="%{__install} -p" %changelog * Tue Oct 18 2022 Colin Walters - 0.2.8-3 From 55152f12a6f5e9d413c6a725a685f98641eaffc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Ravier?= Date: Fri, 7 Feb 2025 11:10:55 +0100 Subject: [PATCH 2/2] Move systemd unit to systemd folder This folder is already in Cargo.toml (leftover from our previous units) so let's re-use that instead of including the contrib folder that has the specfile in it as well. Fixes: https://github.com/coreos/bootupd/pull/803 --- Makefile | 2 +- {contrib/packaging => systemd}/bootloader-update.service | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename {contrib/packaging => systemd}/bootloader-update.service (100%) diff --git a/Makefile b/Makefile index 59c212c9..82f697a0 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ install-grub-static: install -m 755 -d ${DESTDIR}$(PREFIX)/lib/bootupd/grub2-static/configs.d install-systemd-unit: - install -m 644 -D -t "${DESTDIR}$(PREFIX)/lib/systemd/system/" contrib/packaging/bootloader-update.service + install -m 644 -D -t "${DESTDIR}$(PREFIX)/lib/systemd/system/" systemd/bootloader-update.service bin-archive: rm target/inst -rf diff --git a/contrib/packaging/bootloader-update.service b/systemd/bootloader-update.service similarity index 100% rename from contrib/packaging/bootloader-update.service rename to systemd/bootloader-update.service