diff --git a/v0.30.0.tar.gz b/bcc-0.32.0.tar.gz similarity index 48% rename from v0.30.0.tar.gz rename to bcc-0.32.0.tar.gz index d8ddab4d0aa3238bc12594f79b9961ed99cb77b2..3ff4f88a611baa9ad02672a11e3a414b29c14423 100644 Binary files a/v0.30.0.tar.gz and b/bcc-0.32.0.tar.gz differ diff --git a/bcc.spec b/bcc.spec index 46eb78e80952364f3eb01398a054a3365378f9b2..8a4d3ae30820789689573c19a51a85eac3fbf3f0 100644 --- a/bcc.spec +++ b/bcc.spec @@ -7,90 +7,111 @@ %bcond_without libbpf_tools %endif +%bcond_with llvm_static + +%if %{without llvm_static} +%global with_llvm_shared 1 +%endif + Name: bcc -Version: 0.30.0 +Version: 0.32.0 Release: %{anolis_release}%{?dist} Summary: BPF Compiler Collection (BCC) -License: ASL 2.0 +License: Apache-2.0 URL: https://github.com/iovisor/bcc -Source0: %{url}/archive/refs/tags/v%{version}.tar.gz +Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz -#Patch1000: 1000-bcc-anolis-ali-enhanced-tools-for-fs-schedule-sys.patch -#Patch1001: 1001-Skiping-cases-in-libbpf-tools.patch -#Patch1003: 1003-add-u64-define.patch -#Patch1004: 1004-fix-man-pages-installation.patch - -BuildRequires: cmake >= 2.8.12 llvm-devel clang-devel llvm-googletest -BuildRequires: flex bison python3-setuptools -BuildRequires: elfutils-libelf-devel elfutils-debuginfod-client-devel -BuildRequires: ncurses-devel python3-devel libxml2-devel -BuildRequires: libbpf-devel >= 1.0.0 libbpf-static >= 1.0.0 +ExclusiveArch: x86_64 aarch64 loongarch64 +BuildRequires: bison +BuildRequires: cmake >= 2.8.7 +BuildRequires: flex +BuildRequires: libxml2-devel +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: elfutils-libelf-devel +BuildRequires: elfutils-debuginfod-client-devel +BuildRequires: llvm-devel +BuildRequires: clang-devel +%if %{with llvm_static} +BuildRequires: llvm-static +%endif +BuildRequires: ncurses-devel %if %{without ignore_lua} BuildRequires: pkgconfig(luajit) %endif +BuildRequires: libbpf-devel >= 2:0.8.0-1, libbpf-static >= 2:0.8.0-1 +BuildRequires: llvm-googletest -Requires: libbpf >= 1.0.0 tar +Requires: libbpf >= 2:0.8.0-1 +Requires: tar Recommends: kernel-devel -Recommends: %{name}-tools = %{EVR} -ExclusiveArch: x86_64 aarch64 loongarch64 +Recommends: %{name}-tools = %{version}-%{release} %description BCC is a toolkit for creating efficient kernel tracing and manipulation programs, and includes several useful tools and examples. It makes use of extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature -that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1 -and above. +that was first added to Linux 3.15. BCC makes BPF programs easier to write, +with kernel instrumentation in C (and includes a C wrapper around LLVM), and +front-ends in Python and lua. It is suited for many tasks, including +performance analysis and network traffic control. + %package devel Summary: Shared library for BPF Compiler Collection (BCC) -Requires: %{name} = %{EVR} +Requires: %{name}%{?_isa} = %{version}-%{release} Suggests: elfutils-debuginfod-client %description devel The %{name}-devel package contains libraries and header files for developing application that use BPF Compiler Collection (BCC). + %package doc Summary: Examples for BPF Compiler Collection (BCC) -Recommends: python3-%{name} = %{EVR} -Recommends: %{name}-lua = %{EVR} +Recommends: python3-%{name} = %{version}-%{release} +Recommends: %{name}-lua = %{version}-%{release} BuildArch: noarch %description doc Examples for BPF Compiler Collection (BCC) + %package -n python3-%{name} Summary: Python3 bindings for BPF Compiler Collection (BCC) -Requires: %{name} = %{EVR} +Requires: %{name} = %{version}-%{release} BuildArch: noarch %description -n python3-%{name} Python3 bindings for BPF Compiler Collection (BCC) + %if %{without ignore_lua} %package lua Summary: Standalone tool to run BCC tracers written in Lua -Requires: %{name} = %{EVR} +Requires: %{name}%{?_isa} = %{version}-%{release} %description lua Standalone tool to run BCC tracers written in Lua %endif + %package tools Summary: Command line tools for BPF Compiler Collection (BCC) -Requires: bcc = %{EVR} -Requires: python3-%{name} = %{EVR} +Requires: bcc = %{version}-%{release} +Requires: python3-%{name} = %{version}-%{release} Requires: python3-netaddr %description tools Command line tools for BPF Compiler Collection (BCC) + %if %{with libbpf_tools} %package -n libbpf-tools Summary: Command line libbpf tools for BPF Compiler Collection (BCC) -BuildRequires: libbpf-devel >= 0.0.5, libbpf-static >= 0.0.5 +BuildRequires: libbpf-devel >= 2:0.8.0-1, libbpf-static >= 2:0.8.0-1 BuildRequires: bpftool %description -n libbpf-tools @@ -100,21 +121,29 @@ Command line libbpf tools for BPF Compiler Collection (BCC) %prep %autosetup -p1 + %build %cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DREVISION_LAST=%{version} -DREVISION=%{version} -DPYTHON_CMD=python3 \ - -DCMAKE_USE_LIBBPF_PACKAGE:BOOL=TRUE \ - -DENABLE_LLVM_SHARED=1 + -DCMAKE_USE_LIBBPF_PACKAGE:BOOL=TRUE -DENABLE_NO_PIE=OFF \ + %{?with_llvm_shared:-DENABLE_LLVM_SHARED=1} %cmake_build + +# It was discussed and agreed to package libbpf-tools with +# 'bpf-' prefix (https://github.com/iovisor/bcc/pull/3263) +# Installing libbpf-tools binaries in temp directory and +# renaming them in there and the install code will just +# take them. %if %{with libbpf_tools} -pushd libbpf-tools -make BPFTOOL=bpftool LIBBPF_OBJ=%{_libdir}/libbpf.a CFLAGS="%{optflags}" LDFLAGS="%{build_ldflags}" +pushd libbpf-tools; +make BPFTOOL=bpftool LIBBPF_OBJ=%{_libdir}/libbpf.a CFLAGS="%{optflags}" LDFLAGS="%{build_ldflags}" USE_BLAZESYM=0 make DESTDIR=./tmp-install prefix= install ( cd tmp-install/bin for file in *; do mv $file bpf-$file done + # now fix the broken symlinks for file in `find . -type l`; do dest=$(readlink "$file") ln -s -f bpf-$dest $file @@ -126,30 +155,36 @@ popd %install %cmake_install +# Fix python shebangs find %{buildroot}%{_datadir}/%{name}/{tools,examples} -type f -exec \ sed -i -e '1s=^#!/usr/bin/python\([0-9.]\+\)\?$=#!%{__python3}=' \ -e '1s=^#!/usr/bin/env python\([0-9.]\+\)\?$=#!%{__python3}=' \ -e '1s=^#!/usr/bin/env bcc-lua$=#!/usr/bin/bcc-lua=' {} \; +# Move man pages to the right location mkdir -p %{buildroot}%{_mandir} mv %{buildroot}%{_datadir}/%{name}/man/* %{buildroot}%{_mandir}/ for i in `find %{buildroot}%{_mandir} -name "*.gz"`; do tname=$(basename $i) rename $tname %{name}-$tname $i done - mkdir -p %{buildroot}%{_docdir}/%{name} mv %{buildroot}%{_datadir}/%{name}/examples %{buildroot}%{_docdir}/%{name}/ rm -rf %{buildroot}%{_datadir}/%{name}/tools/old/ + %if %{with libbpf_tools} mkdir -p %{buildroot}/%{_sbindir} -install -p libbpf-tools/tmp-install/bin/* %{buildroot}/%{_sbindir}/ +# We cannot use `install` because some of the tools are symlinks and `install` +# follows those. Since all the tools already have the correct permissions set, +# we just need to copy them to the right place while preserving those +cp -a libbpf-tools/tmp-install/bin/* %{buildroot}/%{_sbindir}/ %endif %generate_compatibility_deps %files +%license LICENSE.txt %{_libdir}/lib%{name}.so.* %{_libdir}/libbcc_bpf.so.* @@ -159,11 +194,11 @@ install -p libbpf-tools/tmp-install/bin/* %{buildroot}/%{_sbindir}/ %files devel %exclude %{_libdir}/lib%{name}*.a +%exclude %{_libdir}/lib%{name}*.la %{_libdir}/lib%{name}.so %{_libdir}/libbcc_bpf.so %{_libdir}/pkgconfig/lib%{name}.pc %{_includedir}/%{name}/ -%{abidir}/lib%{name}*.dump %files -n python3-%{name} %{python3_sitelib}/%{name}* @@ -191,6 +226,9 @@ install -p libbpf-tools/tmp-install/bin/* %{buildroot}/%{_sbindir}/ %endif %changelog +* Wed Feb 19 2025 Zhao Hang - 0.32.0-1 +- Refer to CentOS Stream bcc-0.32.0-1 (nmontero@redhat.com) + * Wed May 08 2024 mgb01105731 - 0.30.0-1 - update to 0.30.0