Name: t2-fan-control Version: 0.1.0.r396.g277b370a1a07 Release: 100.2.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 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 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' enable t2-fancontrol.service EOF %post %systemd_post t2-fancontrol.service if /usr/bin/systemctl list-unit-files t2fanrd.service >/dev/null 2>&1; then /usr/bin/systemctl disable --now t2fanrd.service >/dev/null 2>&1 || : fi if [ -d /run/systemd/system ]; then /usr/bin/systemctl restart t2-fancontrol.service >/dev/null 2>&1 || : fi %preun %systemd_preun t2-fancontrol.service %postun %systemd_postun_with_restart t2-fancontrol.service if [ "$1" -eq 0 ] && /usr/bin/systemctl list-unit-files t2fanrd.service >/dev/null 2>&1; then /usr/bin/systemctl enable t2fanrd.service >/dev/null 2>&1 || : if [ -d /run/systemd/system ]; then /usr/bin/systemctl start t2fanrd.service >/dev/null 2>&1 || : fi fi %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