File perf.spec of Package perf
#
# spec file for package perf (Version MACRO)
#
# Copyright (c) 2009 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: perf
BuildRequires: asciidoc binutils-devel kernel-source libelf-devel openssl-devel xmlto zlib-devel
Summary: Performance Monitoring Tools for Linux
Requires: kernel >= 2.6.31
%define version %(rpm -q --qf '%{VERSION}' kernel-source)
Version: %version
Release: 2
Group: Development/Tools/Debuggers
License: GPL v2 only
AutoReqProv: on
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
This package provides a userspace tool 'perf', which monitors performance for
either unmodified binaries or the entire system. It requires a Linux kernel
which includes the Performance Counters for Linux (PCL) subsystem (>= 2.6.31).
This subsystem utilizes the Performance Monitoring Unit (PMU) / hardware
counters of the underlying cpu architecture (if supported).
Authors:
--------
Ingo Molnar <mingo@elte.hu> et al.
%prep
# copy necessary files from kernel-source since we need to modify them
(cd /usr/src/linux ; tar -cf - COPYING CREDITS README tools include scripts Kbuild Makefile arch/*/include lib) | tar -xf -
chmod +x tools/perf/util/generate-cmdlist.sh
%build
cd tools/perf
export SUSE_ASNEEDED=0
make V=1 CFLAGS="$RPM_OPT_FLAGS" ASCIIDOC8=1 all doc prefix=/usr
%install
cd tools/perf
make CFLAGS="$RPM_OPT_FLAGS" install install-doc prefix=/usr DESTDIR=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-, root, root)
%doc COPYING CREDITS README tools/perf/design.txt
/usr/bin/perf
%{_mandir}/man1/perf-annotate.1.gz
%{_mandir}/man1/perf-help.1.gz
%{_mandir}/man1/perf-list.1.gz
%{_mandir}/man1/perf-record.1.gz
%{_mandir}/man1/perf-report.1.gz
%{_mandir}/man1/perf-stat.1.gz
%{_mandir}/man1/perf-top.1.gz
%{_mandir}/man1/perf.1.gz
%changelog