e9f703
# Explicitly turn on hardening, if required.
8e40cd
%if 0%{?rhel} && 0%{?rhel} <= 7
e9f703
%global _hardened_build 1
8e40cd
%endif
e9f703
ba8198
%global pkgname thermal_daemon
ba8198
ba8198
ba8198
Name:		thermald
Christian Kellner 09e170
Version:	1.9
Christian Kellner 09e170
Release:	1%{?dist}
ba8198
Summary:	Thermal Management daemon
ba8198
ba8198
License:	GPLv2+
f74837
URL:		https://github.com/intel/%{pkgname}
f74837
Source0:	%{url}/archive/v%{version}/%{name}-%{version}.tar.gz
ba8198
ba8198
# No cpuid.h on other arches.
ba8198
ExclusiveArch:	%{ix86} x86_64
ba8198
ba8198
BuildRequires:	autoconf
ba8198
BuildRequires:	automake
ba8198
BuildRequires:	dbus-glib-devel
ba8198
BuildRequires:	desktop-file-utils
ba8198
BuildRequires:	gcc-c++
ba8198
BuildRequires:	glib-devel
ba8198
BuildRequires:	libxml2-devel
8e40cd
BuildRequires:	systemd-devel
ba8198
ba8198
Requires:	dbus%{?_isa}
ba8198
ba8198
Requires(pre):	glibc-common
ba8198
Requires(pre):	shadow-utils
ba8198
fdc011
Patch001:	0001-Use-correct-format-specifier-for-size_t.patch
fdc011
ba8198
%{?systemd_requires}
ba8198
ba8198
%description
ba8198
%{name} monitors and controls platform temperature.
ba8198
ba8198
Thermal issues are important to handle proactively to reduce performance
ba8198
impact.  %{name} uses the existing Linux kernel infrastructure and can
ba8198
be easily enhanced.
ba8198
ba8198
ba8198
%package monitor
ba8198
Summary:	Application for monitoring %{name}
ba8198
License:	GPLv3+
ba8198
ba8198
BuildRequires:	qt5-qtbase-devel
ba8198
ba8198
Requires:	hicolor-icon-theme
ba8198
Requires:	%{name}%{?_isa}		== %{version}-%{release}
ba8198
ba8198
%description monitor
ba8198
This package contains an Application to monitor %{name} for system
ba8198
developers who want to enable application developers and their
ba8198
customers with the responsive and flexible thermal management,
ba8198
supporting optimal performance in desktop, clam-shell, mobile and
ba8198
embedded devices.
ba8198
ba8198
ba8198
%prep
ba8198
%autosetup -n %{pkgname}-%{version} -p 1
ba8198
ba8198
# Create tmpfiles.d config.
ba8198
%{__mkdir} -p fedora_addons
ba8198
%{__cat} << EOF > fedora_addons/%{name}.conf
ba8198
d %{_rundir}/%{name} 0755 root root -
ba8198
EOF
ba8198
ba8198
# Create desktop-file for the monitor-app.
ba8198
%{__cat} << EOF > fedora_addons/%{name}-monitor.desktop
ba8198
[Desktop Entry]
ba8198
Name=%{name} Monitor
ba8198
Comment=Application for monitoring %{name}
ba8198
Icon=%{name}-monitor
6f6e74
Categories=System;Settings;
ba8198
Exec=%{_bindir}/ThermalMonitor
ba8198
Type=Application
ba8198
StartupNotify=true
ba8198
Terminal=false
ba8198
EOF
ba8198
ba8198
# Create icon for the monitor-app.
ba8198
%{__cat} << EOF > fedora_addons/%{name}-monitor.svg
ba8198
ba8198
ba8198
	 viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
ba8198
ba8198
	C17.68,321.732,10.894,289.661,10.894,256C10.894,120.636,120.636,10.894,256,10.894S501.106,120.636,501.106,256z"/>
ba8198
ba8198
	c0-18.802-7.626-35.818-19.935-48.15l75.101-75.101C410.783,164.298,430.294,207.872,430.294,256z"/>
ba8198
ba8198
	c-73.826,0-136.933-45.895-162.337-110.723C85.935,299.879,81.698,278.43,81.698,256c0-96.256,78.042-174.298,174.298-174.298
