Blame SPECS/bcc.spec

5d1f51
# luajit is not available RHEL 8
5d1f51
%bcond_with lua
5d1f51
d4dc1a
%bcond_with llvm_static
d4dc1a
d4dc1a
%if %{without llvm_static}
d4dc1a
%global with_llvm_shared 1
d4dc1a
%endif
5d1f51
5d1f51
Name:           bcc
80e6d8
Version:        0.24.0
80e6d8
Release:        2%{?dist}
5d1f51
Summary:        BPF Compiler Collection (BCC)
5d1f51
License:        ASL 2.0
5d1f51
URL:            https://github.com/iovisor/bcc
f5a3df
Source0:        %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
d0f628
Patch0:         %{name}-%{version}-Manpages-remove-unstable-statement.patch
80e6d8
Patch1:         %{name}-%{version}-RHEL-libbpf-version-fixes.patch
80e6d8
Patch2:         %{name}-%{version}-libbpf-Allow-kernel_struct_has_field-to-reach-field-.patch
5d1f51
5d1f51
# Arches will be included as upstream support is added and dependencies are
5d1f51
# satisfied in the respective arches
5d1f51
ExcludeArch: i686
5d1f51
d4dc1a
BuildRequires:  bison
d4dc1a
BuildRequires:  cmake >= 2.8.7
d4dc1a
BuildRequires:  flex
d4dc1a
BuildRequires:  libxml2-devel
5d1f51
BuildRequires:  python3-devel
5d1f51
BuildRequires:  elfutils-libelf-devel
5d1f51
BuildRequires:  llvm-devel
5d1f51
BuildRequires:  clang-devel
5d1f51
%if %{with llvm_static}
5d1f51
BuildRequires:  llvm-static
5d1f51
%endif
d4dc1a
BuildRequires:  ncurses-devel
d4dc1a
%if %{with lua}
d4dc1a
BuildRequires:  pkgconfig(luajit)
d4dc1a
%endif
80e6d8
BuildRequires:  libbpf-devel >= 0.5.0, libbpf-static >= 0.5.0
5d1f51
80e6d8
Requires:       libbpf >= 0.5.0
f5a3df
Requires:       tar
f5a3df
Recommends:     kernel-devel
f5a3df
Recommends:     %{name}-tools = %{version}-%{release}
5d1f51
5d1f51
%description
5d1f51
BCC is a toolkit for creating efficient kernel tracing and manipulation
5d1f51
programs, and includes several useful tools and examples. It makes use of
5d1f51
extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
5d1f51
that was first added to Linux 3.15. BCC makes BPF programs easier to write,
5d1f51
with kernel instrumentation in C (and includes a C wrapper around LLVM), and
5d1f51
front-ends in Python and lua. It is suited for many tasks, including
5d1f51
performance analysis and network traffic control.
5d1f51
5d1f51
5d1f51
%package devel
5d1f51
Summary:        Shared library for BPF Compiler Collection (BCC)
5d1f51
Requires:       %{name}%{?_isa} = %{version}-%{release}
5d1f51
5d1f51
%description devel
5d1f51
The %{name}-devel package contains libraries and header files for developing
5d1f51
application that use BPF Compiler Collection (BCC).
5d1f51
5d1f51
5d1f51
%package doc
5d1f51
Summary:        Examples for BPF Compiler Collection (BCC)
5d1f51
Recommends:     python3-%{name} = %{version}-%{release}
5d1f51
%if %{with lua}
5d1f51
Recommends:     %{name}-lua = %{version}-%{release}
5d1f51
%endif
5d1f51
BuildArch:      noarch
5d1f51
5d1f51
%description doc
5d1f51
Examples for BPF Compiler Collection (BCC)
5d1f51
5d1f51
5d1f51
%package -n python3-%{name}
5d1f51
Summary:        Python3 bindings for BPF Compiler Collection (BCC)
5d1f51
Requires:       %{name}%{?_isa} = %{version}-%{release}
d0f628
%{?python_provide:%python_provide python3-%{name}}
5d1f51
5d1f51
%description -n python3-%{name}
5d1f51
Python3 bindings for BPF Compiler Collection (BCC)
5d1f51
5d1f51
5d1f51
%if %{with lua}
5d1f51
%package lua
5d1f51
Summary:        Standalone tool to run BCC tracers written in Lua
5d1f51
Requires:       %{name}%{?_isa} = %{version}-%{release}
5d1f51
5d1f51
%description lua
5d1f51
Standalone tool to run BCC tracers written in Lua
5d1f51
%endif
5d1f51
5d1f51
5d1f51
%package tools
5d1f51
Summary:        Command line tools for BPF Compiler Collection (BCC)
80e6d8
Requires:       bcc = %{version}-%{release}
5d1f51
Requires:       python3-%{name} = %{version}-%{release}
5d1f51
Requires:       python3-netaddr
5d1f51
5d1f51
%description tools
5d1f51
Command line tools for BPF Compiler Collection (BCC)
5d1f51
5d1f51
%prep
f5a3df
%autosetup -p1
5d1f51
5d1f51
%build
5d1f51
%cmake . \
5d1f51
        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
