-
Notifications
You must be signed in to change notification settings - Fork 0
/
oprofile.spec
179 lines (150 loc) · 5.69 KB
/
oprofile.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
#
# spec file for package oprofile
#
# Copyright (c) 2023 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%global _disable_rpmlint 1
%define with_rpmlint 1
Name: oprofile
Version: 1.4.0
Release: 0
Summary: System-Wide Profiler for Linux Systems
License: GPL-2.0-or-later AND LGPL-2.1-or-later
Group: Development/Tools/Other
URL: http://oprofile.sourceforge.net/
Source0: http://prdownloads.sourceforge.net/oprofile/oprofile-%{version}.tar.gz
Source2: %{name}.rpmlintrc
Source3: baselibs.conf
Source4: jvmpi.h
Source5: README-BEFORE-ADDING-PATCHES
Patch1: %{name}-no-libjvm-version.patch
Patch2: %{name}-pfm-ppc.patch
Patch3: %{name}-binutils.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: binutils-devel
BuildRequires: docbook-utils-minimal
BuildRequires: docbook-xsl-stylesheets
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: java-devel
BuildRequires: libICE-devel
BuildRequires: libtool
BuildRequires: libxslt
BuildRequires: libzstd-devel
BuildRequires: pkgconfig
BuildRequires: popt-devel
BuildRequires: zlib-devel
Requires(pre): pwdutils
%ifarch ppc ppc64 ppc64le
BuildRequires: libpfm-devel >= 4.3.0
%endif
%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.
%package devel
Summary: Development files for oprofile, a system-wide profiler for Linux
Group: Development/Libraries/C and C++
Requires: binutils-devel
Requires: libopagent1 = %{version}-%{release}
%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.
This package contains the files needed to develop JIT agents for other
virtual machines.
%package -n libopagent1
Summary: System-Wide Profiler for Linux Systems
Group: System/Libraries
%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.
This package contains the library needed at runtime when profiling JITed code
from supported virtual machines.
%prep
%global _rpmlint_path ""
%autosetup -p1
mkdir -p java/include
# copy files necessary to build Java agent libraries
# libjvmpi_oprofile.so and libjvmti_oprofile.so
ln -s %{_libdir}/jvm/java/include/* java/include
test -f java/include/jvmpi.h || ln -s %{SOURCE4} java/include
%build
%global _rpmlint_path ""
./autogen.sh
%configure \
--with-java=$PWD/java
# 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" {} +
%make_build
%install
%global _rpmlint_path ""
%make_install htmldir=%{_docdir}/oprofile
rm -f %{buildroot}%{_libdir}/oprofile/libopagent.*a
# Hardlink duplicate files automatically (from package fdupes):
# It doesn't save much, but it keeps rpmlint from breaking the package build.
%fdupes %{buildroot}/%{_prefix}
%pre
%global _rpmlint_path ""
getent group oprofile >/dev/null || groupadd -r oprofile 2> /dev/null
getent passwd oprofile >/dev/null || \
useradd -r -g oprofile -d %{_localstatedir}/lib/empty \
-s /bin/false -c "Special user account to be used by OProfile" \
oprofile 2> /dev/null
%post -n libopagent1 -p /sbin/ldconfig
%postun -n libopagent1 -p /sbin/ldconfig
%files
%{_bindir}/ocount
%{_bindir}/ophelp
%{_bindir}/opimport
%{_bindir}/opannotate
%{_bindir}/opgprof
%{_bindir}/opreport
%{_bindir}/oparchive
%{_bindir}/opjitconv
%{_bindir}/op-check-perfevents
%{_bindir}/operf
%{_datadir}/oprofile
%{_mandir}/man1/*
%{_libdir}/oprofile/libjvm[tp]i_oprofile.so
%exclude %{_libdir}/oprofile/libjvm[tp]i_oprofile.*a
%doc doc/opreport.xsd
%{_docdir}/%{name}/ophelp.xsd
%files devel
%{_includedir}/*
%{_docdir}/%{name}/op-jit-devel.html
%dir %{_libdir}/oprofile
%{_libdir}/oprofile/libopagent.so
%files -n libopagent1
%dir %{_libdir}/oprofile
%{_libdir}/oprofile/libopagent.so.1*
%changelog