Name: uki-cleanup Version: 0.0.1 Release: 1%{?dist} Summary: Clean up stale kernels, modules, and UKI EFI images License: MIT URL: https://github.com/tecncr/uki-cleanup Source0: %{name}-%{version}.tar.gz BuildArch: noarch BuildRequires: systemd-rpm-macros Requires: bash Requires: systemd Requires: coreutils Requires: findutils Requires: gawk Requires: dnf Requires: rpm %description uki-cleanup removes stale kernel-core RPM packages, /lib/modules entries, and Unified Kernel Image (UKI) EFI binaries, keeping only the currently running kernel. It is designed to run as a systemd oneshot service on every boot. Pass --dry-run to preview changes without applying them. %prep %autosetup %build # Nothing to build — shell script only %install install -Dpm 0755 %{name} %{buildroot}%{_bindir}/%{name} install -Dpm 0644 %{name}.service %{buildroot}%{_unitdir}/%{name}.service %post %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun %{name}.service %files %license LICENSE %{_bindir}/%{name} %{_unitdir}/%{name}.service %changelog %autochangelog