Blame SPECS/thermald.spec

1f926c
# Explicitly turn on hardening, if required.
1f926c
%if 0%{?rhel} && 0%{?rhel} <= 7
1f926c
%global _hardened_build 1
1f926c
%endif
1f926c
1f926c
%global pkgname thermal_daemon
1f926c
1f926c
1f926c
Name:		thermald
1f926c
Version:	1.9.1
1f926c
Release:	2%{?dist}
1f926c
Summary:	Thermal Management daemon
1f926c
1f926c
License:	GPLv2+
1f926c
URL:		https://github.com/intel/%{pkgname}
1f926c
Source0:	%{url}/archive/v%{version}/%{name}-%{version}.tar.gz
1f926c
1f926c
# No cpuid.h on other arches.
1f926c
ExclusiveArch:	%{ix86} x86_64
1f926c
1f926c
BuildRequires:	autoconf
1f926c
BuildRequires:	automake
1f926c
BuildRequires:	dbus-glib-devel
1f926c
BuildRequires:	desktop-file-utils
1f926c
BuildRequires:	gcc-c++
1f926c
BuildRequires:	libxml2-devel
1f926c
BuildRequires:	systemd-devel
1f926c
1f926c
Requires:	dbus%{?_isa}
1f926c
1f926c
Requires(pre):	glibc-common
1f926c
Requires(pre):	shadow-utils
1f926c
1f926c
%{?systemd_requires}
1f926c
1f926c
%description
1f926c
%{name} monitors and controls platform temperature.
1f926c
1f926c
Thermal issues are important to handle proactively to reduce performance
1f926c
impact.  %{name} uses the existing Linux kernel infrastructure and can
1f926c
be easily enhanced.
1f926c
1f926c
1f926c
%package monitor
1f926c
Summary:	Application for monitoring %{name}
1f926c
License:	GPLv3+
1f926c
1f926c
BuildRequires:	qt5-qtbase-devel
1f926c
1f926c
Requires:	hicolor-icon-theme
1f926c
Requires:	%{name}%{?_isa}		== %{version}-%{release}
1f926c
1f926c
%description monitor
1f926c
This package contains an Application to monitor %{name} for system
1f926c
developers who want to enable application developers and their
1f926c
customers with the responsive and flexible thermal management,
1f926c
supporting optimal performance in desktop, clam-shell, mobile and
1f926c
embedded devices.
1f926c
1f926c
1f926c
%prep
1f926c
%autosetup -n %{pkgname}-%{version} -p 1
1f926c
1f926c
# Create tmpfiles.d config.
1f926c
%{__mkdir} -p fedora_addons
1f926c
%{__cat} << EOF > fedora_addons/%{name}.conf
1f926c
d %{_rundir}/%{name} 0755 root root -
1f926c
EOF
1f926c
1f926c
# Create desktop-file for the monitor-app.
1f926c
%{__cat} << EOF > fedora_addons/%{name}-monitor.desktop
1f926c
[Desktop Entry]
1f926c
Name=%{name} Monitor
1f926c
Comment=Application for monitoring %{name}
1f926c
Icon=%{name}-monitor
1f926c
Categories=System;Settings;
1f926c
Exec=%{_bindir}/ThermalMonitor
1f926c
Type=Application
1f926c
StartupNotify=true
1f926c
Terminal=false
1f926c
EOF
1f926c
1f926c
# Create icon for the monitor-app.
1f926c
%{__cat} << EOF > fedora_addons/%{name}-monitor.svg
1f926c
1f926c
1f926c
	 viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
1f926c
1f926c
	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"/>
1f926c
1f926c
	c0-18.802-7.626-35.818-19.935-48.15l75.101-75.101C410.783,164.298,430.294,207.872,430.294,256z"/>
1f926c
1f926c
	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
1f926c
	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
1f926c
	L418.332,319.564z"/>
1f926c
1f926c
	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
1f926c
	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
1f926c
	L482.038,350.927z"/>
1f926c
<circle style="fill:#EFEFEF;" cx="256" cy="256" r="21.787"/>
1f926c
<g>
1f926c
	
1f926c
		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
1f926c
		C203.495,307.369,196.965,305.147,191.566,307.802z"/>
1f926c
	
1f926c
		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
