47a11ce
# luajit is not available for some architectures
47a11ce
%ifarch ppc64 ppc64le
59c0211
%bcond_with lua
47a11ce
%else
59c0211
%bcond_without lua
47a11ce
%endif
47a11ce
1b1b2ec
%bcond_without llvm_static
1b1b2ec
72619e0
Name:           bcc
1b1b2ec
Version:        0.6.1
1b1b2ec
Release:        1%{?dist}
72619e0
Summary:        BPF Compiler Collection (BCC)
72619e0
License:        ASL 2.0
72619e0
URL:            https://github.com/iovisor/bcc
72619e0
Source0:        %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
c5127da
c5127da
# Arches will be included as upstream support is added and dependencies are
c5127da
# satisfied in the respective arches
d4390b5
ExclusiveArch:  x86_64 %{power64}
c5127da
72619e0
BuildRequires:  bison, cmake >= 2.8.7, flex, libxml2-devel
72619e0
BuildRequires:  python3-devel
47a11ce
BuildRequires:  elfutils-libelf-devel
1b1b2ec
BuildRequires:  llvm-devel clang-devel
1b1b2ec
%if %{with llvm_static}
1b1b2ec
BuildRequires: llvm-static
1b1b2ec
%endif
72619e0
BuildRequires:  ncurses-devel
59c0211
%if %{with lua}
47a11ce
BuildRequires: pkgconfig(luajit)
47a11ce
%endif
c5127da
72619e0
Requires:       %{name}-tools = %{version}-%{release}
c5127da
c5127da
%description
c5127da
BCC is a toolkit for creating efficient kernel tracing and manipulation
c5127da
programs, and includes several useful tools and examples. It makes use of
c5127da
extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
c5127da
that was first added to Linux 3.15. BCC makes BPF programs easier to write,
c5127da
with kernel instrumentation in C (and includes a C wrapper around LLVM), and
c5127da
front-ends in Python and lua. It is suited for many tasks, including
c5127da
performance analysis and network traffic control.
c5127da
c5127da
c5127da
%package devel
72619e0
Summary:        Shared library for BPF Compiler Collection (BCC)
72619e0
Requires:       %{name}%{?_isa} = %{version}-%{release}
c5127da
c5127da
%description devel
c5127da
The %{name}-devel package contains libraries and header files for developing
c5127da
application that use BPF Compiler Collection (BCC).
c5127da
c5127da
c5127da
%package doc
72619e0
Summary:        Examples for BPF Compiler Collection (BCC)
268f16b
Recommends:     python3-%{name} = %{version}-%{release}
268f16b
Recommends:     %{name}-lua = %{version}-%{release}
72619e0
BuildArch:      noarch
c5127da
c5127da
%description doc
c5127da
Examples for BPF Compiler Collection (BCC)
c5127da
c5127da
c5127da
%package -n python3-%{name}
72619e0
Summary:        Python3 bindings for BPF Compiler Collection (BCC)
72619e0
Requires:       %{name}%{?_isa} = %{version}-%{release}
c5127da
%{?python_provide:%python_provide python3-%{srcname}}
c5127da
c5127da
%description -n python3-%{name}
c5127da
Python3 bindings for BPF Compiler Collection (BCC)
c5127da
c5127da
59c0211
%if %{with lua}
c5127da
%package lua
72619e0
Summary:        Standalone tool to run BCC tracers written in Lua
72619e0
Requires:       %{name}%{?_isa} = %{version}-%{release}
c5127da
c5127da
%description lua
c5127da
Standalone tool to run BCC tracers written in Lua
47a11ce
%endif
c5127da
0734d68
c5127da
%package tools
72619e0
Summary:        Command line tools for BPF Compiler Collection (BCC)
72619e0
Requires:       python3-%{name} = %{version}-%{release}
72619e0
Requires:       python3-netaddr
47a11ce
Requires:       kernel-devel
c5127da
c5127da
%description tools
c5127da
Command line tools for BPF Compiler Collection (BCC)
c5127da
0734d68
c5127da
%prep
c5127da
%autosetup -p1
c5127da
c5127da
c5127da
%build
47a11ce
%cmake . \
8f89be5
        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
1b1b2ec
        -DREVISION_LAST=%{version} -DREVISION=%{version} -DPYTHON_CMD=python3 \
1b1b2ec
        %{?with_llvm_shared:-DENABLE_LLVM_SHARED=1}
Igor Gnatenko 5ce4a19
%make_build
c5127da
c5127da
c5127da
%install
c5127da
%make_install
c5127da
c5127da
# Fix python shebangs
1b1b2ec
find %{buildroot}%{_datadir}/%{name}/{tools,examples} -type f -exec \
1b1b2ec
  sed -i -e '1s=^#!/usr/bin/python\([0-9.]\+\)\?$=#!%{__python3}=' \
1b1b2ec
         -e '1s=^#!/usr/bin/env python\([0-9.]\+\)\?$=#!%{__python3}' \
1b1b2ec
         -e '1s=^#!/usr/bin/env bcc-lua$=#!/usr/bin/bcc-lua=' {} \;
