Blame SPECS/bcc.spec

5d1f51
# luajit is not available RHEL 8
5d1f51
%bcond_with lua
5d1f51
92c4d9
%bcond_with llvm_static
92c4d9
92c4d9
%if %{without llvm_static}
92c4d9
%global with_llvm_shared 1
92c4d9
%endif
5d1f51
5d1f51
Name:           bcc
69c5f0
Version:        0.19.0
69c5f0
Release:        2%{?dist}
5d1f51
Summary:        BPF Compiler Collection (BCC)
5d1f51
License:        ASL 2.0
5d1f51
URL:            https://github.com/iovisor/bcc
fb561b
# Upstream now provides a release with the git submodule embedded in it
fb561b
Source0:        %{url}/releases/download/v%{version}/%{name}-src-with-submodule.tar.gz
d29dad
#Source0:        %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
fb561b
Patch0:         %{name}-%{version}-Manpages-remove-unstable-statement.patch
69c5f0
Patch1:         %{name}-%{version}-Fix-BPF-src_file-foo.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
92c4d9
BuildRequires:  bison
92c4d9
BuildRequires:  cmake >= 2.8.7
92c4d9
BuildRequires:  flex
92c4d9
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
92c4d9
BuildRequires:  ncurses-devel
92c4d9
%if %{with lua}
92c4d9
BuildRequires:  pkgconfig(luajit)
92c4d9
%endif
92c4d9
BuildRequires:  libbpf-devel >= 0.0.9, libbpf-static >= 0.0.9
5d1f51
5d1f51
Requires:       %{name}-tools = %{version}-%{release}
92c4d9
Requires:       libbpf >= 0.0.9
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}
fb561b
%{?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)
5d1f51
Requires:       python3-%{name} = %{version}-%{release}
5d1f51
Requires:       python3-netaddr
69c5f0
Requires:       tar
69c5f0
Recommends:     kernel-devel
5d1f51
5d1f51
%description tools
5d1f51
Command line tools for BPF Compiler Collection (BCC)
5d1f51
5d1f51
%prep
fb561b
%autosetup -p1 -n %{name}
5d1f51
5d1f51
%build
5d1f51
%cmake . \
5d1f51
        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
92c4d9
        -DREVISION_LAST=%{version} -DREVISION=%{version} -DPYTHON_CMD=python3 \
92c4d9
        -DCMAKE_USE_LIBBPF_PACKAGE:BOOL=TRUE \
92c4d9
        %{?with_llvm_shared:-DENABLE_LLVM_SHARED=1}
5d1f51
%make_build
5d1f51
92c4d9
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
fb561b
%exclude %{_libdir}/lib%{name}*.a
fb561b
%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
009933
%exclude %{_mandir}/man8/bcc-criticalstat.8.gz
009933
# compactsnoop is only supported on x86_64
009933
%ifnarch x86_64
009933
%exclude %{_datadir}/%{name}/tools/compactsnoop
009933
%exclude %{_datadir}/%{name}/tools/doc/compactsnoop_example.txt
009933
%exclude %{_mandir}/man8/bcc-compactsnoop.8.gz
009933
%endif
5d1f51
%{_mandir}/man8/*
5d1f51
5d1f51
%if %{with lua}
5d1f51
%files lua
5d1f51
%{_bindir}/bcc-lua
5d1f51
%endif
5d1f51
5d1f51
5d1f51
%changelog
69c5f0
* Fri Apr 30 2021 Jerome Marchand <jmarchan@redhat.com> - 0.19.0-2
69c5f0
- Fix BPF src_file.
69c5f0
69c5f0
* Tue Apr 27 2021 Jerome Marchand <jmarchan@redhat.com> - 0.19.0-1
69c5f0
- Rebased to version 0.19.0
69c5f0
- Remove hard dependency on kernel-devel
bed121
92c4d9
* Fri Jan 22 2021 Jerome Marchand <jmarchan@redhat.com> - 0.16.0-2
92c4d9
- Build with libbpf package
92c4d9
- spec file cleanups
92c4d9
f0a508
* Mon Oct 26 2020 Jerome Marchand <jmarchan@redhat.com> - 0.16.0-1
f0a508
- Rebase on bcc-0.16.0
f0a508
- Fix IPv6 ports
f0a508
6da96d
* Wed Sep 02 2020 Jerome Marchand <jmarchan@redhat.com> - 0.14.0-4
6da96d
- Fix KFUNC_PROBE return value
6da96d
- Forbid trampolines on unsupported arches
6da96d
a6780e
* Tue Jul 21 2020 Jerome Marchand <jmarchan@redhat.com> - 0.14.0-3
a6780e
- Add KBUILD_MODNAME flag to default cflags
a6780e
009933
* Thu Jun 11 2020 Jerome Marchand <jmarchan@redhat.com> - 0.14.0-2
009933
- Remove criticalstat manpage
009933
- Remove compactsnoop on non x86_64
009933
- Suggest to use --binary in deadlock
009933
- Remove non-existent argument from tcpconnect man page
009933
- Suggest to install the proper kernel-devel version
009933
- Fix dbstat and dbslower
009933
fb561b
* Wed Apr 22 2020 Jerome Marchand <jmarchan@redhat.com> - 0.14.0-1
fb561b
- Rebase on bcc-0.14.0
fb561b
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