ba8198
	c48.128,0,91.702,19.51,123.25,51.047l-75.101,75.101c12.31,12.332,19.935,29.347,19.935,48.15c0,5.588-0.686,11.013-1.95,16.21
ba8198
	L418.332,319.564z"/>
ba8198
ba8198
	l63.706-31.352l96.212-47.365c-1.264-5.196-1.961-10.621-1.961-16.21c0-37.605,30.491-68.085,68.085-68.085
ba8198
	c18.802,0,35.818,7.626,48.15,19.935c12.31,12.332,19.935,29.347,19.935,48.15c0,5.588-0.686,11.013-1.95,16.21l96.202,47.355
ba8198
	L482.038,350.927z"/>
ba8198
<circle style="fill:#EFEFEF;" cx="256" cy="256" r="21.787"/>
ba8198
<g>
ba8198
	
ba8198
		c1.895,3.851,5.762,6.085,9.781,6.085c1.614,0,3.255-0.362,4.802-1.122l77.373-38.087c5.398-2.657,7.62-9.187,4.963-14.584
ba8198
		C203.495,307.369,196.965,305.147,191.566,307.802z"/>
ba8198
	
ba8198
		c26.031-11.098,49.226-27.021,68.936-47.325c4.192-4.316,4.088-11.213-0.228-15.405c-4.317-4.19-11.213-4.087-15.405,0.229
ba8198
		c-36.133,37.22-84.715,57.719-136.799,57.719C249.985,446.638,245.106,451.515,245.106,457.532z"/>
ba8198
	
ba8198
		c3.403-4.961,2.142-11.742-2.82-15.145c-4.958-3.403-11.74-2.142-15.145,2.819l-0.15,0.219
ba8198
		C409.708,369.076,410.969,375.856,415.931,379.26z"/>
ba8198
	
ba8198
		S237.98,288.683,256,288.683S288.681,274.022,288.681,256.002z M245.106,256.002c0-6.007,4.887-10.894,10.894-10.894
ba8198
		c6.007,0,10.894,4.887,10.894,10.894c0,6.007-4.887,10.894-10.894,10.894C249.993,266.896,245.106,262.009,245.106,256.002z"/>
ba8198
	
ba8198
		C187.622,0,123.335,26.629,74.982,74.983C26.629,123.335,0,187.622,0,256c0,34.321,6.685,67.638,19.868,99.032
ba8198
		c0.015,0.039,0.026,0.078,0.042,0.118C59.97,450.433,152.639,512,255.996,512s196.025-61.567,236.085-156.851
ba8198
		c0,0,0-0.001,0.001-0.002l0.002,0.003C505.299,323.726,512,290.367,512,256z M255.996,490.213
ba8198
		c-91.135,0-173.186-52.313-211.823-134.142l150.511-74.087c4.58-2.255,6.98-7.387,5.774-12.348
ba8198
		c-1.097-4.507-1.653-9.095-1.653-13.636c0-31.536,25.657-57.191,57.191-57.191c15.265,0,29.632,5.949,40.44,16.738
ba8198
		c10.802,10.822,16.751,25.188,16.751,40.453c0,4.57-0.552,9.157-1.642,13.636c-1.206,4.961,1.194,10.094,5.775,12.348
ba8198
		l150.499,74.086C429.182,437.898,347.131,490.213,255.996,490.213z M92.591,256c0-90.101,73.303-163.404,163.404-163.404
ba8198
		c39.988,0,77.792,14.274,107.592,40.406l-59.981,59.984c-13.652-10.349-30.203-15.964-47.611-15.964
ba8198
		c-43.549,0-78.979,35.429-78.979,78.979c0,3.354,0.218,6.721,0.651,10.076l-77.795,38.292
ba8198
		C95.042,288.781,92.591,272.563,92.591,256z M378.993,148.407C405.126,178.206,419.4,216.011,419.4,256
ba8198
		c0,16.559-2.443,32.779-7.276,48.367l0.001,0.002l-77.797-38.297c0.43-3.344,0.646-6.712,0.646-10.072