c5127da
47a11ce
# Move man pages to the right location
dd5e038
mkdir -p %{buildroot}%{_mandir}
ef3ab8c
mv %{buildroot}%{_datadir}/%{name}/man/* %{buildroot}%{_mandir}/
ce055d3
# Avoid conflict with other manpages
ce055d3
# https://bugzilla.redhat.com/show_bug.cgi?id=1517408
1b1b2ec
for i in `find %{buildroot}%{_mandir} -name "*.gz"`; do
ce055d3
  tname=$(basename $i)
ce055d3
  rename $tname %{name}-$tname $i
ce055d3
done
dd5e038
mkdir -p %{buildroot}%{_docdir}/%{name}
dd5e038
mv %{buildroot}%{_datadir}/%{name}/examples %{buildroot}%{_docdir}/%{name}/
c5127da
c5127da
# We cannot run the test suit since it requires root and it makes changes to
c5127da
# the machine (e.g, IP address)
c5127da
#%check
c5127da
4cd4cb4
%ldconfig_scriptlets
c5127da
c5127da
%files
c5127da
%doc README.md
1b1b2ec
%license LICENSE.txt
c5127da
%{_libdir}/lib%{name}.so.*
47a11ce
%{_libdir}/libbpf.so.*
c5127da
c5127da
%files devel
c5127da
%{_libdir}/lib%{name}.so
47a11ce
%{_libdir}/libbpf.so
c5127da
%{_libdir}/pkgconfig/lib%{name}.pc
Igor Gnatenko 5ce4a19
%{_includedir}/%{name}/
c5127da
c5127da
%files -n python3-%{name}
c5127da
%{python3_sitelib}/%{name}*
c5127da
c5127da
%files doc
47a11ce
%dir %{_docdir}/%{name}
47a11ce
%doc %{_docdir}/%{name}/examples/
c5127da
c5127da
%files tools
c5127da
%dir %{_datadir}/%{name}
c5127da
%dir %{_datadir}/%{name}/tools
fa03a59
%dir %{_datadir}/%{name}/introspection
c5127da
%{_datadir}/%{name}/tools/*
fa03a59
%{_datadir}/%{name}/introspection/*
c5127da
%exclude %{_datadir}/%{name}/tools/old/
47a11ce
%{_mandir}/man8/*
c5127da
59c0211
%if %{with lua}
c5127da
%files lua
c5127da
%{_bindir}/bcc-lua
47a11ce
%endif
c5127da
c5127da
c5127da
%changelog
1b1b2ec
* Thu Aug 16 2018 Rafael Fonseca <r4f4rfs@gmail.com> - 0.6.1-1
1b1b2ec
- Rebase to new released version (#1609485)
1b1b2ec
1e75eee
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-3
1e75eee
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
1e75eee
66d2aa7
* Tue Jun 19 2018 Miro HronĨok <mhroncok@redhat.com> - 0.6.0-2
66d2aa7
- Rebuilt for Python 3.7
66d2aa7
00b8438
* Mon Jun 18 2018 Rafael dos Santos <rdossant@redhat.com> - 0.6.0-1
00b8438
- Rebase to new released version (#1591989)
00b8438
e63764f
* Thu Apr 05 2018 Rafael Santos <rdossant@redhat.com> - 0.5.0-4
e63764f
- Resolves #1555627 - fix compilation error with latest llvm/clang
e63764f
1ea1557
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-3
1ea1557
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
1ea1557
4cd4cb4
* Fri Feb 02 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.5.0-2
4cd4cb4
- Switch to %%ldconfig_scriptlets
4cd4cb4
fa03a59
* Wed Jan 03 2018 Rafael Santos <rdossant@redhat.com> - 0.5.0-1
fa03a59
- Rebase to new released version
fa03a59
ce055d3
* Thu Nov 16 2017 Rafael Santos <rdossant@redhat.com> - 0.4.0-4
ce055d3
- Resolves #1517408 - avoid conflict with other manpages
ce055d3
268f16b
* Thu Nov 02 2017 Rafael Santos <rdossant@redhat.com> - 0.4.0-3
268f16b
- Use weak deps to not require lua subpkg on ppc64(le)
268f16b
0fdf98e
* Wed Nov 01 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.4.0-2
0fdf98e
- Rebuild for LLVM5
0fdf98e
47a11ce
* Wed Nov 01 2017 Rafael Fonseca <rdossant@redhat.com> - 0.4.0-1
47a11ce
- Resolves #1460482 - rebase to new release
47a11ce
- Resolves #1505506 - add support for LLVM 5.0
47a11ce
- Resolves #1460482 - BPF module compilation issue
47a11ce
- Partially address #1479990 - location of man pages
47a11ce
- Enable ppc64(le) support without lua
47a11ce
- Soname versioning for libbpf by ignatenkobrain
47a11ce
94635fa
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-4
94635fa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
94635fa
e45c818
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-3
e45c818
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
e45c818
Igor Gnatenko 5ce4a19
* Thu Mar 30 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.3.0-2
Igor Gnatenko 5ce4a19
- Rebuild for LLVM4
Igor Gnatenko 5ce4a19
- Trivial fixes in spec
Igor Gnatenko 5ce4a19
0734d68
* Fri Mar 10 2017 Rafael Fonseca <rdossant@redhat.com> - 0.3.0-1
0734d68
- Rebase to new release.
0734d68
cf8b71f
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-3
cf8b71f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
cf8b71f
1f36ce9
* Tue Jan 10 2017 Rafael Fonseca <rdossant@redhat.com> - 0.2.0-2
1f36ce9
- Fix typo
1f36ce9
c5127da
* Tue Nov 29 2016 Rafael Fonseca <rdossant@redhat.com> - 0.2.0-1
c5127da
- Initial import