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
72619e
Name:           bcc
47a11c
Version:        0.4.0
0fdf98
Release:        2%{?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
47a11c
# https://github.com/iovisor/bcc/pull/1426
47a11c
Patch0:         0001-set-SOVERSION-for-bpf-shared.patch
c5127d
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
72619e
BuildRequires:  llvm-devel llvm-static clang-devel
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)
72619e
Requires:       python3-%{name} = %{version}-%{release}
72619e
Requires:       %{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
72619e
BuildArch:      noarch
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 \
47a11c
        -DREVISION_LAST=%{version} -DREVISION=%{version} -DPYTHON_CMD=python3
Igor Gnatenko 5ce4a1
%make_build
c5127d
c5127d
c5127d
%install
c5127d
%make_install
c5127d
c5127d
# Fix python shebangs
dd5e03
for i in `find %{buildroot}%{_datadir}/%{name}/tools/ -type f`; do
47a11c
  sed -i '1s=^#!/usr/bin/\(python\|env python\)[0-9.]*=#!%{__python3}=' $i
c5127d
done
c5127d
dd5e03
for i in `find %{buildroot}%{_datadir}/%{name}/examples/ -type f`; do
47a11c
  sed -i '1s=^#!/usr/bin/\(python\|env python\)[0-9.]*=#!%{__python3}=' $i
47a11c
  sed -i '1s=^#!/usr/bin/env bcc-lua.*=#!/usr/bin/bcc-lua=' $i
c5127d
done
c5127d
47a11c
# Move man pages to the right location
dd5e03
mkdir -p %{buildroot}%{_mandir}
dd5e03
mv %{buildroot}%{_datadir}%{name}/man/* %{buildroot}%{_mandir}/
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
c5127d
%post -p /sbin/ldconfig
c5127d
c5127d
%postun -p /sbin/ldconfig
c5127d
c5127d
c5127d
%files
c5127d
%doc README.md
c5127d
%license LICENSE.txt COPYRIGHT.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
c5127d
%{_datadir}/%{name}/tools/*
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
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