d4dc1a
        -DREVISION_LAST=%{version} -DREVISION=%{version} -DPYTHON_CMD=python3 \
d4dc1a
        -DCMAKE_USE_LIBBPF_PACKAGE:BOOL=TRUE \
d4dc1a
        %{?with_llvm_shared:-DENABLE_LLVM_SHARED=1}
5d1f51
%make_build
5d1f51
d4dc1a
5d1f51
%install
5d1f51
%make_install
5d1f51
5d1f51
# Fix python shebangs
5d1f51
# This messes the timestamp and rpmdiff complains about it
5d1f51
# Let's set the all thing according to a reference file
5d1f51
touch -r %{buildroot}%{_datadir}/%{name}/examples/hello_world.py %{_tmppath}/timestamp
5d1f51
5d1f51
find %{buildroot}%{_datadir}/%{name}/{tools,examples} -type f -exec \
5d1f51
  sed -i -e '1s=^#!/usr/bin/python\([0-9.]\+\)\?$=#!%{__python3}=' \
5d1f51
         -e '1s=^#!/usr/bin/env python\([0-9.]\+\)\?$=#!%{__python3}=' \
5d1f51
         -e '1s=^#!/usr/bin/env bcc-lua$=#!/usr/bin/bcc-lua=' {} \;
5d1f51
5d1f51
for i in `find %{buildroot}%{_datadir}/%{name}/examples/` ; do
5d1f51
    touch -h -r %{_tmppath}/timestamp $i
