SPECS/bcc.spec: add dependencies to libdebuginfod
authorAndreas Ziegler <andreas.ziegler@fau.de>
Thu, 6 May 2021 07:02:28 +0000 (09:02 +0200)
committeryonghong-song <ys114321@gmail.com>
Sun, 9 May 2021 06:37:26 +0000 (23:37 -0700)
On Fedora builds we can check the version number and add
build and runtime dependencies to debuginfod for all
currently supported releases (>= 32). Note that the buildbot
only has Fedora 25-28 so it will not try to build libbcc
with debuginfod support as the required packages are not
available on these releases.

For .deb packages there is no easy way to add dependencies
dynamically, so we do not add dependencies to libdebuginfod
there for now. For documentation purposes, however, let's
add a comment indicating which changes are required for
libdebuginfod support for downstream maintainers.

Signed-off-by: Andreas Ziegler <andreas.ziegler@fau.de>
SPECS/bcc.spec
debian/control

index f74bb614976074f51afffb738443804ed14a8bfe..9a6f835d7673f6edf4d96c1c3a5dc1531c7a876f 100644 (file)
 %bcond_with python3
 %endif
 
+# Build with debuginfod support for Fedora >= 32
+%if 0%{?fedora} >= 32
+%bcond_without libdebuginfod
+%else
+%bcond_with libdebuginfod
+%endif
+
 %if %{with python3}
 %global __python %{__python3}
 %global python_bcc python3-bcc
@@ -45,6 +52,9 @@ Source0:        bcc.tar.gz
 ExclusiveArch: x86_64 ppc64 aarch64 ppc64le
 BuildRequires: bison cmake >= 2.8.7 flex make
 BuildRequires: gcc gcc-c++ python2-devel elfutils-libelf-devel-static
+%if %{with libdebuginfod}
+BuildRequires: elfutils-debuginfod-client-devel
+%endif
 %if %{with python3}
 BuildRequires: python3-devel
 %endif
@@ -96,6 +106,9 @@ find %{buildroot}/usr/share/bcc/{tools,examples} -type f -exec \
 %package -n libbcc
 Summary: Shared Library for BPF Compiler Collection (BCC)
 Requires: elfutils-libelf
+%if %{with libdebuginfod}
+Requires: elfutils-debuginfod-client
+%endif
 %description -n libbcc
 Shared Library for BPF Compiler Collection (BCC)
 
index bb799173a7b06ac049c56782a3d2a096ece84ea5..3cf4ce2ebf55859a5e5a7f148e2a3bc4f9e631db 100644 (file)
@@ -12,6 +12,7 @@ Build-Depends: debhelper (>= 9), cmake,
     python (>= 2.7), python-netaddr, python-pyroute2 | python3-pyroute2, luajit,
     libluajit-5.1-dev, arping, inetutils-ping | iputils-ping, iperf, netperf,
     ethtool, devscripts, python3, dh-python
+# add 'libdebuginfod-dev' to Build-Depends for libdebuginfod support
 Homepage: https://github.com/iovisor/bcc
 
 Package: libbcc
@@ -19,6 +20,7 @@ Architecture: any
 Provides: libbpfcc, libbpfcc-dev
 Conflicts: libbpfcc, libbpfcc-dev
 Depends: libc6, libstdc++6, libelf1
+# add 'libdebuginfod1' to Depends if built with libdebuginfod support
 Description: Shared Library for BPF Compiler Collection (BCC)
  Shared Library for BPF Compiler Collection to control BPF programs
  from userspace.