File perf.spec of Package perf
#
# spec file for package perf (Version MACRO)
#
# Copyright (c) 2010 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 libdwarf-devel libelf-devel openssl-devel xmlto zlib-devel
BuildRequires: kernel-source >= 2.6.32
Summary: Performance Monitoring Tools for Linux
Requires: kernel >= 2.6.31
%define version %(rpm -q --qf '%{VERSION}' kernel-source)
Version: %version
Release: 4
Group: Development/Tools/Debuggers
License: GPLv2
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 perfexecdir=%{_libexecdir}/%{name}
%install
cd tools/perf
make CFLAGS="$RPM_OPT_FLAGS" install install-doc prefix=/usr perfexecdir=%{_libexecdir}/%{name} 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
%{_libexecdir}/%{name}
%{_mandir}/man1/perf*
%changelog