Name: t2-fan-control Version: 0.1.0.r458.gccc2e310d673 Release: 100.1.1%{?dist} Summary: GTK fan controller with curves and presets for Apple T2 Macs by Deqrocks License: MIT URL: https://github.com/kaiT2en/KaiT2en-Fedora Source0: KaiT2en-Fedora-source.tar.gz Source1: t2-fan-control-vendor.tar.gz Patch0: 0001-hold-final-curve-speed.patch ExclusiveArch: x86_64 BuildRequires: cargo BuildRequires: rust BuildRequires: gtk4-devel BuildRequires: libadwaita-devel BuildRequires: glib2-devel BuildRequires: systemd-rpm-macros Requires: gtk4 Requires: libadwaita Requires: systemd %description GTK/libadwaita fan controller for Apple T2 Macs. It monitors temperatures and fan speeds, provides fan curves and presets, and uses a root systemd daemon to persist fan-control state. The application supports applesmc, macsmc, and t2smc hwmon backends. %prep %autosetup -n KaiT2en-Fedora-source -a 1 -p1 app=apps/t2-fan-control sed -i 's#/usr/local/bin/t2-fancontrol-gtk#/usr/bin/t2-fancontrol-gtk#g' \ "$app/systemd/t2-fancontrol.service" \ "$app/org.t2fancontrol.gtk.desktop" mkdir -p "$app/.cargo" cat > "$app/.cargo/config.toml" <<'EOF' [source.crates-io] replace-with = "vendored-sources" [source.vendored-sources] directory = "vendor" EOF %build cd apps/t2-fan-control cargo build --frozen --release %install app=apps/t2-fan-control install -Dm0755 "$app/target/release/t2-fancontrol-gtk" %{buildroot}%{_bindir}/t2-fancontrol-gtk install -Dm0644 "$app/org.t2fancontrol.gtk.desktop" %{buildroot}%{_datadir}/applications/org.t2fancontrol.gtk.desktop install -Dm0644 "$app/assets/icons/hicolor/scalable/apps/org.t2fancontrol.gtk.svg" %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/org.t2fancontrol.gtk.svg install -Dm0644 "$app/systemd/t2-fancontrol.service" %{buildroot}%{_unitdir}/t2-fancontrol.service install -Dm0644 /dev/stdin %{buildroot}%{_presetdir}/90-t2-fan-control.preset <<'EOF' disable t2-fancontrol.service EOF %post %systemd_post t2-fancontrol.service if [ -r /etc/t2-fancontrol/config.txt ] && \ grep -Eq '^[[:space:]]*autostart_enabled[[:space:]]*=[[:space:]]*true[[:space:]]*$' /etc/t2-fancontrol/config.txt; then /usr/bin/systemctl enable t2-fancontrol.service >/dev/null 2>&1 || : if [ -d /run/systemd/system ]; then /usr/bin/systemctl restart t2-fancontrol.service >/dev/null 2>&1 || : fi else /usr/bin/systemctl disable t2-fancontrol.service >/dev/null 2>&1 || : if [ -d /run/systemd/system ]; then /usr/bin/systemctl stop t2-fancontrol.service >/dev/null 2>&1 || : fi fi %preun %systemd_preun t2-fancontrol.service %postun %systemd_postun_with_restart t2-fancontrol.service %files %license apps/t2-fan-control/LICENSE %{_bindir}/t2-fancontrol-gtk %{_datadir}/applications/org.t2fancontrol.gtk.desktop %{_datadir}/icons/hicolor/scalable/apps/org.t2fancontrol.gtk.svg %{_unitdir}/t2-fancontrol.service %{_presetdir}/90-t2-fan-control.preset %changelog * Thu Aug 13 2026 Sl (Shahaf Levi) - 0.1.0-1 - Initial package