From: Herton R. Krzesinski <herton(a)redhat.com>
rpmspec: drop traceevent files instead of just excluding them from files list
Bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1967640
Even if we build perf dynamically against libtraceevent present on the system,
it still builds traceevent plugins. If we only exclude the files from
the perf package, to not conflict with libtraceevent package, its debug files
will still get included in the kernel-debuginfo package. We don't want that,
since libtraceevent already should ship plugins and its debuginfo. Thus
remove all traceevent files instead of partially excluding them through
rpm's package file list, any files there should already ship with
libtraceevent related packages.
Signed-off-by: Herton R. Krzesinski <herton(a)redhat.com>
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -2430,6 +2430,12 @@ rm -rf %{buildroot}/usr/lib/perf/include
# perf man pages (note: implicit rpm magic compresses them later)
mkdir -p %{buildroot}/%{_mandir}/man1
%{perf_make} DESTDIR=$RPM_BUILD_ROOT install-man
+
+# remove any tracevent files, eg. its plugins still gets built and installed,
+# even if we build against system's libtracevent during perf build (by setting
+# LIBTRACEEVENT_DYNAMIC=1 above in perf_make macro). Those files should already
+# ship with libtraceevent package.
+rm -rf %{buildroot}%{_libdir}/traceevent
%endif
%if %{with_tools}
@@ -2745,7 +2751,6 @@ fi
%files -n perf
%{_bindir}/perf
%{_libdir}/libperf-jvmti.so
-%exclude %{_libdir}/traceevent
%dir %{_libexecdir}/perf-core
%{_libexecdir}/perf-core/*
%{_datadir}/perf-core/*
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1328