5d1f51
done
5d1f51
5d1f51
# Move man pages to the right location
5d1f51
mkdir -p %{buildroot}%{_mandir}
5d1f51
mv %{buildroot}%{_datadir}/%{name}/man/* %{buildroot}%{_mandir}/
5d1f51
# Avoid conflict with other manpages
5d1f51
# https://bugzilla.redhat.com/show_bug.cgi?id=1517408
5d1f51
for i in `find %{buildroot}%{_mandir} -name "*.gz"`; do
5d1f51
  tname=$(basename $i)
5d1f51
  rename $tname %{name}-$tname $i
5d1f51
done
5d1f51
# Fix the symlink too
5d1f51
for i in `find %{buildroot}%{_mandir} -lname \*.gz` ; do
5d1f51
    target=`readlink $i`;
5d1f51
    ln -sf bcc-$target $i;
5d1f51
done
5d1f51
5d1f51
# We cannot run the test suit since it requires root and it makes changes to
5d1f51
# the machine (e.g, IP address)
5d1f51
#%check
5d1f51
5d1f51
%ldconfig_scriptlets
5d1f51
5d1f51
%files
5d1f51
%doc README.md
5d1f51
%license LICENSE.txt
5d1f51
%{_libdir}/lib%{name}.so.*
d29dad
%{_libdir}/libbcc_bpf.so.*
5d1f51
5d1f51
%files devel
d0f628
%exclude %{_libdir}/lib%{name}*.a
d0f628
%exclude %{_libdir}/lib%{name}*.la
5d1f51
%{_libdir}/lib%{name}.so
d29dad
%{_libdir}/libbcc_bpf.so
5d1f51
%{_libdir}/pkgconfig/lib%{name}.pc
5d1f51
%{_includedir}/%{name}/
5d1f51
5d1f51
%files -n python3-%{name}
5d1f51
%{python3_sitelib}/%{name}*
5d1f51
5d1f51
%files doc
5d1f51
# % dir % {_docdir}/% {name}
5d1f51
%doc %{_datadir}/%{name}/examples/
5d1f51
%if %{without lua}
5d1f51
%exclude %{_datadir}/%{name}/examples/lua
5d1f51
%endif
5d1f51
5d1f51
%files tools
5d1f51
%dir %{_datadir}/%{name}
5d1f51
%dir %{_datadir}/%{name}/tools
5d1f51
%dir %{_datadir}/%{name}/introspection
5d1f51
%{_datadir}/%{name}/tools/*
5d1f51
%{_datadir}/%{name}/introspection/*
5d1f51
%exclude %{_datadir}/%{name}/tools/old/
5d1f51
# inject relies on BPF_KPROBE_OVERRIDE which is not set on RHEL 8
5d1f51
%exclude %{_datadir}/%{name}/tools/inject
5d1f51
%exclude %{_datadir}/%{name}/tools/doc/inject_example.txt
5d1f51
%exclude %{_mandir}/man8/bcc-inject.8.gz
5d1f51
# Neither btrfs nor zfs are available on RHEL8
5d1f51
%exclude %{_datadir}/%{name}/tools/btrfs*
5d1f51
%exclude %{_datadir}/%{name}/tools/doc/btrfs*
5d1f51
%exclude %{_mandir}/man8/bcc-btrfs*
5d1f51
%exclude %{_datadir}/%{name}/tools/zfs*
5d1f51
%exclude %{_datadir}/%{name}/tools/doc/zfs*
5d1f51
%exclude %{_mandir}/man8/bcc-zfs*
d29dad
# criticalstat relies on CONFIG_PREEMPTIRQ_EVENTS which is disabled on RHEL 8
d29dad
%exclude %{_datadir}/%{name}/tools/criticalstat
d29dad
%exclude %{_datadir}/%{name}/tools/doc/criticalstat_example.txt
d0f628
%exclude %{_mandir}/man8/bcc-criticalstat.8.gz
d0f628
# compactsnoop is only supported on x86_64
d0f628
%ifnarch x86_64
d0f628
%exclude %{_datadir}/%{name}/tools/compactsnoop
d0f628
%exclude %{_datadir}/%{name}/tools/doc/compactsnoop_example.txt
d0f628
%exclude %{_mandir}/man8/bcc-compactsnoop.8.gz
d0f628
%endif
5d1f51
%{_mandir}/man8/*
5d1f51
5d1f51
%if %{with lua}
5d1f51
%files lua
5d1f51
%{_bindir}/bcc-lua
5d1f51
%endif
5d1f51
5d1f51
5d1f51
%changelog
80e6d8
* Thu Jun 23 2022 Jerome Marchand <jmarchan@redhat.com> - 0.24.0-2
80e6d8
- Rebuild on libbpf 0.5.0
80e6d8
80e6d8
* Thu Jun 09 2022 Jerome Marchand <jmarchan@redhat.com> - 0.24.0-1
80e6d8
- Rebase to bcc-0.24.0
80e6d8
- Rebuild on LLVM 14
80e6d8
80e6d8
* Mon Dec 06 2021 Jerome Marchand <jmarchan@redhat.com> - 0.19.0-6
80e6d8
- Add excplicit requirement in bcc-tools for rpmdiff
80e6d8
cf8307
* Tue Nov 23 2021 Jerome Marchand <jmarchan@redhat.com> - 0.19.0-5
cf8307
- Handle the renaming of task_struct_>state field
cf8307
- Rebuild for LLVM 13
cf8307
f5a3df
* Fri Jul 02 2021 Jerome Marchand <jmarchan@redhat.com> - 0.19.0-4
f5a3df
- Build bcc from standard sources
f5a3df
- Don't require bcc-tools by default
f5a3df
f5a3df
* Wed Jun 09 2021 Jerome Marchand <jmarchan@redhat.com> - 0.19.0-3
f5a3df
- Rebuild on LLVM 12
f5a3df
f5a3df
* Fri Apr 30 2021 Jerome Marchand <jmarchan@redhat.com> - 0.19.0-2
f5a3df
- Fix BPF src_file.
f5a3df
f5a3df
* Tue Apr 27 2021 Jerome Marchand <jmarchan@redhat.com> - 0.19.0-1
f5a3df
- Rebased to version 0.19.0
f5a3df
- Remove hard dependency on kernel-devel
f5a3df
d4dc1a
* Fri Jan 22 2021 Jerome Marchand <jmarchan@redhat.com> - 0.16.0-2
d4dc1a
- Build with libbpf package
d4dc1a
- spec file cleanups
d4dc1a
d4dc1a
* Mon Oct 26 2020 Jerome Marchand <jmarchan@redhat.com> - 0.16.0-1
d4dc1a
- Rebase on bcc-0.16.0
d4dc1a
- Fix IPv6 ports
d4dc1a
d4dc1a
* Wed Sep 02 2020 Jerome Marchand <jmarchan@redhat.com> - 0.14.0-4
d4dc1a
- Fix KFUNC_PROBE return value
d4dc1a
- Forbid trampolines on unsupported arches
d4dc1a
d4dc1a
* Tue Jul 21 2020 Jerome Marchand <jmarchan@redhat.com> - 0.14.0-3
d4dc1a
- Add KBUILD_MODNAME flag to default cflags
d4dc1a
d0f628
* Thu Jun 11 2020 Jerome Marchand <jmarchan@redhat.com> - 0.14.0-2
d0f628
- Remove criticalstat manpage
d0f628
- Remove compactsnoop on non x86_64
d0f628
- Suggest to use --binary in deadlock
d0f628
- Remove non-existent argument from tcpconnect man page
d0f628
- Suggest to install the proper kernel-devel version
d0f628
- Fix dbstat and dbslower
d0f628
d0f628
* Wed Apr 22 2020 Jerome Marchand <jmarchan@redhat.com> - 0.14.0-1
d0f628
- Rebase on bcc-0.14.0
d0f628
d29dad
* Wed Dec 04 2019 Jerome Marchand <jmarchan@redhat.com> - 0.11.0-2
d29dad
- Add -c option ton the synopsis of tcpretrans manpage
d29dad
d29dad
* Tue Nov 26 2019 Jerome Marchand <jmarchan@redhat.com> - 0.11.0-1
d29dad
- Rebase to bcc-0.11.0
d29dad
- Reinstate the unstable comment patch that has been removed by mistake
d29dad
d29dad
* Thu Oct 17 2019 Jerome Marchand <jmarchan@redhat.com> - 0.10.0-1
d29dad
- Rebase to bcc-0.10.0
d29dad
- Drop criticalstat
d29dad
- Fix regression on vfscount and runqslower
d29dad
- Rebuild on LLVM 9
d29dad
d29dad
* Tue Aug 06 2019 Jerome Marchand <jmarchan@redhat.com> - 0.8.0-4
d29dad
- remove unstable statement from the man pages
d29dad
d29dad
* Wed Jul 03 2019 Jerome Marchand <jmarchan@redhat.com> - 0.8.0-3
d29dad
- fix b.support_raw_tracepoint
d29dad
- fix runqslower warning
d29dad
5d1f51
* Wed May 15 2019 Jerome Marchand <jmarchan@redhat.com> - 0.8.0-2
5d1f51
- Rebuild for llvm 8
5d1f51
5d1f51
* Thu Apr 11 2019 Jerome Marchand <jmarchan@redhat.com> - 0.8.0-1
5d1f51
- Rebase on bcc-8.0.0
5d1f51
- Replace the temporary s390x workaround by a proper fix
5d1f51
- Remove the doc of excluded tool from the package
5d1f51
- Fix print_log2_hist
5d1f51
- Fix yet a few other python3 bytes vs strings issues
5d1f51
5d1f51
* Mon Mar 25 2019 Jerome Marchand <jmarchan@redhat.com> - 0.7.0-6
5d1f51
- Add CI gating
5d1f51
5d1f51
* Thu Dec 13 2018 Jerome Marchand <jmarchan@redhat.com> - 0.7.0-5
5d1f51
- Fix biolatency -D
5d1f51
- Fix biotop manpage
5d1f51
- Rebuild for LLVM 7.0.1 (from Tom Stellard)
5d1f51
5d1f51
* Mon Dec 10 2018 Jerome Marchand <jmarchan@redhat.com> - 0.7.0-4
5d1f51
- Fix bio* tools
5d1f51
5d1f51
* Mon Nov 05 2018 Jerome Marchand <jmarchan@redhat.com> - 0.7.0-3
5d1f51
- Fix multiple bytes/string encoding issues
5d1f51
- Fix misc covscan warning
5d1f51
5d1f51
* Mon Oct 15 2018 Tom Stellard <tstellar@redhat.com> - 0.7.0-2
5d1f51
- Drop explicit dependency on clang-libs
5d1f51
5d1f51
* Fri Oct 12 2018 Jerome Marchand <jmarchan@redhat.com> - 0.7.0-1
5d1f51
- Rebase on bcc-7.0.0
5d1f51
- Remove useless tools (zfs*, btrfs* and inject) 
5d1f51
5d1f51
* Thu Sep 20 2018 Jerome Marchand <jmarchan@redhat.com> - 0.6.1-1
5d1f51
- Rebase on bcc-0.6.1
5d1f51
5d1f51
* Thu Sep 20 2018 Jerome Marchand <jmarchan@redhat.com> - 0.6.0-6
5d1f51
- llcstat: print a nicer error message on virtual machine
5d1f51
- Add NSS support to sslsniff
5d1f51
- Fixes miscellaneous error uncovered by covscan
5d1f51
5d1f51
* Wed Aug 08 2018 Tom Stellard <tstellar@redhat.com> - 0.6.0-5
5d1f51
- Use llvm-toolset-6.0 prefix for clang-libs dependency
5d1f51
5d1f51
* Fri Aug 03 2018 Tom Stellard <tstellar@redhat.com> - 0.6.0-4
5d1f51
- Rebuld for llvm-toolset-6.0
5d1f51
5d1f51
* Wed Jul 18 2018 Jerome Marchand <jmarchan@redhat.com> - 0.6.0-3
5d1f51
 - Disable lua on all arches
5d1f51
5d1f51
* Tue Jun 26 2018 Jerome Marchand <jmarchan@redhat.com> - 0.6.0-2
5d1f51
- Add clang-libs requirement
5d1f51
- Fix manpages symlinks
5d1f51
5d1f51
* Tue Jun 19 2018 Jerome Marchand <jmarchan@redhat.com> - 0.6.0-1
5d1f51
- Rebase on bcc-0.6.0
5d1f51
5d1f51
* Thu May 24 2018 Jerome Marchand <jmarchan@redhat.com> - 0.5.0-5
5d1f51
- Enables build on ppc64(le) and s390x arches
5d1f51
5d1f51
* Thu Apr 05 2018 Rafael Santos <rdossant@redhat.com> - 0.5.0-4
5d1f51
- Resolves #1555627 - fix compilation error with latest llvm/clang
5d1f51
5d1f51
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-3
5d1f51
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
5d1f51
5d1f51
* Fri Feb 02 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.5.0-2
5d1f51
- Switch to %%ldconfig_scriptlets
5d1f51
5d1f51
* Wed Jan 03 2018 Rafael Santos <rdossant@redhat.com> - 0.5.0-1
5d1f51
- Rebase to new released version
5d1f51
5d1f51
* Thu Nov 16 2017 Rafael Santos <rdossant@redhat.com> - 0.4.0-4
5d1f51
- Resolves #1517408 - avoid conflict with other manpages
5d1f51
5d1f51
* Thu Nov 02 2017 Rafael Santos <rdossant@redhat.com> - 0.4.0-3
5d1f51
- Use weak deps to not require lua subpkg on ppc64(le)
5d1f51
5d1f51
* Wed Nov 01 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.4.0-2
5d1f51
- Rebuild for LLVM5
5d1f51
5d1f51
* Wed Nov 01 2017 Rafael Fonseca <rdossant@redhat.com> - 0.4.0-1
5d1f51
- Resolves #1460482 - rebase to new release
5d1f51
- Resolves #1505506 - add support for LLVM 5.0
5d1f51
- Resolves #1460482 - BPF module compilation issue
5d1f51
- Partially address #1479990 - location of man pages
5d1f51
- Enable ppc64(le) support without lua
5d1f51
- Soname versioning for libbpf by ignatenkobrain
5d1f51
5d1f51
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-4
5d1f51
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
5d1f51
5d1f51
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-3
5d1f51
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
5d1f51
5d1f51
* Thu Mar 30 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.3.0-2
5d1f51
- Rebuild for LLVM4
5d1f51
- Trivial fixes in spec
5d1f51
5d1f51
* Fri Mar 10 2017 Rafael Fonseca <rdossant@redhat.com> - 0.3.0-1
5d1f51
- Rebase to new release.
5d1f51
5d1f51
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-3
5d1f51
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
5d1f51
5d1f51
* Tue Jan 10 2017 Rafael Fonseca <rdossant@redhat.com> - 0.2.0-2
5d1f51
- Fix typo
5d1f51
5d1f51
* Tue Nov 29 2016 Rafael Fonseca <rdossant@redhat.com> - 0.2.0-1
5d1f51
- Initial import