SHA256
1
0
forked from pool/cpupower

- Run spec-cleaner

- Don't disable as-needed, it works now.

OBS-URL: https://build.opensuse.org/package/show/hardware/cpupower?expand=0&rev=86
This commit is contained in:
Ismail Dönmez 2018-12-06 09:34:25 +00:00 committed by Git OBS Bridge
parent a694a76be1
commit 7ac7e310d0
2 changed files with 52 additions and 56 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Dec 6 09:33:55 UTC 2018 - Ismail Dönmez <idonmez@suse.com>
- Run spec-cleaner
- Don't disable as-needed, it works now.
-------------------------------------------------------------------
Tue Dec 4 12:14:23 UTC 2018 - trenn@suse.de

View File

@ -2,7 +2,6 @@
# spec file for package cpupower
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# 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
@ -17,38 +16,36 @@
#
Name: cpupower
# Use this as version when things are in mainline kernel
%define version %(rpm -q --qf '%VERSION' kernel-source)
Version: 4.19
Release: 0
%define version %(rpm -q --qf '%{VERSION}' kernel-source)
%define tsversion 18.07.27
%define pbversion 17.05.11
Name: cpupower
Version: 4.19
Release: 0
Summary: Tools to determine and set CPU Power related Settings
License: GPL-2.0-only
Group: System/Base
Url: https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git
Source: %name-%version.tar.bz2
Source1: turbostat-%tsversion.tar.bz2
URL: https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git
Source: %{name}-%{version}.tar.bz2
Source1: turbostat-%{tsversion}.tar.bz2
Source2: cpupower_export_tarball_from_git.sh
Source3: x86_energy_perf_policy-%{pbversion}.tar.bz2
Patch1: cpupower_rapl.patch
Patch2: rapl_monitor.patch
Patch3: cpupower_exclude_kernel_Makefile.patch
Patch4: cpupower_fix_compilation_and_sysfs_read_file_mess.patch
Patch5: cpupower_bash-completion_for_cpupower_tool.patch
Patch22: turbostat_makefile_fix_asm_header.patch
# Fixes bsc#1048546:
Patch30: x86_perf_makefile_fix_asm_header.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: gettext-tools
BuildRequires: pciutils
BuildRequires: pciutils-devel
Obsoletes: cpufrequtils
Provides: cpufrequtils = %version
Provides: cpufrequtils = %{version}
%description
This tool is to make access to the Linux kernel's processor power subsystems
@ -66,8 +63,8 @@ C libraries.
%package devel
Summary: Include files and C-libraries
Group: Development/Languages/C and C++
Requires: libcpupower0 = %{version}
Conflicts: cpufrequtils-devel
Requires: libcpupower0 = %version
%description devel
Include files and C-libraries for C/C++ development
@ -75,8 +72,8 @@ Include files and C-libraries for C/C++ development
%package bench
Summary: CPU frequency micro benchmark
Group: System/Benchmark
Obsoletes: cpufrequtils-bench < %version
Provides: cpufrequtils-bench = %version
Obsoletes: cpufrequtils-bench < %{version}
Provides: cpufrequtils-bench = %{version}
%description bench
Helps to test the condition of a given kernel cpufreq
@ -86,87 +83,80 @@ For that purpose, it compares the performance governor to a configured
powersave module.
%prep
%setup -D -b 1 -b 3
%setup -q -D -b 1 -b 3
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
cd ../turbostat-%tsversion
cd ../turbostat-%{tsversion}
%patch22 -p1
cd ../x86_energy_perf_policy-%{pbversion}
%patch30 -p1
%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 VERSION=%version"
export CFLAGS="%optflags -I ."
CONF="PACKAGE_BUGREPORT=https://bugs.opensuse.org mandir=%{_mandir} libdir=%{_libdir} CPUFRQ_BENCH=true VERSION=%{version}"
export CFLAGS="%{optflags} -I ."
make $CONF %{?_smp_mflags}
%ifarch ix86 x86_64
cd ../turbostat-%tsversion
export CFLAGS="%optflags -I ."
cd ../turbostat-%{tsversion}
export CFLAGS="%{optflags} -I ."
make %{?_smp_mflags}
cd ../x86_energy_perf_policy-%{pbversion}
make %{?_smp_mflags}
%endif
%install
export SUSE_ASNEEDED=0
CONF="PACKAGE_BUGREPORT=http://bugs.opensuse.org mandir=%_mandir libdir=%_libdir CPUFRQ_BENCH=true DESTDIR=%buildroot sbindir=%_sbindir docdir=%_docdir/%name confdir=%_sysconfdir VERSION=%version"
CONF="PACKAGE_BUGREPORT=https://bugs.opensuse.org mandir=%{_mandir} libdir=%{_libdir} CPUFRQ_BENCH=true DESTDIR=%{buildroot} sbindir=%{_sbindir} docdir=%{_docdir}/%{name} confdir=%{_sysconfdir} VERSION=%{version}"
%make_install $CONF
# copy to examples doc dir to avoid complains from the build
# system about an executable in the doc dir.
mkdir -p %buildroot/%_docdir/%name/examples
mv %buildroot//%_docdir/%name/cpufreq-bench_script.sh %buildroot/%_docdir/%name/examples
%find_lang %name
mkdir -p %{buildroot}/%{_docdir}/%{name}/examples
mv %{buildroot}//%{_docdir}/%{name}/cpufreq-bench_script.sh %{buildroot}/%{_docdir}/%{name}/examples
%find_lang %{name}
%ifarch ix86 x86_64
cd ../turbostat-%tsversion
cd ../turbostat-%{tsversion}
%make_install -e
cd ../x86_energy_perf_policy-%{pbversion}
%make_install
%endif
%post -n libcpupower0 -p /sbin/ldconfig
%postun -n libcpupower0 -p /sbin/ldconfig
%files -f %name.lang
%defattr (-,root,root)
/usr/share/bash-completion/completions/cpupower
%_mandir/man1/cpupower*
%_bindir/cpupower
%files -f %{name}.lang
%{_datadir}/bash-completion/completions/cpupower
%{_mandir}/man1/cpupower*
%{_bindir}/cpupower
%ifarch ix86 x86_64
%_mandir/man8/turbostat*
%_bindir/turbostat
%_mandir/man8/x86_energy_perf_policy*
%_bindir/x86_energy_perf_policy
%{_mandir}/man8/turbostat*
%{_bindir}/turbostat
%{_mandir}/man8/x86_energy_perf_policy*
%{_bindir}/x86_energy_perf_policy
%endif
%files bench
%defattr (-,root,root)
%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
%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
%files -n libcpupower0
%defattr(-,root,root)
%_libdir/libcpupower*.so.*
%{_libdir}/libcpupower*.so.*
%files devel
%defattr(-,root,root)
%_includedir/cpufreq.h
%_includedir/cpuidle.h
/usr/include/powercap.h
%_libdir/libcpu*.so
%{_includedir}/cpufreq.h
%{_includedir}/cpuidle.h
%{_includedir}/powercap.h
%{_libdir}/libcpu*.so
%changelog