Skip to content

Commit 6bbe777

Browse files
author
Packit Build
committed
adhering to rust pckaging best practises
* cargo_test disabled due to requirment of sudo access,relying on upstream CI * updated license
1 parent 025b6e4 commit 6bbe777

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

greenboot-rs.spec

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
%global __cargo_is_lib() false
21
%global pkgname greenboot
32

3+
# Tests require privileged operations (grub edits, fs remount) and cannot run in mock.
4+
# Tests are executed in external CI instead.
5+
%bcond check 0
6+
47
Name: greenboot-rs
58
Version: 0.16.0
6-
Release: 3%{?dist}
9+
Release: 4%{?dist}
710
Summary: Generic Health Check Framework for systemd
811
License: (Apache-2.0 OR MIT) AND BSD-3-Clause
912
URL: https://github.com/fedora-iot/greenboot-rs
1013
Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.gz
1114

12-
ExcludeArch: s390x i686 %{power64}
15+
ExcludeArch: %{ix86}
1316

14-
%if 0%{?centos} && !0%{?eln}
15-
BuildRequires: rust-toolset
16-
%else
17-
BuildRequires: rust-packaging
18-
%endif
17+
BuildRequires: cargo-rpm-macros
1918
BuildRequires: systemd-rpm-macros
2019

2120

@@ -31,6 +30,9 @@ Summary: %{summary}
3130
Provides: %{pkgname} = %{version}-%{release}
3231
Obsoletes: %{pkgname} < %{version}-%{release}
3332
Conflicts: %{pkgname} < %{version}-%{release}
33+
34+
# Aggregated license of statically linked dependencies as per %%cargo_license_summary
35+
License: BSD-3-Clause AND ISC AND MIT AND Unicode-DFS-2016 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)
3436
%{?systemd_requires}
3537
Requires: systemd >= 240
3638
Requires: rpm-ostree
@@ -59,18 +61,17 @@ This package adds some default healthchecks for greenboot.
5961
%cargo_prep
6062

6163
%generate_buildrequires
62-
%cargo_generate_buildrequires -a
64+
%cargo_generate_buildrequires
6365

6466
%build
6567
%cargo_build
6668
%{cargo_license_summary}
6769
%{cargo_license} > LICENSE.dependencies
6870

6971
%install
70-
%cargo_install
7172
mkdir -p %{buildroot}%{_libexecdir}
7273
mkdir -p %{buildroot}%{_libexecdir}/%{pkgname}
73-
mv %{buildroot}%{_bindir}/greenboot %{buildroot}%{_libexecdir}/%{pkgname}/%{pkgname}
74+
install -Dpm0755 target/release/greenboot %{buildroot}%{_libexecdir}/%{pkgname}/%{pkgname}
7475
install -Dpm0644 -t %{buildroot}%{_unitdir} usr/lib/systemd/system/*.service
7576
install -Dpm0644 -t %{buildroot}%{_unitdir} usr/lib/systemd/system/*.target
7677
mkdir -p %{buildroot}%{_exec_prefix}/lib/motd.d/
@@ -137,6 +138,9 @@ install -DpZm 0644 usr/lib/systemd/system/greenboot-healthcheck.service.d/10-net
137138
%{_unitdir}/greenboot-healthcheck.service.d/10-network-online.conf
138139

139140
%changelog
141+
* Mon Aug 25 2025 Sayan Paul <saypaul@redhat.com> - 0.16.0-4
142+
- Adhering to rust packaging best practices
143+
140144
* Fri Aug 15 2025 Peter Robinson <pbrobinson@fedoraproject.org> - 0.16.0-3
141145
- Various spec file cleanups
142146

0 commit comments

Comments
 (0)