%bcond_without perf # perf tools
%bcond_without gtk # gtk perf version
-%define rel 1
-%define basever 3.10
-%define postver .18
+%define basever 3.16
+%define postver .1
Summary: Assortment of tools for the Linux kernel
Summary(pl.UTF-8): Zestaw narzędzi dla jądra Linuksa
Name: kernel-tools
Version: %{basever}%{postver}
-Release: %{rel}
+Release: 1
License: GPL v2
Group: Applications/System
-Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%{basever}.tar.xz
-# Source0-md5: 4f25cd5bec5f8d5a7d935b3f2ccb8481
+Source0: https://www.kernel.org/pub/linux/kernel/v3.x/linux-%{basever}.tar.xz
+# Source0-md5: 5c569ed649a0c9711879f333e90c5386
%if "%{postver}" != ".0"
-Patch0: http://www.kernel.org/pub/linux/kernel/v3.x/patch-%{version}.xz
-# Patch0-md5: e39b75595bf61d758087e1ddecd01a12
+Patch0: https://www.kernel.org/pub/linux/kernel/v3.x/patch-%{version}.xz
+# Patch0-md5: 9da4b0f5e343455b8141bcfa47e88cf5
%endif
Source1: cpupower.service
Source2: cpupower.config
+Source3: perf.sh
URL: http://www.kernel.org/
-BuildRequires: rpmbuild(macros) >= 1.647
+BuildRequires: gettext-tools
BuildRequires: pciutils-devel
+BuildRequires: rpmbuild(macros) >= 1.647
BuildRequires: tar >= 1:1.22
BuildRequires: xz
%if %{with perf}
BuildRequires: audit-libs-devel
BuildRequires: binutils-devel
BuildRequires: bison
+BuildRequires: docbook-dtd45-xml
BuildRequires: docbook-style-xsl
BuildRequires: elfutils-devel
BuildRequires: flex
-%{?with_gtk:BuildRequires: gtk+2-devel >= 2.0}
BuildRequires: libunwind-devel >= 0.99
-BuildRequires: newt-devel
BuildRequires: perl-devel >= 5.1
-BuildRequires: pkgconfig
BuildRequires: python-devel
BuildRequires: rpm-pythonprov
BuildRequires: slang-devel
BuildRequires: xmlto
+%if %{with gtk}
+BuildRequires: gtk+2-devel >= 2.0
+BuildRequires: pkgconfig
+%endif
%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+# otherwise /usr/lib/rpm/bin/debugedit: canonicalization unexpectedly shrank by one character
+%define _enable_debug_packages 0
+
%define makeopts CC="%{__cc}" %{?with_verbose:V=1}
%description
Summary: perf profiler tool (core package)
Summary(pl.UTF-8): Narzędzie profilujące perf (podstawowe narzędzia)
Group: Applications/System
+Suggests: binutils
%description perf-core
Perf is a profiler tool for Linux 2.6+ based systems that abstracts
Group: Applications/Shells
Requires: %{name}-perf
Requires: bash-completion
+%if "%{_rpmversion}" >= "5"
+BuildArch: noarch
+%endif
%description -n bash-completion-perf
Bash completion for perf command.
%patch0 -p1
%endif
+sed -i -e 's#libexec/perf-core#%{_datadir}/perf-core#g' tools/perf/config/Makefile
+
%build
cd linux-%{basever}
%{__make} -C tools/power/x86/x86_energy_perf_policy \
CC="%{__cc}" \
CFLAGS="%{rpmcflags}"
+CFLAGS="%{rpmcflags}" \
%{__make} -C tools/power/x86/turbostat \
- CC="%{__cc}" \
- CFLAGS="%{rpmcflags} -Wall -I../../../../arch/x86/include/uapi/"
+ CC="%{__cc}"
%endif
# page-types, slabinfo
%py_comp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
%py_ocomp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
+
+%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/perf-core/tests
+
+install -p %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/perf
%endif
# gen_init_cpio
install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
-rm -r $RPM_BUILD_ROOT%{_datadir}/perf-core/tests
-
%clean
rm -rf $RPM_BUILD_ROOT
%if %{with perf}
%files perf-core
%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/perf
%{_mandir}/man1/perf*.1*
%dir %{_datadir}/perf-core
%attr(755,root,root) %{_datadir}/perf-core/perf-archive
%attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
%{_datadir}/perf-core/scripts/python/*.py*
+%dir %{_libdir}/traceevent
+%dir %{_libdir}/traceevent/plugins
+%attr(755,root,root) %{_libdir}/traceevent/plugins/plugin_*.so
+
%if %{with gtk}
%files perf-gtk
%defattr(644,root,root,755)