tuned/tuned.spec
Thomas Renninger 745f1b62b5 Accepting request 228419 from home:trenn:branches:Base:System
- Use cpupower {info,set} -b to set Intel perf bias value instead of
  x86_energy_perf_policy we do not ship.
  Add use_cpupower_for_intel_perf_bias
- Add rctuned service link in /usr/sbin
- Mark pm-profiler obsoleted by this package

OBS-URL: https://build.opensuse.org/request/show/228419
OBS-URL: https://build.opensuse.org/package/show/Base:System/tuned?expand=0&rev=19
2014-04-01 10:55:46 +00:00

156 lines
5.3 KiB
RPMSpec

#
# spec file for package tuned
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: tuned
Version: 2.3.0
Release: 0
Summary: A dynamic adaptive system tuning daemon
License: GPL-2.0+
Group: System/Base
Url: https://fedorahosted.org/tuned/
Source: https://fedorahosted.org/releases/t/u/tuned/tuned-%{version}.tar.bz2
# PATCH-FIX-OPENSUSE fix-allow-receive_sender-default.patch <allow receive_sender="com.redhat.com"/> allow receive_* is normally
# not needed as that is the default --<p.drouand@gmail.com>
Patch0: fix-allow-receive_sender-default.patch
# PATCH-FIX-OPENSUSE fix-new-systemd-tmpfiles.d-path.patch Fix tmpfiles.d systemd path from /etc/tmpdfiles.d to /usr/lib/tmpfiles.d to be
# compatible with new systemd --<p.drouand@gmail.com>
Patch1: fix-new-systemd-tmpfiles.d-path.patch
Patch2: use_cpupower_for_intel_perf_bias
BuildRequires: python
BuildRequires: systemd
Requires: /usr/bin/cpupower
Requires: dbus-1-python
Requires: ethtool
Requires: gawk
Requires: python-configobj
Requires: python-decorator
Requires: python-pyudev
Requires: python-gobject
%{?systemd_requires}
BuildArch: noarch
Obsoletes: pm-profiler
%description
The tuned package contains a daemon that tunes system settings dynamically.
It does so by monitoring the usage of several system components periodically.
Based on that information components will then be put into lower or higher
power saving modes to adapt to the current usage. Currently only ethernet
network and ATA harddisk devices are implemented.
%package utils
Summary: Disk and net statistic monitoring systemtap scripts
Group: System/Base
Requires: %{name} = %{version}
Requires: powertop
%description utils
This package contains utilities that can help you to fine tune your
system and manage tuned profiles.
%package utils-systemtap
Summary: Disk and net statistic monitoring systemtap scripts
Group: System/Base
Requires: %{name} = %{version}
Requires: systemtap
%description utils-systemtap
This package contains several systemtap scripts to allow detailed
manual monitoring of the system. Instead of the typical IO/sec it collects
minimal, maximal and average time between operations to be able to
identify applications that behave power inefficient (many small operations
instead of fewer large ones).
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build
#The tuned daemon is written in pure Python. Nothing requires to be built.
# Just a hack to avoid installation in a wrong directory
sed -i 's|usr/libexec/tuned|%{_libexecdir}/%{name}|' Makefile
%install
make install DESTDIR=%{buildroot}
%py_compile %{buildroot}
rm -rf %{buildroot}/%{_datadir}/doc
# Remove unwanted stuffs instead of exclude them in files list
rm -rf %{buildroot}%{_libexecdir}/%{name}/{default,desktop-powersave,laptop-ac-powersave,server-powersave,laptop-battery-powersave,enterprise-storage,spindown-disk}
ln -sf service $RPM_BUILD_ROOT/usr/sbin/rctuned
%post
%service_add_post %{name}.service
# try to autodetect the best profile for the system in case there is none preset
if [ ! -f /etc/tuned/active_profile -o -z "`cat /etc/tuned/active_profile 2>/dev/null`" ]
then
PROFILE=`/usr/sbin/tuned-adm recommend 2>/dev/null`
[ "$PROFILE" ] || PROFILE=balanced
/usr/sbin/tuned-adm profile "$PROFILE" 2>/dev/null || echo -n "$PROFILE" > /etc/tuned/active_profile
fi
# convert active_profile from full path to name (if needed)
sed -i 's|.*/\([^/]\+\)/[^\.]\+\.conf|\1|' /etc/tuned/active_profile
%preun
%service_del_preun %{name}.service
%postun
%service_del_postun %{name}.service
%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING README
%config %{_sysconfdir}/bash_completion.d
%{python_sitelib}/tuned
%{_sbindir}/tuned
%{_sbindir}/tuned-adm
%{_sbindir}/rctuned
%{_libexecdir}/tuned
# active_profile might be empty when built via build service, but typically
# not on a real install -> better do not mark it %ghost
%config(noreplace) %{_sysconfdir}/tuned/active_profile
%config(noreplace) %{_sysconfdir}/tuned/tuned-main.conf
%{_libexecdir}/tmpfiles.d
%config %{_sysconfdir}/dbus-1/system.d/com.redhat.tuned.conf
%{_unitdir}/tuned.service
%dir %{_localstatedir}/log/tuned
%dir /etc/tuned
%{_mandir}/man5/tuned*
%{_mandir}/man8/tuned*
%files utils
%defattr(-,root,root,-)
%doc COPYING
%{_bindir}/powertop2tuned
%files utils-systemtap
%defattr(-,root,root,-)
%doc doc/README.utils doc/README.scomes COPYING
%{_sbindir}/varnetload
%{_sbindir}/netdevstat
%{_sbindir}/diskdevstat
%{_sbindir}/scomes
%{_mandir}/man8/varnetload.*
%{_mandir}/man8/netdevstat.*
%{_mandir}/man8/diskdevstat.*
%{_mandir}/man8/scomes.*
%changelog