Skip to content

Commit 74a47da

Browse files
committed
[redhat] kernel.spec: create libperf subpackage
Bugzilla: https://bugzilla.redhat.com/2174972 Upstream status: RHEL-only Signed-off-by: Michael Petlan <mpetlan@redhat.com>
1 parent 0da1419 commit 74a47da

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

redhat/kernel.spec.template

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,33 @@ This package provides debug information for the perf python bindings.
10641064
# the python_sitearch macro should already be defined from above
10651065
%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*%%{python3_sitearch}/perf.*so(\.debug)?|XXX' -o python3-perf-debuginfo.list}
10661066

1067+
%package -n libperf
1068+
Summary: The perf library from kernel source
1069+
License: GPLv2
1070+
%description -n libperf
1071+
This package contains the kernel source perf library.
1072+
1073+
%package -n libperf-devel
1074+
Summary: Developement files for the perf library from kernel source
1075+
License: GPLv2
1076+
%description -n libperf-devel
1077+
This package includes libraries and header files needed for development
1078+
of applications which use perf library from kernel source.
1079+
1080+
%package -n libperf-debuginfo
1081+
Summary: Debug information for package libperf
1082+
Group: Development/Debug
1083+
Requires: %{name}-debuginfo-common-%{_target_cpu} = %{version}-%{release}
1084+
AutoReqProv: no
1085+
%description -n libperf-debuginfo
1086+
This package provides debug information for the libperf package.
1087+
1088+
# Note that this pattern only works right to match the .build-id
1089+
# symlinks because of the trailing nonmatching alternation and
1090+
# the leading .*, because of find-debuginfo.sh's buggy handling
1091+
# of matching the pattern against the symlinks file.
1092+
%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*%%{_libdir}/libperf.so(\.debug)?|XXX' -o libperf-debuginfo.list}
1093+
10671094
# with_perf
10681095
%endif
10691096

@@ -2568,6 +2595,8 @@ InitBuildVars
25682595
# make sure check-headers.sh is executable
25692596
chmod +x tools/perf/check-headers.sh
25702597
%{perf_make} DESTDIR=$RPM_BUILD_ROOT all
2598+
# libperf
2599+
make -C tools/lib/perf V=1
25712600
%endif
25722601

25732602
%global tools_make \
@@ -2859,6 +2888,10 @@ mkdir -p %{buildroot}/%{_mandir}/man1
28592888
# LIBTRACEEVENT_DYNAMIC=1 above in perf_make macro). Those files should already
28602889
# ship with libtraceevent package.
28612890
rm -rf %{buildroot}%{_libdir}/traceevent
2891+
2892+
# libperf
2893+
make -C tools/lib/perf DESTDIR=%{buildroot} prefix=%{_prefix} libdir=%{_libdir} V=1 install
2894+
rm -f %{buildroot}%{_libdir}/libperf.a
28622895
%endif
28632896

28642897
%if %{with_tools}
@@ -3340,10 +3373,25 @@ fi
33403373
%files -n python3-perf
33413374
%{python3_sitearch}/*
33423375

3376+
%files -n libperf
3377+
%{_libdir}/libperf.so.0
3378+
%{_libdir}/libperf.so.0.0.1
3379+
3380+
%files -n libperf-devel
3381+
%{_libdir}/libperf.so
3382+
%{_libdir}/pkgconfig/libperf.pc
3383+
%{_includedir}/perf/
3384+
%{_mandir}/man3/libperf.*
3385+
%{_mandir}/man7/libperf-counting.*
3386+
%{_mandir}/man7/libperf-sampling.*
3387+
%{_docdir}/libperf/
3388+
33433389
%if %{with_debuginfo}
33443390
%files -f perf-debuginfo.list -n perf-debuginfo
33453391

33463392
%files -f python3-perf-debuginfo.list -n python3-perf-debuginfo
3393+
3394+
%files -f libperf-debuginfo.list -n libperf-debuginfo
33473395
%endif
33483396
# with_perf
33493397
%endif

0 commit comments

Comments
 (0)