2007-01-12 01:32:05 +01:00
|
|
|
#
|
2011-05-04 14:37:30 +02:00
|
|
|
# spec file for package oprofile
|
2007-01-12 01:32:05 +01:00
|
|
|
#
|
2011-05-04 14:37:30 +02:00
|
|
|
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2007-01-12 01:32:05 +01:00
|
|
|
#
|
2008-10-23 12:27:14 +02:00
|
|
|
# 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.
|
|
|
|
|
2007-01-12 01:32:05 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2008-07-11 21:26:54 +02:00
|
|
|
|
2007-01-12 01:32:05 +01:00
|
|
|
|
|
|
|
Name: oprofile
|
2011-11-26 08:25:58 +01:00
|
|
|
BuildRequires: binutils-devel fdupes java2-devel-packages libtool libxslt popt-devel qt-devel update-desktop-files
|
2007-10-12 01:06:51 +02:00
|
|
|
Url: http://oprofile.sourceforge.net/
|
2011-12-06 18:35:02 +01:00
|
|
|
License: GPL-2.0+ ; LGPL-2.1+
|
2007-01-12 01:32:05 +01:00
|
|
|
Group: Development/Tools/Other
|
2008-07-19 00:32:25 +02:00
|
|
|
PreReq: /usr/sbin/groupadd /usr/sbin/useradd
|
2011-09-25 01:02:34 +02:00
|
|
|
Version: 0.9.7
|
|
|
|
Release: 1
|
2007-01-12 01:32:05 +01:00
|
|
|
Summary: System-Wide Profiler for Linux Systems
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2009-08-05 00:58:38 +02:00
|
|
|
Source: %{name}-%{version}.tar.bz2
|
2007-01-12 01:32:05 +01:00
|
|
|
Source1: %{name}.desktop
|
2009-07-30 22:54:32 +02:00
|
|
|
Source2: %{name}.rpmlintrc
|
2010-02-09 22:42:00 +01:00
|
|
|
Source3: baselibs.conf
|
2010-06-28 12:03:30 +02:00
|
|
|
Source4: jvmpi.h
|
2011-05-02 20:31:50 +02:00
|
|
|
Source5: README-BEFORE-ADDING-PATCHES
|
2009-07-30 22:54:32 +02:00
|
|
|
Patch1: oprofile-0.9.5-buildfixes.diff
|
|
|
|
Patch2: oprofile-0.9.4-fixes.diff
|
2012-01-03 16:21:55 +01:00
|
|
|
Patch3: oprofile-0.9.7-watchdog.diff
|
2007-01-12 01:32:05 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
OProfile is a system-wide profiler for Linux systems, capable of
|
|
|
|
profiling all running code at low overhead. OProfile is released under
|
|
|
|
the GNU GPL.
|
|
|
|
|
|
|
|
It consists of a kernel module and a daemon for collecting sample data,
|
|
|
|
and several post-profiling tools for turning data into information.
|
|
|
|
|
|
|
|
OProfile leverages the CPU hardware performance counters to enable
|
|
|
|
profiling of a wide variety of interesting statistics, which can also
|
|
|
|
be used for basic time-spent profiling. All code is profiled: hardware
|
|
|
|
and software interrupt handlers, kernel modules, the kernel, shared
|
|
|
|
libraries, and applications (the only exception being the oprofile
|
|
|
|
interrupt handler itself).
|
|
|
|
|
|
|
|
OProfile is currently in alpha status; however it has proven stable
|
|
|
|
over a large number of differing configurations. As always, there is no
|
|
|
|
warranty.
|
|
|
|
|
|
|
|
This is the package containing the userspace tools.
|
|
|
|
|
2008-07-19 00:32:25 +02:00
|
|
|
%package devel
|
|
|
|
Summary: System-Wide Profiler for Linux Systems
|
|
|
|
Group: Development/Libraries/C and C++
|
2011-12-06 18:35:02 +01:00
|
|
|
License: GPL-2.0+ ; LGPL-2.1+
|
2008-07-19 00:32:25 +02:00
|
|
|
AutoReqProv: on
|
2009-07-30 22:54:32 +02:00
|
|
|
Requires: libopagent1 = %{version}-%{release} binutils-devel
|
2008-07-19 00:32:25 +02:00
|
|
|
|
|
|
|
%description devel
|
|
|
|
OProfile is a system-wide profiler for Linux systems, capable of
|
|
|
|
profiling all running code at low overhead. OProfile is released under
|
|
|
|
the GNU GPL.
|
|
|
|
|
2008-10-23 12:27:14 +02:00
|
|
|
This package contains the files needed to develop JIT agents for other
|
|
|
|
virtual machines.
|
2008-07-19 00:32:25 +02:00
|
|
|
|
2009-07-30 22:54:32 +02:00
|
|
|
%package -n libopagent1
|
|
|
|
Summary: System-Wide Profiler for Linux Systems
|
|
|
|
Group: Development/Libraries/C and C++
|
2011-12-06 18:35:02 +01:00
|
|
|
License: GPL-2.0+ ; LGPL-2.1+
|
2009-07-30 22:54:32 +02:00
|
|
|
AutoReqProv: on
|
|
|
|
|
|
|
|
%description -n libopagent1
|
|
|
|
OProfile is a system-wide profiler for Linux systems, capable of
|
|
|
|
profiling all running code at low overhead. OProfile is released under
|
|
|
|
the GNU GPL.
|
|
|
|
|
2010-06-28 12:03:30 +02:00
|
|
|
This package contains the library needed at runtime when profiling JITed code
|
|
|
|
from supported virtual machines.
|
2009-07-30 22:54:32 +02:00
|
|
|
|
2007-01-12 01:32:05 +01:00
|
|
|
%prep
|
2009-08-05 00:58:38 +02:00
|
|
|
%setup -q
|
2011-09-25 01:02:34 +02:00
|
|
|
%patch1 -p1
|
2009-06-12 19:54:47 +02:00
|
|
|
%patch2 -p1
|
2012-01-03 16:21:55 +01:00
|
|
|
%patch3 -p1
|
2010-06-28 12:03:30 +02:00
|
|
|
mkdir -p java/include
|
|
|
|
# copy files necessary to build Java agent libraries
|
|
|
|
# libjvmpi_oprofile.so and libjvmti_oprofile.so
|
|
|
|
# %S:4 is rpm speak for Source4 (jvmpi.h)
|
|
|
|
ln -s %_libdir/jvm/java/include/* java/include
|
|
|
|
test -f java/include/jvmpi.h || ln -s %{S:4} java/include
|
2007-01-12 01:32:05 +01:00
|
|
|
|
|
|
|
%build
|
2008-07-11 21:26:54 +02:00
|
|
|
autoreconf -fi
|
2007-01-12 01:32:05 +01:00
|
|
|
./configure CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \
|
2008-11-20 16:06:19 +01:00
|
|
|
--prefix=/usr --mandir=%{_mandir} --libdir=%{_libdir} \
|
|
|
|
--with-kernel-support --with-java=$PWD/java \
|
2011-05-02 20:31:50 +02:00
|
|
|
--enable-gui=qt4
|
2011-09-25 01:02:34 +02:00
|
|
|
# Change DATE/TIME macros to use last change time of oprofile.changes
|
|
|
|
# See http://lists.opensuse.org/opensuse-factory/2011-05/msg00304.html
|
|
|
|
modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")"
|
|
|
|
DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
|
|
|
|
TIME="\"$(date -d "${modified}" "+%%R")\""
|
|
|
|
find . -type f -regex ".*\.c\|.*\.cpp\|.*\.h" -exec grep -E -e __DATE__ -e __TIME__ {} +
|
|
|
|
find . -type f -regex ".*\.c\|.*\.cpp\|.*\.h" -exec sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" {} +
|
2007-01-12 01:32:05 +01:00
|
|
|
make %{?jobs:-j%jobs}
|
|
|
|
|
|
|
|
%install
|
2007-06-18 18:27:23 +02:00
|
|
|
make DESTDIR=$RPM_BUILD_ROOT htmldir=%{_docdir}/oprofile install
|
2007-01-12 01:32:05 +01:00
|
|
|
%suse_update_desktop_file -i %name Development Profiling
|
2009-08-05 00:58:38 +02:00
|
|
|
rm -vf $RPM_BUILD_ROOT%{_libdir}/libopagent.*a
|
2009-07-30 22:54:32 +02:00
|
|
|
# Hardlink duplicate files automatically (from package fdupes):
|
|
|
|
# It doesn't save much, but it keeps rpmlint from breaking the package build.
|
|
|
|
%fdupes $RPM_BUILD_ROOT
|
2007-01-12 01:32:05 +01:00
|
|
|
|
2008-07-19 00:32:25 +02:00
|
|
|
%pre
|
|
|
|
/usr/sbin/groupadd -r oprofile 2>/dev/null || :
|
|
|
|
/usr/sbin/useradd -r -g oprofile -d /var/lib/empty -s /bin/false -c "Special user account to be used by OProfile" oprofile 2>/dev/null || :
|
|
|
|
|
2009-07-30 22:54:32 +02:00
|
|
|
%post -n libopagent1 -p /sbin/ldconfig
|
2008-10-23 12:27:14 +02:00
|
|
|
|
2009-07-30 22:54:32 +02:00
|
|
|
%postun -n libopagent1 -p /sbin/ldconfig
|
2008-10-23 12:27:14 +02:00
|
|
|
|
2007-01-12 01:32:05 +01:00
|
|
|
%clean
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
/usr/bin/*
|
|
|
|
/usr/share/applications/*.desktop
|
|
|
|
/usr/share/oprofile
|
2007-06-18 18:27:23 +02:00
|
|
|
%{_mandir}/man1/*
|
2010-06-28 12:03:30 +02:00
|
|
|
%{_libdir}/libjvm[tp]i_oprofile.so
|
|
|
|
%exclude %{_libdir}/libjvm[tp]i_oprofile.*a
|
2007-06-18 18:27:23 +02:00
|
|
|
%doc doc/oprofile.html doc/internals.html doc/opreport.xsd
|
2011-09-25 01:02:34 +02:00
|
|
|
%doc COPYING README TODO ChangeLog-*
|
2007-11-26 20:58:01 +01:00
|
|
|
|
2008-07-19 00:32:25 +02:00
|
|
|
%files devel
|
|
|
|
%defattr(-,root,root)
|
|
|
|
/usr/include/*
|
|
|
|
%doc doc/op-jit-devel.html
|
2008-10-23 12:27:14 +02:00
|
|
|
%{_libdir}/libopagent.so
|
2008-07-19 00:32:25 +02:00
|
|
|
|
2009-07-30 22:54:32 +02:00
|
|
|
%files -n libopagent1
|
|
|
|
%defattr(-,root,root)
|
2010-06-28 12:03:30 +02:00
|
|
|
%{_libdir}/libopagent.so.1*
|
2009-07-30 22:54:32 +02:00
|
|
|
|
2007-06-18 18:27:23 +02:00
|
|
|
%changelog
|