# Conditional build:
%bcond_without verbose # verbose build (V=1)
%bcond_without perf # perf tools
+%bcond_without gtk # gtk perf version
-%define rel 4
-%define basever 3.9
-%define postver .5
+%define rel 1
+%define basever 3.10
+%define postver .19
Summary: Assortment of tools for the Linux kernel
Summary(pl.UTF-8): Zestaw narzędzi dla jądra Linuksa
Name: kernel-tools
License: GPL v2
Group: Applications/System
Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%{basever}.tar.xz
-# Source0-md5: 4348c9b6b2eb3144d601e87c19d5d909
+# Source0-md5: 4f25cd5bec5f8d5a7d935b3f2ccb8481
%if "%{postver}" != ".0"
Patch0: http://www.kernel.org/pub/linux/kernel/v3.x/patch-%{version}.xz
-# Patch0-md5: aa22187ae5cd482a69097e9e59244491
+# Patch0-md5: b7f932eecbbf5636ad69add480fa1573
%endif
Source1: cpupower.service
Source2: cpupower.config
URL: http://www.kernel.org/
+BuildRequires: gettext-tools
+BuildRequires: pciutils-devel
BuildRequires: rpmbuild(macros) >= 1.647
BuildRequires: tar >= 1:1.22
BuildRequires: xz
BuildRequires: audit-libs-devel
BuildRequires: binutils-devel
BuildRequires: bison
+BuildRequires: docbook-dtd45-xml
BuildRequires: docbook-style-xsl
BuildRequires: elfutils-devel
BuildRequires: flex
-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)
CFLAGS="%{rpmcflags} -Wall -I../../../../arch/x86/include/uapi/"
%endif
-# slabinfo
-%{__make} -C tools/vm \
+# page-types, slabinfo
+%{__make} -C tools/vm page-types slabinfo \
CC="%{__cc}" \
- CFLAGS="%{rpmcflags} -Wall -Wextra"
+ CFLAGS="%{rpmcflags} -Wall -Wextra -I../lib"
%if %{with perf}
# perf slang version
perfexecdir=%{_datadir}/perf-core \
template_dir=%{_datadir}/perf-core/templates
+%if %{with gtk}
# perf gtk version
%{__make} -C tools/perf all man \
O=$PWD/perf-gtk \
perfexecdir=%{_datadir}/perf-core \
template_dir=%{_datadir}/perf-core/templates
%endif
+%endif
# gen_init_cpio
%{__make} -C usr gen_init_cpio \
%endif
install -p tools/vm/slabinfo $RPM_BUILD_ROOT%{_bindir}
+install -p tools/vm/page-types $RPM_BUILD_ROOT%{_sbindir}
install -p dslm $RPM_BUILD_ROOT%{_sbindir}
%ifarch %{ix86} %{x8664}
DESTDIR=$RPM_BUILD_ROOT
%{__mv} $RPM_BUILD_ROOT%{_bindir}/perf{,_slang}
+%if %{with gtk}
# perf gtk
%{__make} -j1 install install-man \
-C tools/perf \
template_dir=%{_datadir}/perf-core/templates \
DESTDIR=$RPM_BUILD_ROOT
%{__mv} $RPM_BUILD_ROOT%{_bindir}/perf{,_gtk}
+%endif
%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
%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
%attr(755,root,root) %{_bindir}/gen_init_cpio
%attr(755,root,root) %{_bindir}/slabinfo
%attr(755,root,root) %{_sbindir}/dslm
+%attr(755,root,root) %{_sbindir}/page-types
%ifarch %{ix86} %{x8664}
%attr(755,root,root) %{_bindir}/centrino-decode
%attr(755,root,root) %{_bindir}/powernow-k8-decode
%attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
%{_datadir}/perf-core/scripts/python/*.py*
+%if %{with gtk}
%files perf-gtk
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/perf_gtk
+%endif
%files perf-slang
%defattr(644,root,root,755)