%global pkgname thermal_daemon %bcond qt %[%{undefined rhel} || 0%{?rhel} < 10] Name: thermald Version: 2.5.7 Release: %autorelease Summary: Thermal Management daemon License: GPLv2+ URL: https://github.com/intel/%{pkgname} Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz # https://github.com/intel/thermal_daemon/pull/441 # Deprecate intel-modem and dbus-glib Patch001: 441.patch # No cpuid.h on other arches. ExclusiveArch: %{ix86} x86_64 BuildRequires: make BuildRequires: autoconf autoconf-archive BuildRequires: automake 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 %autochangelog