1f926c
		c-36.133,37.22-84.715,57.719-136.799,57.719C249.985,446.638,245.106,451.515,245.106,457.532z"/>
1f926c
	
1f926c
		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
1f926c
		C409.708,369.076,410.969,375.856,415.931,379.26z"/>
1f926c
	
1f926c
		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
1f926c
		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"/>
1f926c
	
1f926c
		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
1f926c
		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
1f926c
		c0,0,0-0.001,0.001-0.002l0.002,0.003C505.299,323.726,512,290.367,512,256z M255.996,490.213
1f926c
		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
1f926c
		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
1f926c
		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
1f926c
		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
1f926c
		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
1f926c
		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
1f926c
		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
1f926c
		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
1f926c
		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
1f926c
		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
1f926c
		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
1f926c
		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
1f926c
		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
1f926c
		L431.875,314.091z"/>
1f926c
</g>
1f926c
</svg>
1f926c
EOF
1f926c
1f926c
# Create ReadMe.txt for the monitor-app.
1f926c
%{__cat} << EOF > fedora_addons/%{name}-monitor.ReadMe.txt
1f926c
Running the thermald-monitor-app
1f926c
--------------------------------
1f926c
1f926c
To communicate with thermald via dbus, the user has to be member
1f926c
of the "power" group.  So make sure to add your user id to this
1f926c
group before using the thermald-monitor-app.
1f926c
EOF
1f926c
1f926c
%{_bindir}/autoreconf -fiv
1f926c
1f926c
1f926c
%build
1f926c
%configure									\
1f926c
	--disable-option-checking						\
1f926c
	--disable-silent-rules
1f926c
1f926c
%make_build
1f926c
1f926c
# Build the monitor-app.
1f926c
pushd tools/thermal_monitor
1f926c
%{__mkdir} -p %{_target_platform}
1f926c
pushd %{_target_platform}
1f926c
%{qmake_qt5} ..
1f926c
%make_build
1f926c
popd
1f926c
popd
1f926c
1f926c
1f926c
%install
1f926c
%make_install
1f926c
1f926c
# Install management-script.
1f926c
%{__install} -Dpm 0755 tools/thermald_set_pref.sh				\
1f926c
	%{buildroot}%{_bindir}/%{name}-set-pref
