2011-05-01 20:11:39 +02:00
|
|
|
#
|
|
|
|
# spec file for package cpupower
|
|
|
|
#
|
2021-07-19 15:43:20 +02:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
2019-04-08 16:47:04 +02:00
|
|
|
# Author: Thomas Renninger <trenn@suse.de>
|
2011-05-01 20:11:39 +02:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2018-12-06 09:34:34 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2011-05-01 20:11:39 +02:00
|
|
|
#
|
|
|
|
|
2022-02-23 21:09:02 +01:00
|
|
|
%define maindir tools/power/cpupower
|
|
|
|
%define tsdir tools/power/x86/turbostat
|
|
|
|
%define pbdir tools/power/x86/x86_energy_perf_policy
|
|
|
|
%define ssdir tools/power/x86/intel-speed-select
|
2018-12-06 10:34:25 +01:00
|
|
|
|
|
|
|
Name: cpupower
|
2019-04-08 16:47:04 +02:00
|
|
|
# Use this as version when things are in mainline kernel
|
2022-02-23 21:09:02 +01:00
|
|
|
%define version %(rpm -q --qf '%%{VERSION}' kernel-source)
|
|
|
|
Version: %{version}
|
2018-12-06 10:34:25 +01:00
|
|
|
Release: 0
|
2011-05-01 20:11:39 +02:00
|
|
|
Summary: Tools to determine and set CPU Power related Settings
|
2018-12-06 09:34:34 +01:00
|
|
|
License: GPL-2.0-only
|
2011-05-01 20:11:39 +02:00
|
|
|
Group: System/Base
|
2018-12-06 10:34:25 +01:00
|
|
|
URL: https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git
|
2017-10-20 17:15:22 +02:00
|
|
|
Patch1: cpupower_rapl.patch
|
|
|
|
Patch2: rapl_monitor.patch
|
2018-01-11 17:32:13 +01:00
|
|
|
Patch3: cpupower_exclude_kernel_Makefile.patch
|
2020-03-09 10:54:32 +01:00
|
|
|
Patch6: amd_do_not_show_amount_of_boost_states_if_zero.patch
|
2022-02-23 21:09:02 +01:00
|
|
|
BuildRequires: kernel-source
|
2011-12-15 11:38:18 +01:00
|
|
|
BuildRequires: gettext-tools
|
2020-05-19 12:14:25 +02:00
|
|
|
BuildRequires: libcap-devel
|
2011-12-15 11:38:18 +01:00
|
|
|
BuildRequires: pciutils
|
|
|
|
BuildRequires: pciutils-devel
|
2011-05-01 20:11:39 +02:00
|
|
|
|
|
|
|
%description
|
2018-12-06 14:33:06 +01:00
|
|
|
This tool accesses the Linux kernel's processor power subsystems
|
|
|
|
like CPU frequency switching (cpufreq) or CPU sleep states (cpuidle).
|
2011-05-01 20:11:39 +02:00
|
|
|
|
|
|
|
%package -n libcpupower0
|
2019-06-05 15:42:34 +02:00
|
|
|
Summary: Processor power related C-library
|
2017-10-06 17:52:17 +02:00
|
|
|
Group: System/Libraries
|
2011-12-15 11:38:18 +01:00
|
|
|
|
2011-05-01 20:11:39 +02:00
|
|
|
%description -n libcpupower0
|
2019-06-05 15:42:34 +02:00
|
|
|
Contains libcpupower which offers easy functions to access
|
|
|
|
processor frequency, processor idle, processor power hierarchy
|
|
|
|
and other CPU power consumption related information.
|
2011-05-01 20:11:39 +02:00
|
|
|
|
|
|
|
%package devel
|
2018-12-06 14:33:06 +01:00
|
|
|
Summary: Include files for libcpupower
|
2011-05-01 20:11:39 +02:00
|
|
|
Group: Development/Languages/C and C++
|
2018-12-06 10:34:25 +01:00
|
|
|
Requires: libcpupower0 = %{version}
|
2011-05-01 20:11:39 +02:00
|
|
|
|
|
|
|
%description devel
|
2018-12-06 14:33:06 +01:00
|
|
|
Include files for C/C++ development with libcpupower.
|
2011-05-01 20:11:39 +02:00
|
|
|
|
|
|
|
%package bench
|
|
|
|
Summary: CPU frequency micro benchmark
|
|
|
|
Group: System/Benchmark
|
|
|
|
|
|
|
|
%description bench
|
2018-12-06 14:33:06 +01:00
|
|
|
This benchmark helps to test the condition of a given kernel cpufreq
|
2011-05-01 20:11:39 +02:00
|
|
|
governor (e.g. ondemand, userspace, conservative) and the cpufreq HW driver
|
|
|
|
(e.g. powernow-k8, acpi-cpufreq, ...).
|
|
|
|
For that purpose, it compares the performance governor to a configured
|
|
|
|
powersave module.
|
|
|
|
|
2022-02-23 21:09:02 +01:00
|
|
|
%lang_package
|
|
|
|
|
2011-05-01 20:11:39 +02:00
|
|
|
%prep
|
2022-02-23 21:09:02 +01:00
|
|
|
# copy necessary files from kernel-source since we need to modify them
|
|
|
|
(cd %{_prefix}/src/linux ; tar -cf - COPYING CREDITS README tools include scripts Kbuild Makefile arch/*/{include,lib,Makefile} lib) | tar -xf -
|
|
|
|
chmod +x tools/power/cpupower/utils/version-gen.sh
|
|
|
|
cd %maindir
|
2017-10-20 17:15:22 +02:00
|
|
|
%patch1 -p1
|
|
|
|
%patch2 -p1
|
2018-01-11 17:32:13 +01:00
|
|
|
%patch3 -p1
|
2020-03-09 10:54:32 +01:00
|
|
|
%patch6 -p1
|
2018-01-11 17:32:13 +01:00
|
|
|
|
2011-05-01 20:11:39 +02:00
|
|
|
%build
|
2022-02-23 21:09:02 +01:00
|
|
|
CONF="PACKAGE_BUGREPORT=https://bugs.opensuse.org mandir=%{_mandir} libdir=%{_libdir} CPUFRQ_BENCH=true"
|
|
|
|
export CFLAGS="%{optflags} -fcommon"
|
|
|
|
%make_build -C %{maindir} $CONF
|
|
|
|
|
|
|
|
%ifarch %{ix86} x86_64
|
|
|
|
%make_build -C %{tsdir}
|
|
|
|
%make_build -C %{pbdir}
|
|
|
|
%make_build -C %{ssdir}
|
2014-02-14 14:32:43 +01:00
|
|
|
%endif
|
2014-01-31 18:08:18 +01:00
|
|
|
|
2011-05-01 20:11:39 +02:00
|
|
|
%install
|
2022-02-23 21:09:02 +01:00
|
|
|
CONF="PACKAGE_BUGREPORT=https://bugs.opensuse.org mandir=%{_mandir} libdir=%{_libdir} CPUFRQ_BENCH=true DESTDIR=%{buildroot} sbindir=%{_sbindir} docdir=%{_docdir}/%{name} confdir=%{_sysconfdir}"
|
|
|
|
%make_install -C %{maindir} $CONF
|
|
|
|
|
|
|
|
%ifarch %{ix86} x86_64
|
|
|
|
%make_install -C %{tsdir}
|
|
|
|
%make_install -C %{pbdir}
|
|
|
|
%make_install -C %{ssdir}
|
|
|
|
%endif
|
2018-12-06 10:34:25 +01:00
|
|
|
|
2011-05-01 20:11:39 +02:00
|
|
|
# copy to examples doc dir to avoid complains from the build
|
|
|
|
# system about an executable in the doc dir.
|
2018-12-06 10:34:25 +01:00
|
|
|
mkdir -p %{buildroot}/%{_docdir}/%{name}/examples
|
|
|
|
mv %{buildroot}//%{_docdir}/%{name}/cpufreq-bench_script.sh %{buildroot}/%{_docdir}/%{name}/examples
|
|
|
|
|
|
|
|
%find_lang %{name}
|
2011-05-01 20:11:39 +02:00
|
|
|
|
|
|
|
%post -n libcpupower0 -p /sbin/ldconfig
|
|
|
|
%postun -n libcpupower0 -p /sbin/ldconfig
|
|
|
|
|
2022-02-23 21:09:02 +01:00
|
|
|
%files
|
2018-12-06 10:34:25 +01:00
|
|
|
%{_datadir}/bash-completion/completions/cpupower
|
2022-02-23 21:09:02 +01:00
|
|
|
%{_mandir}/man1/cpupower*%{?ext_man}
|
2018-12-06 10:34:25 +01:00
|
|
|
%{_bindir}/cpupower
|
2022-02-23 21:09:02 +01:00
|
|
|
%ifarch %{ix86} x86_64
|
|
|
|
%{_mandir}/man8/turbostat*%{?ext_man}
|
2018-12-06 10:34:25 +01:00
|
|
|
%{_bindir}/turbostat
|
2022-02-23 21:09:02 +01:00
|
|
|
%{_mandir}/man8/x86_energy_perf_policy*%{?ext_man}
|
2018-12-06 10:34:25 +01:00
|
|
|
%{_bindir}/x86_energy_perf_policy
|
2019-07-17 18:19:48 +02:00
|
|
|
%{_bindir}/intel-speed-select
|
2014-02-14 14:32:43 +01:00
|
|
|
%endif
|
2011-05-01 20:11:39 +02:00
|
|
|
|
|
|
|
%files bench
|
2018-12-06 10:34:25 +01:00
|
|
|
%config %{_sysconfdir}/cpufreq-bench.conf
|
|
|
|
%{_sbindir}/cpufreq-bench
|
|
|
|
%{_bindir}/cpufreq-bench_plot.sh
|
|
|
|
%dir %{_docdir}/%{name}
|
|
|
|
%dir %{_docdir}/%{name}/examples
|
|
|
|
%{_docdir}/%{name}/examples/cpufreq-bench_script.sh
|
|
|
|
%{_docdir}/%{name}/README-BENCH
|
2011-05-01 20:11:39 +02:00
|
|
|
|
|
|
|
%files -n libcpupower0
|
2018-12-06 10:34:25 +01:00
|
|
|
%{_libdir}/libcpupower*.so.*
|
2011-05-01 20:11:39 +02:00
|
|
|
|
|
|
|
%files devel
|
2018-12-06 10:34:25 +01:00
|
|
|
%{_includedir}/cpufreq.h
|
|
|
|
%{_includedir}/cpuidle.h
|
|
|
|
%{_includedir}/powercap.h
|
|
|
|
%{_libdir}/libcpu*.so
|
2011-05-01 20:11:39 +02:00
|
|
|
|
2022-02-23 21:09:02 +01:00
|
|
|
%files lang -f %{name}.lang
|
|
|
|
|
2011-05-01 20:11:39 +02:00
|
|
|
%changelog
|