%global debug_package %{nil} %global gitdate 20241008 %global gitabbrev 2046e4c %global rel %{gitdate}git%{gitabbrev} Name: nbfc-linux Version: 0.2.7 Release: 6%{?rel:.%{rel}}%{?dist} Summary: A C port of NoteBook FanControl. License: GPLv3 URL: https://github.com/nbfc-linux/nbfc-linux Source0: %{name}-%{version}%{?gitdate:-%{rel}}.tar.gz Source1: nbfc-linux.nbfc-qt.policy Patch0: do-not-conflict-with-acer-wmi-battery.patch BuildRequires: gcc, systemd-rpm-macros, python3 Requires: python3, systemd Requires: kmod(acpi_ec.ko) Provides: config(nbfc-linux) = %{version}-%{release} %description This is a C port of [Stefan Hirschmann's](https://github.com/hirschmann) [NoteBook FanControl](https://github.com/hirschmann/nbfc). It provides the same utilities with the same interfaces as the original NBFC, although the implementation differs. %prep ##%autosetup -n %{name} -p1 %setup -n %{name} %patch 0 -p0 %build sed -i 's/self\.resize(\(.*\), \(.*\))/self.resize(400, 620)/' nbfc-gui/qt.py make PREFIX=/usr confdir=/etc EMBEDDED_CONTROLLER=acpi_ec %install make install PREFIX=/usr confdir=/etc DESTDIR=$RPM_BUILD_ROOT EMBEDDED_CONTROLLER=acpi_ec ## install the policy for run the GUI as root sed -i 's|TO_BE_REPLACED|%{_bindir}|' %{SOURCE1} install -m755 -d $RPM_BUILD_ROOT%{_datadir}/polkit-1/actions install -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/polkit-1/actions/ install -m755 -d $RPM_BUILD_ROOT%{_datadir}/applications/ ## install the desktop entry cat > %{name}.desktop << EOF [Desktop Entry] Name=NoteBook FanControl Comment=Run nbfc-linux QT GUI Icon=sensors-fan-symbolic Exec=pkexec /usr/bin/nbfc-qt Type=Application Terminal=false Categories=System;Application;Settings;HardwareSettings; StartupWMClass=nbfc-qt EOF install -m644 %{name}.desktop $RPM_BUILD_ROOT%{_datadir}/applications/ ## install the desktop entry cat > %{name}-ro.desktop << EOF [Desktop Entry] Name=NoteBook FanControl (current user) Comment=Run nbfc-linux QT GUI in read-only mode. Icon=sensors-fan-symbolic Exec=/usr/bin/nbfc-qt Type=Application Terminal=false Categories=System;Application;Settings;HardwareSettings; StartupWMClass=python3 EOF install -m644 %{name}-ro.desktop $RPM_BUILD_ROOT%{_datadir}/applications/ %files %license LICENSE %doc ORIGINAL.md README.md TODO %dir %{_sysconfdir}/nbfc %{_bindir}/ec_probe %{_bindir}/nbfc* %{_unitdir}/*.service %{_mandir}/man*/* %{_datadir}/nbfc %{_datadir}/polkit-1/actions/*.policy %{_datadir}/applications/*.desktop %{_datadir}/bash-completion/completions/* %{_datadir}/fish/vendor_completions.d/*.fish %{_datadir}/zsh/site-functions/* %changelog * Sat Nov 02 2024 Andrea Santilli - 0.2.7-6.20241008gitd364cc9 - Fix desktop entry with a correct name and window class. * Sat Nov 02 2024 Andrea Santilli - 0.2.7-5.20241008gitd364cc9 - Add a desktop entry for read-only mode GUI. - Slight adjustment for the GUI size. * Fri Nov 01 2024 Andrea Santilli - 0.2.7-4.20241008gitd364cc9 - Add startup window class to desktop entry. - Remove authentication from any or inactive sessions for running the gui. * Wed Oct 23 2024 Andrea Santilli - 0.2.7-3.20241008gitd364cc9 - Update AN515-57 and AN515-58 patch so that hardware is not reset on service shutdown. * Tue Oct 15 2024 Andrea Santilli - 0.2.7-2.20241008gitd364cc9 - Update to commit 2046e4cc03fdaf403767333055d88bebc117eb10 (version 0.2.7) - Add a polkit policy for running the QT GUI. - Add a desktop entry - Fix the configuration files for AN515-57 and AN515-58 not to conflict with the acpi-wmi-battery module. * Fri Jan 06 2023 Andrea Santilli - 0.1.7-1.20230104gitd364cc9 - Initial RPM release.