ba8198
		c0-17.413-5.618-33.97-15.981-47.631l0.031,0.01L378.993,148.407z M431.875,314.091c6.176-18.676,9.312-38.169,9.312-58.091
ba8198
		c0-45.811-16.535-89.081-46.766-123.018l5.449-5.448c4.254-4.254,4.254-11.152,0-15.406c-4.253-4.254-11.149-4.254-15.407,0
ba8198
		l-5.449,5.449c-33.938-30.232-77.207-46.768-123.018-46.768C153.881,70.809,70.804,153.885,70.804,256
ba8198
		c0,19.926,3.134,39.421,9.309,58.095L35.774,335.92c-9.286-25.546-13.986-52.377-13.986-79.92
ba8198
		C21.787,126.855,126.854,21.787,256,21.787S490.213,126.855,490.213,256c0,27.547-4.701,54.378-13.987,79.922l0.002,0.003
ba8198
		L431.875,314.091z"/>
ba8198
</g>
ba8198
</svg>
ba8198
EOF
ba8198
ba8198
# Create ReadMe.txt for the monitor-app.
ba8198
%{__cat} << EOF > fedora_addons/%{name}-monitor.ReadMe.txt
ba8198
Running the thermald-monitor-app
ba8198
--------------------------------
ba8198
ba8198
To communicate with thermald via dbus, the user has to be member
ba8198
of the "power" group.  So make sure to add your user id to this
ba8198
group before using the thermald-monitor-app.
ba8198
EOF
ba8198
ba8198
%{_bindir}/autoreconf -fiv
ba8198
ba8198
ba8198
%build
ba8198
%configure									\
ba8198
	--disable-option-checking						\
ba8198
	--disable-silent-rules
ba8198
ba8198
%make_build
ba8198
ba8198
# Build the monitor-app.
ba8198
pushd tools/thermal_monitor
ba8198
%{__mkdir} -p %{_target_platform}
ba8198
pushd %{_target_platform}
ba8198
%{qmake_qt5} ..
ba8198
%make_build
ba8198
popd
ba8198
popd
ba8198
ba8198
ba8198
%install
ba8198
%make_install
ba8198
ba8198
# Install management-script.
ba8198
%{__install} -Dpm 0755 tools/thermald_set_pref.sh				\
ba8198
	%{buildroot}%{_bindir}/%{name}-set-pref
