File cpufrequtils.spec of Package cpufrequtils

#
# spec file for package cpufrequtils
#
# Copyright (c) 2011 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:           cpufrequtils
%define         turbostat_version 20101221
BuildRequires:  doxygen lynx
Url:            http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html
Version:        008
Release:        8
Summary:        Tools to Determine and Set CPUfreq Settings
License:        GPLv2+
Group:          System/Base
Source:         %{name}-%{version}.tar.bz2
Source2:        baselibs.conf
Source3:        turbostat-%{turbostat_version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# bug437293
%ifarch ppc64
Obsoletes:      cpufrequtils-64bit
%endif
#

%description
To make access to the Linux kernel cpufreq subsystem easier for users
and cpufreq userspace tools, the cpufrequtils package was created. It
contains a library used by other programs (libcpufreq), command line
tools to determine current CPUfreq settings and to modify them
(cpufreq-info and cpufreq-set), and debug tools.

%package bench
License:        GPLv2+
Summary:        CPU frequency micro benchmark
Group:          System/Benchmark

%description bench
cpufrequtils-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.

%package devel
License:        GPLv2+
Summary:        Development files for cpufrequtils
Group:          Development/Libraries/C and C++
Requires:       %{name} >= %{version}

%description devel
Files required for cpufreq userspace tools development

%prep
%setup -q -a 3

%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"
export CFLAGS="$RPM_OPT_FLAGS"
make $CONF %{?_smp_mflags}
cd turbostat
export CFLAGS="$CFLAGS -D_GNU_SOURCE"
make %{?_smp_mflags}
cd ..

%install
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"
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}

mkdir -p $RPM_BUILD_ROOT/%{_sbindir}
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man8
install -D -m 0755 turbostat/turbostat $RPM_BUILD_ROOT/%{_sbindir}
install -D -m 0644 turbostat/turbostat.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files -f %{name}.lang
%defattr (-,root,root)
%{_libdir}/libcpufreq.*.0
%{_mandir}/man1/cpufreq*
%{_mandir}/man8/turbostat*
%{_sbindir}/turbostat
/usr/bin/cpufreq-info
/usr/bin/cpufreq-set
/usr/bin/cpufreq-aperf

%files bench -f %{name}.lang
%defattr (-,root,root)
%config /etc/cpufreq-bench.conf
/usr/sbin/cpufreq-bench
/usr/bin/cpufreq-bench_plot.sh
# Can't use %%doc because I want to avoid cpufrequtils-bench doc dir
# and use the cpufrequtils doc dir instead
%dir %{_docdir}/%{name}
%dir %{_docdir}/%{name}/examples
%{_docdir}/%{name}/examples/cpufreq-bench_script.sh
%{_docdir}/%{name}/README-BENCH

%files devel
%defattr (-,root,root)
/usr/include/cpufreq.h
%{_libdir}/libcpufreq.so

%changelog
openSUSE Build Service is sponsored by