Blame bcc.spec

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