2011-05-01 20:11:39 +02:00
|
|
|
#
|
|
|
|
# spec file for package cpupower
|
|
|
|
#
|
2014-01-31 16:51:53 +01:00
|
|
|
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2011-05-01 20:11:39 +02:00
|
|
|
# Author: Thomas Renninger <trenn@suse.de>
|
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
2011-12-15 12:01:16 +01:00
|
|
|
|
2014-03-28 20:37:44 +01:00
|
|
|
|
2011-05-01 20:11:39 +02:00
|
|
|
Name: cpupower
|
|
|
|
Url: http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html
|
|
|
|
# Use this as version when things are in mainline kernel
|
|
|
|
%define version %(rpm -q --qf '%{VERSION}' kernel-source)
|
2014-01-31 16:51:53 +01:00
|
|
|
Version: 3.13
|
2011-12-15 11:38:18 +01:00
|
|
|
Release: 0
|
2014-08-12 15:50:31 +02:00
|
|
|
%define tsversion 3.17
|
2011-05-01 20:11:39 +02:00
|
|
|
Summary: Tools to determine and set CPU Power related Settings
|
2011-12-15 12:01:16 +01:00
|
|
|
License: GPL-2.0
|
2011-05-01 20:11:39 +02:00
|
|
|
Group: System/Base
|
|
|
|
Source: %{name}-%{version}.tar.bz2
|
2014-01-31 18:08:18 +01:00
|
|
|
Source1: turbostat-%{tsversion}.tar.bz2
|
|
|
|
Source2: cpupower_export_tarball_from_git.sh
|
2014-03-14 04:24:09 +01:00
|
|
|
Patch1: cpupower_disable_by_latency.patch
|
2014-03-28 20:06:25 +01:00
|
|
|
Patch2: add_idle_manpages_in_Makefile.patch
|
2014-03-31 17:27:58 +02:00
|
|
|
Patch3: cpupower-always_try_to_load_msr_driver_as_root.patch
|
2014-04-01 14:33:00 +02:00
|
|
|
Patch4: cpupower-return_zero_on_success.patch
|
|
|
|
Patch5: cpupower-remove_mc_scheduler_bits.patch
|
2014-03-28 20:06:25 +01:00
|
|
|
Patch20: turbostat_fix_man_perm.patch
|
2014-03-28 20:37:44 +01:00
|
|
|
Patch21: make_header_file_passable_from_outside.patch
|
2011-05-01 20:11:39 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2011-12-15 11:38:18 +01:00
|
|
|
BuildRequires: gettext-tools
|
|
|
|
BuildRequires: pciutils
|
|
|
|
BuildRequires: pciutils-devel
|
2011-12-15 12:01:16 +01:00
|
|
|
Obsoletes: cpufrequtils < %version
|
|
|
|
Provides: cpufrequtils = %version
|
2011-05-01 20:11:39 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
This tool is to make access to the Linux kernel's processor power subsystems
|
|
|
|
like CPU frequency switching (cpufreq) or CPU sleep states (cpuidle) for users
|
|
|
|
and userspace tools easier.
|
|
|
|
|
|
|
|
%package -n libcpupower0
|
|
|
|
Summary: Obsolete processor frequency related C-library
|
|
|
|
Group: System/Base
|
2011-12-15 11:38:18 +01:00
|
|
|
|
2011-05-01 20:11:39 +02:00
|
|
|
%description -n libcpupower0
|
|
|
|
Contains libcpupower and soon possibly other CPU power related
|
|
|
|
C libraries.
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
Summary: Include files and C-libraries
|
|
|
|
Group: Development/Languages/C and C++
|
2013-06-10 12:42:16 +02:00
|
|
|
Conflicts: cpufrequtils-devel
|
2011-05-01 20:11:39 +02:00
|
|
|
Requires: libcpupower0 = %{version}
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
Include files and C-libraries for C/C++ development
|
|
|
|
|
|
|
|
%package bench
|
|
|
|
Summary: CPU frequency micro benchmark
|
|
|
|
Group: System/Benchmark
|
2011-12-15 12:01:16 +01:00
|
|
|
Obsoletes: cpufrequtils-bench < %version
|
|
|
|
Provides: cpufrequtils-bench = %version
|
2011-05-01 20:11:39 +02:00
|
|
|
|
|
|
|
%description bench
|
|
|
|
Helps to test the condition of a given kernel cpufreq
|
|
|
|
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.
|
|
|
|
|
|
|
|
%prep
|
2014-01-31 18:08:18 +01:00
|
|
|
%setup -D -b 1
|
|
|
|
%patch1 -p1
|
2014-03-14 04:24:09 +01:00
|
|
|
%patch2 -p1
|
2014-03-31 17:27:58 +02:00
|
|
|
%patch3 -p1
|
2014-04-01 14:33:00 +02:00
|
|
|
%patch4 -p1
|
|
|
|
%patch5 -p4
|
2014-03-28 20:06:25 +01:00
|
|
|
cd ../turbostat-%{tsversion}
|
|
|
|
%patch20 -p1
|
2014-03-28 20:37:44 +01:00
|
|
|
%patch21 -p1
|
2011-05-01 20:11:39 +02:00
|
|
|
|
|
|
|
%build
|
|
|
|
# This package failed when testing with -Wl,-as-needed being default.
|
|
|
|
# So we disable it here, if you want to retest, just delete this comment and the line below.
|
|
|
|
export SUSE_ASNEEDED=0
|
|
|
|
CONF="PACKAGE_BUGREPORT=http://bugs.opensuse.org mandir=%_mandir libdir=%_libdir CPUFRQ_BENCH=true STRIP=true VERSION=%{version}"
|
2014-01-31 18:08:18 +01:00
|
|
|
export CFLAGS="$RPM_OPT_FLAGS -I ."
|
2011-09-18 20:46:15 +02:00
|
|
|
make $CONF %{?_smp_mflags}
|
2011-05-01 20:11:39 +02:00
|
|
|
|
2014-02-14 14:32:43 +01:00
|
|
|
%ifarch ix86 x86_64
|
2014-01-31 18:08:18 +01:00
|
|
|
cd ../turbostat-%{tsversion}
|
2014-03-28 20:37:44 +01:00
|
|
|
CFLAGS="%optflags -I. -DMSRHEADER=\"<asm/msr-index.h>\"" make %{?_smp_mflags}
|
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
|
|
|
|
export SUSE_ASNEEDED=0
|
|
|
|
CONF="PACKAGE_BUGREPORT=http://bugs.opensuse.org mandir=%_mandir libdir=%_libdir CPUFRQ_BENCH=true DESTDIR=$RPM_BUILD_ROOT sbindir=/usr/sbin docdir=%{_docdir}/%{name} confdir=/etc VERSION=%{version}"
|
|
|
|
make install DESTDIR=$RPM_BUILD_ROOT $CONF
|
|
|
|
# copy to examples doc dir to avoid complains from the build
|
|
|
|
# system about an executable in the doc dir.
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{_docdir}/%{name}/examples
|
|
|
|
mv $RPM_BUILD_ROOT/%{_docdir}/%{name}/cpufreq-bench_script.sh $RPM_BUILD_ROOT/%{_docdir}/%{name}/examples
|
|
|
|
%find_lang %{name}
|
|
|
|
|
2014-02-14 14:32:43 +01:00
|
|
|
%ifarch ix86 x86_64
|
2014-01-31 18:08:18 +01:00
|
|
|
cd ../turbostat-%{tsversion}
|
|
|
|
make install -e DESTDIR="$RPM_BUILD_ROOT"
|
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
|
|
|
%post -n libcpupower0 -p /sbin/ldconfig
|
|
|
|
|
|
|
|
%postun -n libcpupower0 -p /sbin/ldconfig
|
|
|
|
|
|
|
|
%files -f %{name}.lang
|
|
|
|
%defattr (-,root,root)
|
|
|
|
%{_mandir}/man1/cpupower*
|
|
|
|
/usr/bin/cpupower
|
2014-02-14 14:32:43 +01:00
|
|
|
%ifarch ix86 x86_64
|
|
|
|
%{_mandir}/man8/turbostat*
|
2014-01-31 18:08:18 +01:00
|
|
|
/usr/bin/turbostat
|
2014-02-14 14:32:43 +01:00
|
|
|
%endif
|
2011-05-01 20:11:39 +02:00
|
|
|
|
|
|
|
%files bench
|
|
|
|
%defattr (-,root,root)
|
|
|
|
%config /etc/cpufreq-bench.conf
|
|
|
|
/usr/sbin/cpufreq-bench
|
|
|
|
/usr/bin/cpufreq-bench_plot.sh
|
|
|
|
%dir %{_docdir}/%{name}
|
|
|
|
%dir %{_docdir}/%{name}/examples
|
|
|
|
%{_docdir}/%{name}/examples/cpufreq-bench_script.sh
|
|
|
|
%{_docdir}/%{name}/README-BENCH
|
|
|
|
|
|
|
|
%files -n libcpupower0
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_libdir}/libcpupower*.so.*
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
%defattr(-,root,root)
|
|
|
|
/usr/include/cpufreq.h
|
|
|
|
%{_libdir}/libcpu*.so
|
|
|
|
|
|
|
|
%changelog
|