ba8198
ba8198
# DBus config belongs into %%{_datadir}.
ba8198
%{__mkdir} -p %{buildroot}%{_datadir}
ba8198
%{__mv} -f %{buildroot}%{_sysconfdir}/dbus-1/* %{buildroot}%{_datadir}/dbus-1/
ba8198
ba8198
# No Upstart.
ba8198
%{__rm} -fr %{buildroot}%{_sysconfdir}/init
ba8198
ba8198
# Setup tmpfiles.d
ba8198
%{__install} -Dpm 0644 fedora_addons/%{name}.conf				\
ba8198
	%{buildroot}%{_tmpfilesdir}/%{name}.conf
ba8198
%{__install} -dm 0755 %{buildroot}%{_rundir}/%{name}
ba8198
/bin/echo "%{name}_pid" > %{buildroot}%{_rundir}/%{name}/%{name}.pid
ba8198
%{__chmod} -c 0644 %{buildroot}%{_rundir}/%{name}/%{name}.pid
ba8198
ba8198
# Install the monitor-app.
ba8198
%{__install} -Dpm 0755 tools/thermal_monitor/%{_target_platform}/ThermalMonitor	\
ba8198
	%{buildroot}%{_bindir}/ThermalMonitor
ba8198
%{__install} -Dpm 0644 fedora_addons/%{name}-monitor.desktop			\
ba8198
	%{buildroot}%{_datadir}/applications/%{name}-monitor.desktop
ba8198
%{__install} -Dpm 0644 fedora_addons/%{name}-monitor.svg			\
ba8198
	%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}-monitor.svg
ba8198
ba8198
ba8198
%check
ba8198
%{_bindir}/desktop-file-validate						\
ba8198
	%{buildroot}%{_datadir}/applications/*.desktop
ba8198
ba8198
ba8198
%pre
ba8198
/bin/getent group power >/dev/null || /sbin/groupadd -r power
ba8198
exit 0
ba8198
ba8198
ba8198
%post
ba8198
%systemd_post thermald.service
ba8198
ba8198
ba8198
%preun
ba8198
%systemd_preun thermald.service
ba8198
ba8198
ba8198
%postun
ba8198
%systemd_postun_with_restart thermald.service
ba8198
ba8198
%files
ba8198
%config(noreplace) %{_sysconfdir}/%{name}
ba8198
%doc README.txt thermal_daemon_usage.txt
ba8198
%ghost %dir %{_rundir}/%{name}
ba8198
%ghost %{_rundir}/%{name}/%{name}.pid
ba8198
%license COPYING
ba8198
%{_bindir}/%{name}-set-pref
ba8198
%{_datadir}/dbus-1/system-services/org.freedesktop.%{name}.service
ba8198
%{_datadir}/dbus-1/system.d/org.freedesktop.%{name}.conf
ba8198
%{_mandir}/man5/thermal-conf.xml.5*
ba8198
%{_mandir}/man8/%{name}.8*
ba8198
%{_sbindir}/%{name}
ba8198
%{_tmpfilesdir}/%{name}.conf
ba8198
%{_unitdir}/%{name}.service
ba8198
ba8198
ba8198
%files monitor
ba8198
%doc fedora_addons/%{name}-monitor.ReadMe.txt
ba8198
%license tools/thermal_monitor/qcustomplot/GPL.txt
ba8198
%{_bindir}/ThermalMonitor
ba8198
%{_datadir}/applications/%{name}-monitor.desktop
ba8198
%{_datadir}/icons/hicolor/scalable/apps/%{name}-monitor.svg
ba8198
ba8198
ba8198
%changelog
Christian Kellner 09e170
* Fri Sep 20 2019 Christian Kellner <ckellner@redhat.com> - 1.9-1
Christian Kellner 09e170
- New upstream release 1.9 (rhbz#1742290)
Christian Kellner 09e170
- Update patch0 (taken from upstream, commit dcdaf52...)
Christian Kellner 09e170
2f8fad
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-3
2f8fad
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
2f8fad
fdc011
* Fri May 17 2019 Benjamin Berg <bberg@redhat.com> - 1.8-2
fdc011
- Fix build on i686
fdc011
f74837
* Fri May 17 2019 Benjamin Berg <bberg@redhat.com> - 1.8-1
f74837
- New upstream release (#1582506)
f74837
3d5e62
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.1-4
3d5e62
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
3d5e62
6caa92
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.1-3
6caa92
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
6caa92
3d30d3
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.1-2
3d30d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
3d30d3
8e40cd
* Thu Dec 28 2017 Björn Esser <besser82@fedoraproject.org> - 1.7.1-1
8e40cd
- New upstream release (#1505144)
8e40cd
48d9b9
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-8
48d9b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
48d9b9
6ba1bc
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-7
6ba1bc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
6ba1bc
2653fe
* Sat Jul 01 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-6
2653fe
- Add upstreamed patch to silence compiler warnings
2653fe
7edc25
* Sat Jul 01 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-5
7edc25
- Replace fix for rhbz#1464548 from upstream commit
7edc25
- Add upstream patch to fix README
7edc25
5edf9f
* Fri Jun 30 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-4
5edf9f
- Add upstream patch to fix ThermalMonitor (rhbz#1464548)
5edf9f
- Add several fixes from upstream
5edf9f
e9f703
* Tue Apr 11 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-3
e9f703
- Explicitly turn on hardening, if required
e9f703
6f6e74
* Tue Apr 11 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-2
6f6e74
- Fix missing trailing semicolon in desktop-file
6f6e74
ba8198
* Tue Apr 11 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-1
ba8198
- Initial import (rhbz#1440406)
ba8198
ba8198
* Mon Apr 10 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-0.4
ba8198
- Use qmake_qt5-macro and build out of tree
ba8198
ba8198
* Sat Apr 08 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-0.3
ba8198
- Small packaging improvements
ba8198
ba8198
* Sat Apr 08 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-0.2
ba8198
- Add management-script
ba8198
ba8198
* Sat Apr 08 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-0.1
ba8198
- Initial rpm-release (rhbz#1440406)