## START: Set by rpmautospec
## (rpmautospec version 0.3.5)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 1;
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec
%global pkgname thermal_daemon
%bcond qt %[%{undefined rhel} || 0%{?rhel} < 10]
Name: thermald
Version: 2.5.6
Release: %autorelease
Summary: Thermal Management daemon
License: GPLv2+
URL: https://github.com/intel/%{pkgname}
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
# No cpuid.h on other arches.
ExclusiveArch: %{ix86} x86_64
BuildRequires: make
BuildRequires: autoconf autoconf-archive
BuildRequires: automake
BuildRequires: dbus-glib-devel
BuildRequires: desktop-file-utils
BuildRequires: gcc-c++
BuildRequires: libxml2-devel
BuildRequires: systemd-rpm-macros
BuildRequires: upower-devel
BuildRequires: libevdev-devel
BuildRequires: gtk-doc
Requires: dbus%{?_isa}
Requires(pre): glibc-common
Requires(pre): shadow-utils
%{?systemd_requires}
%description
%{name} monitors and controls platform temperature.
Thermal issues are important to handle proactively to reduce performance
impact. %{name} uses the existing Linux kernel infrastructure and can
be easily enhanced.
%if %{with qt}
%package monitor
Summary: Application for monitoring %{name}
License: GPLv3+
BuildRequires: qcustomplot-qt5-devel
BuildRequires: qt5-qtbase-devel
Requires: hicolor-icon-theme
Requires: %{name}%{?_isa} == %{version}-%{release}
%description monitor
This package contains an Application to monitor %{name} for system
developers who want to enable application developers and their
customers with the responsive and flexible thermal management,
supporting optimal performance in desktop, clam-shell, mobile and
embedded devices.
%endif
%prep
%autosetup -n %{pkgname}-%{version} -p 1
# Create tmpfiles.d config.
mkdir -p fedora_addons
cat << EOF > fedora_addons/%{name}.conf
d %{_rundir}/%{name} 0755 root root -
EOF
%if %{with qt}
# Create desktop-file for the monitor-app.
cat << EOF > fedora_addons/%{name}-monitor.desktop
[Desktop Entry]
Name=%{name} Monitor
Comment=Application for monitoring %{name}
Icon=%{name}-monitor
Categories=System;Settings;
Exec=%{_bindir}/ThermalMonitor
Type=Application
StartupNotify=true
Terminal=false
EOF
# Create icon for the monitor-app.
cat << EOF > fedora_addons/%{name}-monitor.svg
EOF
# Create ReadMe.txt for the monitor-app.
cat << EOF > fedora_addons/%{name}-monitor.ReadMe.txt
Running the thermald-monitor-app
--------------------------------
To communicate with thermald via dbus, the user has to be member
of the "power" group. So make sure to add your user id to this
group before using the thermald-monitor-app.
EOF
%endif
NO_CONFIGURE=1 ./autogen.sh
%build
%configure \
--with-systemdsystemunitdir=%{_unitdir} \
--disable-option-checking \
--disable-silent-rules
%make_build
%if %{with qt}
# Build the monitor-app.
pushd tools/thermal_monitor
sed -i -e 's/QCustomPlot/qcustomplot-qt5/' ThermalMonitor.pro
mkdir -p %{_target_platform}
pushd %{_target_platform}
%{qmake_qt5} ..
%make_build
popd
popd
%endif
%install
%make_install
# Install management-script.
install -Dpm 0755 tools/thermald_set_pref.sh \
%{buildroot}%{_bindir}/%{name}-set-pref
# Setup tmpfiles.d
install -Dpm 0644 fedora_addons/%{name}.conf %{buildroot}%{_tmpfilesdir}/%{name}.conf
install -dm 0755 %{buildroot}%{_rundir}/%{name}
/bin/echo "%{name}_pid" > %{buildroot}%{_rundir}/%{name}/%{name}.pid
chmod -c 0644 %{buildroot}%{_rundir}/%{name}/%{name}.pid
%if %{with qt}
# Install the monitor-app.
install -Dpm 0755 tools/thermal_monitor/%{_target_platform}/ThermalMonitor \
%{buildroot}%{_bindir}/ThermalMonitor
install -Dpm 0644 fedora_addons/%{name}-monitor.desktop \
%{buildroot}%{_datadir}/applications/%{name}-monitor.desktop
install -Dpm 0644 fedora_addons/%{name}-monitor.svg \
%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}-monitor.svg
%endif
%check
%if %{with qt}
%{_bindir}/desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
%endif
%pre
/bin/getent group power >/dev/null || /sbin/groupadd -r power
exit 0
%post
%systemd_post thermald.service
%preun
%systemd_preun thermald.service
%postun
%systemd_postun_with_restart thermald.service
%files
%license COPYING
%config(noreplace) %{_sysconfdir}/%{name}
%doc README.txt thermal_daemon_usage.txt
%ghost %dir %{_rundir}/%{name}
%ghost %{_rundir}/%{name}/%{name}.pid
%{_bindir}/%{name}-set-pref
%{_datadir}/dbus-1/system-services/org.freedesktop.%{name}.service
%{_datadir}/dbus-1/system.d/org.freedesktop.%{name}.conf
%{_mandir}/man5/thermal-conf.xml.5*
%{_mandir}/man8/%{name}.8*
%{_sbindir}/%{name}
%{_tmpfilesdir}/%{name}.conf
%{_unitdir}/%{name}.service
%if %{with qt}
%files monitor
%doc fedora_addons/%{name}-monitor.ReadMe.txt
%license tools/thermal_monitor/COPYING
%{_bindir}/ThermalMonitor
%{_datadir}/applications/%{name}-monitor.desktop
%{_datadir}/icons/hicolor/scalable/apps/%{name}-monitor.svg
%endif
%changelog
* Sun Feb 11 2024 Peter Robinson - 2.5.6-1
- Update to 2.5.6, spec cleanups
* Sat Jan 27 2024 Fedora Release Engineering - 2.5-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Aug 16 2023 Yaakov Selkowitz - 2.5-6
- Disable monitor in RHEL builds
* Sun Jul 23 2023 Yaakov Selkowitz - 2.5-5
- Fix build with latest systemd
* Sat Jul 22 2023 Fedora Release Engineering - 2.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Sat Jan 21 2023 Fedora Release Engineering - 2.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Wed Aug 17 2022 Kalev Lember - 2.5-2
- Fix the build
* Tue Aug 16 2022 Kalev Lember - 2.5-1
- Update to 2.5
* Sat Jul 23 2022 Fedora Release Engineering - 2.4.8-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed Feb 09 2022 Benjamin Berg - 2.4.8-4
- Pull in adaptive fixes/improvements and p-p-d integration
* Sat Jan 22 2022 Fedora Release Engineering - 2.4.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Jan 12 2022 Benjamin Berg - 2.4.8-1
- Update to 2.4.8 (#2038523)
* Wed Nov 24 2021 Benjamin Berg - 2.4.6-3
- Pull AlderLake and JasperLake support from upstream
* Fri Jul 23 2021 Fedora Release Engineering - 2.4.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Thu Jun 10 2021 Benjamin Berg - 2.4.6-1
- Update to 2.4.6 (#1965783)
- Update main license to GPLv2 only for now
- Add bundled(qcustomplot) for monitor subpackage
* Fri May 14 2021 Benjamin Berg - 2.4.4-1
- Update to 2.4.4
Resolves: #1935728
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 2.4.1-4
- Rebuilt for updated systemd-rpm-macros
See https://pagure.io/fesco/issue/2583.
* Tue Feb 02 2021 Benjamin Berg - 2.4.1-3
- Add upstream patch fixing parsing of passive targets
* Wed Jan 27 2021 Fedora Release Engineering - 2.4.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Dec 01 2020 Benjamin Berg - 2.4.1-1
- New upstream release (#1903094)
* Thu Nov 26 2020 Benjamin Berg - 2.4-1
- New upstream release (#1901810)
Resolves: #1894178
Resolves: #1892534
* Tue Sep 01 2020 Benjamin Berg - 2.3-2
- Fix Lenovo kill switch (#1874462)
* Tue Aug 25 2020 Benjamin Berg - 2.3-1
- New upstream release 2.3 (rhbz#1866784)
- Add patch to fix printf on non-64 bit
* Wed Jul 29 2020 Fedora Release Engineering - 2.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jun 08 2020 Benjamin Berg - 2.2-1
- New upstream release 2.2 (rhbz#1827883)
* Fri Jan 31 2020 Fedora Release Engineering - 1.9.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Wed Dec 18 2019 Benjamin Berg - 1.9.1-1
- New upstream release 1.9 (rhbz#1782249)
- Drop Patch0, it has been merged upstream
* Fri Sep 20 2019 Christian Kellner - 1.9-1
- New upstream release 1.9 (rhbz#1742290)
- Update patch0 (taken from upstream, commit dcdaf52...)
* Sat Jul 27 2019 Fedora Release Engineering - 1.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri May 17 2019 Benjamin Berg - 1.8-2
- Fix build on i686
* Fri May 17 2019 Benjamin Berg - 1.8-1
- New upstream release (#1582506)
* Sun Feb 03 2019 Fedora Release Engineering - 1.7.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Sat Jul 14 2018 Fedora Release Engineering - 1.7.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Feb 09 2018 Fedora Release Engineering - 1.7.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Dec 28 2017 Björn Esser - 1.7.1-1
- New upstream release (#1505144)
* Thu Aug 03 2017 Fedora Release Engineering - 1.6-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering - 1.6-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Jul 01 2017 Björn Esser - 1.6-6
- Add upstreamed patch to silence compiler warnings
* Sat Jul 01 2017 Björn Esser - 1.6-5
- Replace fix for rhbz#1464548 from upstream commit
- Add upstream patch to fix README
* Fri Jun 30 2017 Björn Esser - 1.6-4
- Add upstream patch to fix ThermalMonitor (rhbz#1464548)
- Add several fixes from upstream
* Tue Apr 11 2017 Björn Esser - 1.6-3
- Explicitly turn on hardening, if required
* Tue Apr 11 2017 Björn Esser - 1.6-2
- Fix missing trailing semicolon in desktop-file
* Tue Apr 11 2017 Björn Esser - 1.6-1
- Initial import (rhbz#1440406)
* Mon Apr 10 2017 Björn Esser - 1.6-0.4
- Use qmake_qt5-macro and build out of tree
* Sat Apr 08 2017 Björn Esser - 1.6-0.3
- Small packaging improvements
* Sat Apr 08 2017 Björn Esser - 1.6-0.2
- Add management-script
* Sat Apr 08 2017 Björn Esser - 1.6-0.1
- Initial rpm-release (rhbz#1440406)