1f926c
1f926c
# DBus config belongs into %%{_datadir}.
1f926c
%{__mkdir} -p %{buildroot}%{_datadir}
1f926c
%{__mv} -f %{buildroot}%{_sysconfdir}/dbus-1/* %{buildroot}%{_datadir}/dbus-1/
1f926c
1f926c
# No Upstart.
1f926c
%{__rm} -fr %{buildroot}%{_sysconfdir}/init
1f926c
1f926c
# Setup tmpfiles.d
1f926c
%{__install} -Dpm 0644 fedora_addons/%{name}.conf				\
1f926c
	%{buildroot}%{_tmpfilesdir}/%{name}.conf
1f926c
%{__install} -dm 0755 %{buildroot}%{_rundir}/%{name}
1f926c
/bin/echo "%{name}_pid" > %{buildroot}%{_rundir}/%{name}/%{name}.pid
1f926c
%{__chmod} -c 0644 %{buildroot}%{_rundir}/%{name}/%{name}.pid
1f926c
1f926c
# Install the monitor-app.
1f926c
%{__install} -Dpm 0755 tools/thermal_monitor/%{_target_platform}/ThermalMonitor	\
1f926c
	%{buildroot}%{_bindir}/ThermalMonitor
1f926c
%{__install} -Dpm 0644 fedora_addons/%{name}-monitor.desktop			\
1f926c
	%{buildroot}%{_datadir}/applications/%{name}-monitor.desktop
1f926c
%{__install} -Dpm 0644 fedora_addons/%{name}-monitor.svg			\
1f926c
	%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}-monitor.svg
1f926c
1f926c
1f926c
%check
1f926c
%{_bindir}/desktop-file-validate						\
1f926c
	%{buildroot}%{_datadir}/applications/*.desktop
1f926c
1f926c
1f926c
%pre
1f926c
/bin/getent group power >/dev/null || /sbin/groupadd -r power
1f926c
exit 0
1f926c
1f926c
1f926c
%post
1f926c
%systemd_post thermald.service
1f926c
1f926c
1f926c
%preun
1f926c
%systemd_preun thermald.service
1f926c
1f926c
1f926c
%postun
1f926c
%systemd_postun_with_restart thermald.service
1f926c
1f926c
%files
1f926c
%config(noreplace) %{_sysconfdir}/%{name}
1f926c
%doc README.txt thermal_daemon_usage.txt
1f926c
%ghost %dir %{_rundir}/%{name}
1f926c
%ghost %{_rundir}/%{name}/%{name}.pid
1f926c
%license COPYING
1f926c
%{_bindir}/%{name}-set-pref
1f926c
%{_datadir}/dbus-1/system-services/org.freedesktop.%{name}.service
1f926c
%{_datadir}/dbus-1/system.d/org.freedesktop.%{name}.conf
1f926c
%{_mandir}/man5/thermal-conf.xml.5*
1f926c
%{_mandir}/man8/%{name}.8*
1f926c
%{_sbindir}/%{name}
1f926c
%{_tmpfilesdir}/%{name}.conf
1f926c
%{_unitdir}/%{name}.service
1f926c
1f926c
1f926c
%files monitor
1f926c
%doc fedora_addons/%{name}-monitor.ReadMe.txt
1f926c
%license tools/thermal_monitor/qcustomplot/GPL.txt
1f926c
%{_bindir}/ThermalMonitor
1f926c
%{_datadir}/applications/%{name}-monitor.desktop
1f926c
%{_datadir}/icons/hicolor/scalable/apps/%{name}-monitor.svg
1f926c
1f926c
1f926c
%changelog
1f926c
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.1-2
1f926c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
1f926c
1f926c
* Wed Dec 18 2019 Benjamin Berg <bberg@redhat.com> - 1.9.1-1
1f926c
- New upstream release 1.9 (rhbz#1782249)
1f926c
- Drop Patch0, it has been merged upstream
1f926c
1f926c
* Fri Sep 20 2019 Christian Kellner <ckellner@redhat.com> - 1.9-1
1f926c
- New upstream release 1.9 (rhbz#1742290)
1f926c
- Update patch0 (taken from upstream, commit dcdaf52...)
1f926c
1f926c
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-3
1f926c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
1f926c
1f926c
* Fri May 17 2019 Benjamin Berg <bberg@redhat.com> - 1.8-2
1f926c
- Fix build on i686
1f926c
1f926c
* Fri May 17 2019 Benjamin Berg <bberg@redhat.com> - 1.8-1
1f926c
- New upstream release (#1582506)
1f926c
1f926c
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.1-4
1f926c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
1f926c
1f926c
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.1-3
1f926c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
1f926c
1f926c
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.1-2
1f926c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
1f926c
1f926c
* Thu Dec 28 2017 Björn Esser <besser82@fedoraproject.org> - 1.7.1-1
1f926c
- New upstream release (#1505144)
1f926c
1f926c
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-8
1f926c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
1f926c
1f926c
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-7
1f926c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
1f926c
1f926c
* Sat Jul 01 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-6
1f926c
- Add upstreamed patch to silence compiler warnings
1f926c
1f926c
* Sat Jul 01 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-5
1f926c
- Replace fix for rhbz#1464548 from upstream commit
1f926c
- Add upstream patch to fix README
1f926c
1f926c
* Fri Jun 30 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-4
1f926c
- Add upstream patch to fix ThermalMonitor (rhbz#1464548)
1f926c
- Add several fixes from upstream
1f926c
1f926c
* Tue Apr 11 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-3
1f926c
- Explicitly turn on hardening, if required
1f926c
1f926c
* Tue Apr 11 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-2
1f926c
- Fix missing trailing semicolon in desktop-file
1f926c
1f926c
* Tue Apr 11 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-1
1f926c
- Initial import (rhbz#1440406)
1f926c
1f926c
* Mon Apr 10 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-0.4
1f926c
- Use qmake_qt5-macro and build out of tree
1f926c
1f926c
* Sat Apr 08 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-0.3
1f926c
- Small packaging improvements
1f926c
1f926c
* Sat Apr 08 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-0.2
1f926c
- Add management-script
1f926c
1f926c
* Sat Apr 08 2017 Björn Esser <besser82@fedoraproject.org> - 1.6-0.1
1f926c
- Initial rpm-release (rhbz#1440406)