Name: fedora-grub2-theme Version: 1.0 Release: %autorelease Summary: Modern minimal GRUB2 themes for Fedora (multi-variant, text-based) License: MIT URL: https://forge.fedoraproject.org/design/fedora-grub2-theme Source0: %{name}-%{version}.tar.xz BuildArch: noarch Requires: google-noto-sans-fonts Requires: grub2-common Requires: plymouth-theme-bgrt Requires: sed # Tools subpackage dependency separation Suggests: %{name}-tools # -------------------------------------------------- # Description # -------------------------------------------------- %description A modern, minimal, text-based GRUB2 theme collection for Fedora. Designed with zero images and clean typography for a polished, fast boot experience. Includes multiple variants and a CLI tool to switch themes safely. # -------------------------------------------------- # Subpackage: Light theme # -------------------------------------------------- #%%package light #Summary: Light variant of Fedora GRUB2 modern theme #Requires: %%{name} = %%{version}-%%{release} #%%description Light #Light variant of the Fedora GRUB2 modern theme. # -------------------------------------------------- # Subpackage: CLI tools # -------------------------------------------------- %package tools Summary: CLI tools for managing GRUB2 themes Requires: grub2-tools Requires: sed %description tools Provides grub2-theme-switch utility to safely switch themes and regenerate GRUB configuration. # -------------------------------------------------- # Prep # -------------------------------------------------- %prep %autosetup -p1 # -------------------------------------------------- # Build # -------------------------------------------------- %build # Nothing to build # -------------------------------------------------- # Install # -------------------------------------------------- %install rm -rf %{buildroot} # Themes install -d %{buildroot}/boot/grub2/themes/fedora cp -a themes/default/* %{buildroot}/boot/grub2/themes/fedora/ #install -d %%{buildroot}/boot/grub2/themes/fedora-light #cp -a themes/light/* %%{buildroot}/boot/grub2/themes/fedora-light/ # CLI tool install -d %{buildroot}%{_bindir} install -m 0755 tools/grub2-theme-switch %{buildroot}%{_bindir}/grub2-theme-switch #%%config(noreplace) /etc/default/grub %check # Ensure themes exist #test -f themes/fedora/theme.txt #test -f themes/light/theme.txt # Shell validation bash -n tools/grub2-theme-switch # -------------------------------------------------- # Post (minimal, safe) # -------------------------------------------------- %post # Only set default if unset if ! grep -q "^GRUB_THEME=" /etc/default/grub 2>/dev/null; then echo 'GRUB_THEME="/boot/grub2/themes/fedora/theme.txt"' >> /etc/default/grub fi # SELinux context restorecon -Rv /boot/grub2/themes || : # -------------------------------------------------- # Postun (only on erase) # -------------------------------------------------- %postun if [ $1 -eq 0 ]; then sed -i '/^GRUB_THEME=/d' /etc/default/grub fi # -------------------------------------------------- # Transaction Triggers (preferred modern approach) # -------------------------------------------------- %transfiletriggerin -p /bin/sh -- /etc/default/grub /boot/grub2/themes /usr/bin/grub2-theme-switch --rebuild || : %transfiletriggerun -p /bin/sh -- /etc/default/grub /boot/grub2/themes /usr/bin/grub2-theme-switch --rebuild || : # -------------------------------------------------- # Files # -------------------------------------------------- %files %license LICENSE %doc README.md %dir /boot/grub2/themes /boot/grub2/themes/fedora #%%files light #/boot/grub2/themes/fedora-light %files tools %{_bindir}/grub2-theme-switch # -------------------------------------------------- # Changelog # -------------------------------------------------- %changelog %autochangelog