Blame SPECS/bcc.spec

33c334
# luajit is not available RHEL 8
33c334
%bcond_with lua
33c334
33c334
%bcond_without llvm_static
33c334
33c334
Name:           bcc
33c334
Version:        0.7.0
33c334
Release:        5%{?dist}
33c334
Summary:        BPF Compiler Collection (BCC)
33c334
License:        ASL 2.0
33c334
URL:            https://github.com/iovisor/bcc
33c334
Source0:        %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
33c334
Patch0:         uflow-str-bytes.patch
33c334
Patch1:         fix-killsnoop.py-srr-bytes-type-error-2007.patch
33c334
Patch2:         Tools-fixes-2009.patch
33c334
Patch3:         Bytes-string-encoding-2004.patch
33c334
Patch4:         covscan-fix-miscellaneaous-errors-2003.patch
33c334
Patch5:         tools-prepare-block-tools-for-the-removing-of-legacy.patch
33c334
Patch6:         biolatency-Fix-disks-bpf_probe_read-1980.patch
33c334
Patch7:         manpage-remove-non-existent-p-option-from-the-biotop.patch
33c334
# tests/cc doesn't compile on s390x, so disable it until we have a better fix
33c334
Patch10:        Disable-tests-cc.patch
33c334
33c334
# Arches will be included as upstream support is added and dependencies are
33c334
# satisfied in the respective arches
33c334
ExcludeArch: i686
33c334
33c334
BuildRequires:  bison, cmake >= 2.8.7, flex, libxml2-devel
33c334
BuildRequires:  python3-devel
33c334
BuildRequires:  elfutils-libelf-devel
33c334
BuildRequires:  llvm-devel
33c334
BuildRequires:  clang-devel
33c334
BuildRequires:  ncurses-devel
33c334
%if %{with lua}
33c334
BuildRequires: pkgconfig(luajit)
33c334
%endif
33c334
%if %{with llvm_static}
33c334
BuildRequires:  llvm-static
33c334
%endif
33c334
33c334
BuildRequires: clang
33c334
33c334
Requires:       %{name}-tools = %{version}-%{release}
33c334
33c334
%description
33c334
BCC is a toolkit for creating efficient kernel tracing and manipulation
33c334
programs, and includes several useful tools and examples. It makes use of
33c334
extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
33c334
that was first added to Linux 3.15. BCC makes BPF programs easier to write,
33c334
with kernel instrumentation in C (and includes a C wrapper around LLVM), and
33c334
front-ends in Python and lua. It is suited for many tasks, including
33c334
performance analysis and network traffic control.
33c334
33c334
33c334
%package devel
33c334
Summary:        Shared library for BPF Compiler Collection (BCC)
33c334
Requires:       %{name}%{?_isa} = %{version}-%{release}
33c334
33c334
%description devel
33c334
The %{name}-devel package contains libraries and header files for developing
33c334
application that use BPF Compiler Collection (BCC).
33c334
33c334
33c334
%package doc
33c334
Summary:        Examples for BPF Compiler Collection (BCC)
33c334
Recommends:     python3-%{name} = %{version}-%{release}
33c334
%if %{with lua}
33c334
Recommends:     %{name}-lua = %{version}-%{release}
33c334
%endif
33c334
BuildArch:      noarch
33c334
33c334
%description doc
33c334
Examples for BPF Compiler Collection (BCC)
33c334
33c334
33c334
%package -n python3-%{name}
33c334
Summary:        Python3 bindings for BPF Compiler Collection (BCC)
33c334
Requires:       %{name}%{?_isa} = %{version}-%{release}
33c334
%{?python_provide:%python_provide python3-%{srcname}}
33c334
33c334
%description -n python3-%{name}
33c334
Python3 bindings for BPF Compiler Collection (BCC)
33c334
33c334
33c334
%if %{with lua}
33c334
%package lua
33c334
Summary:        Standalone tool to run BCC tracers written in Lua
33c334
Requires:       %{name}%{?_isa} = %{version}-%{release}
33c334
33c334
%description lua
33c334
Standalone tool to run BCC tracers written in Lua
33c334
%endif
33c334
33c334
33c334
%package tools
33c334
Summary:        Command line tools for BPF Compiler Collection (BCC)
33c334
Requires:       python3-%{name} = %{version}-%{release}
33c334
Requires:       python3-netaddr
33c334
Requires:       kernel-devel
33c334
33c334
%description tools
33c334
Command line tools for BPF Compiler Collection (BCC)
33c334
33c334
%prep
33c334
%setup
33c334
33c334
%patch0 -p1
33c334
%patch1 -p1
33c334
%patch2 -p1
33c334
%patch3 -p1
33c334
%patch4 -p1
33c334
%patch5 -p1
33c334
%patch6 -p1
33c334
%patch7 -p1
33c334
33c334
%ifarch s390x
33c334
%patch10 -p1
33c334
%endif
33c334
33c334
%build
33c334
%cmake . \
33c334
        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
33c334
        -DREVISION_LAST=%{version} -DREVISION=%{version} -DPYTHON_CMD=python3
33c334
%make_build
33c334
33c334
%install
33c334
%make_install
33c334
33c334
# Fix python shebangs
33c334
# This messes the timestamp and rpmdiff complains about it
33c334
# Let's set the all thing according to a reference file
33c334
touch -r %{buildroot}%{_datadir}/%{name}/examples/hello_world.py %{_tmppath}/timestamp
33c334
33c334
find %{buildroot}%{_datadir}/%{name}/{tools,examples} -type f -exec \
33c334
  sed -i -e '1s=^#!/usr/bin/python\([0-9.]\+\)\?$=#!%{__python3}=' \
33c334
         -e '1s=^#!/usr/bin/env python\([0-9.]\+\)\?$=#!%{__python3}=' \
33c334
         -e '1s=^#!/usr/bin/env bcc-lua$=#!/usr/bin/bcc-lua=' {} \;
33c334
33c334
for i in `find %{buildroot}%{_datadir}/%{name}/examples/` ; do
33c334
    touch -h -r %{_tmppath}/timestamp $i
33c334
done
33c334
33c334
# Move man pages to the right location
33c334
mkdir -p %{buildroot}%{_mandir}
33c334
mv %{buildroot}%{_datadir}/%{name}/man/* %{buildroot}%{_mandir}/
33c334
# Avoid conflict with other manpages
33c334
# https://bugzilla.redhat.com/show_bug.cgi?id=1517408
33c334
for i in `find %{buildroot}%{_mandir} -name "*.gz"`; do
33c334
  tname=$(basename $i)
33c334
  rename $tname %{name}-$tname $i
33c334
done
33c334
# Fix the symlink too
33c334
for i in `find %{buildroot}%{_mandir} -lname \*.gz` ; do
33c334
    target=`readlink $i`;
33c334
    ln -sf bcc-$target $i;
33c334
done
33c334
33c334
# We cannot run the test suit since it requires root and it makes changes to
33c334
# the machine (e.g, IP address)
33c334
#%check
33c334
33c334
%ldconfig_scriptlets
33c334
33c334
%files
33c334
%doc README.md
33c334
%license LICENSE.txt
33c334
%{_libdir}/lib%{name}.so.*
33c334
%{_libdir}/libbpf.so.*
33c334
33c334
%files devel
33c334
%{_libdir}/lib%{name}.so
33c334
%{_libdir}/libbpf.so
33c334
%{_libdir}/pkgconfig/lib%{name}.pc
33c334
%{_includedir}/%{name}/
33c334
33c334
%files -n python3-%{name}
33c334
%{python3_sitelib}/%{name}*
33c334
33c334
%files doc
33c334
# % dir % {_docdir}/% {name}
33c334
%doc %{_datadir}/%{name}/examples/
33c334
%if %{without lua}
33c334
%exclude %{_datadir}/%{name}/examples/lua
33c334
%endif
33c334
33c334
%files tools
33c334
%dir %{_datadir}/%{name}
33c334
%dir %{_datadir}/%{name}/tools
33c334
%dir %{_datadir}/%{name}/introspection
33c334
%{_datadir}/%{name}/tools/*
33c334
%{_datadir}/%{name}/introspection/*
33c334
%exclude %{_datadir}/%{name}/tools/old/
33c334
# inject relies on BPF_KPROBE_OVERRIDE which is not set on RHEL 8
33c334
%exclude %{_datadir}/%{name}/tools/inject
33c334
# Neither btrfs nor zfs are available on RHEL8
33c334
%exclude %{_datadir}/%{name}/tools/btrfs*
33c334
%exclude %{_datadir}/%{name}/tools/zfs*
33c334
%{_mandir}/man8/*
33c334
33c334
%if %{with lua}
33c334
%files lua
33c334
%{_bindir}/bcc-lua
33c334
%endif
33c334
33c334
33c334
%changelog
33c334
* Thu Dec 13 2018 Jerome Marchand <jmarchan@redhat.com> - 0.7.0-5
33c334
- Fix biolatency -D
33c334
- Fix biotop manpage
33c334
- Rebuild for LLVM 7.0.1 (from Tom Stellard)
33c334
33c334
* Mon Dec 10 2018 Jerome Marchand <jmarchan@redhat.com> - 0.7.0-4
33c334
- Fix bio* tools
33c334
33c334
* Mon Nov 05 2018 Jerome Marchand <jmarchan@redhat.com> - 0.7.0-3
33c334
- Fix multiple bytes/string encoding issues
33c334
- Fix misc covscan warning
33c334
33c334
* Mon Oct 15 2018 Tom Stellard <tstellar@redhat.com> - 0.7.0-2
33c334
- Drop explicit dependency on clang-libs
33c334
33c334
* Fri Oct 12 2018 Jerome Marchand <jmarchan@redhat.com> - 0.7.0-1
33c334
- Rebase on bcc-7.0.0
33c334
- Remove useless tools (zfs*, btrfs* and inject) 
33c334
33c334
* Thu Sep 20 2018 Jerome Marchand <jmarchan@redhat.com> - 0.6.1-1
33c334
- Rebase on bcc-0.6.1
33c334
33c334
* Thu Sep 20 2018 Jerome Marchand <jmarchan@redhat.com> - 0.6.0-6
33c334
- llcstat: print a nicer error message on virtual machine
33c334
- Add NSS support to sslsniff
33c334
- Fixes miscellaneous error uncovered by covscan
33c334
33c334
* Wed Aug 08 2018 Tom Stellard <tstellar@redhat.com> - 0.6.0-5
33c334
- Use llvm-toolset-6.0 prefix for clang-libs dependency
33c334
33c334
* Fri Aug 03 2018 Tom Stellard <tstellar@redhat.com> - 0.6.0-4
33c334
- Rebuld for llvm-toolset-6.0
33c334
33c334
* Wed Jul 18 2018 Jerome Marchand <jmarchan@redhat.com> - 0.6.0-3
33c334
 - Disable lua on all arches
33c334
33c334
* Tue Jun 26 2018 Jerome Marchand <jmarchan@redhat.com> - 0.6.0-2
33c334
- Add clang-libs requirement
33c334
- Fix manpages symlinks
33c334
33c334
* Tue Jun 19 2018 Jerome Marchand <jmarchan@redhat.com> - 0.6.0-1
33c334
- Rebase on bcc-0.6.0
33c334
33c334
* Thu May 24 2018 Jerome Marchand <jmarchan@redhat.com> - 0.5.0-5
33c334
- Enables build on ppc64(le) and s390x arches
33c334
33c334
* Thu Apr 05 2018 Rafael Santos <rdossant@redhat.com> - 0.5.0-4
33c334
- Resolves #1555627 - fix compilation error with latest llvm/clang
33c334
33c334
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-3
33c334
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
33c334
33c334
* Fri Feb 02 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.5.0-2
33c334
- Switch to %%ldconfig_scriptlets
33c334
33c334
* Wed Jan 03 2018 Rafael Santos <rdossant@redhat.com> - 0.5.0-1
33c334
- Rebase to new released version
33c334
33c334
* Thu Nov 16 2017 Rafael Santos <rdossant@redhat.com> - 0.4.0-4
33c334
- Resolves #1517408 - avoid conflict with other manpages
33c334
33c334
* Thu Nov 02 2017 Rafael Santos <rdossant@redhat.com> - 0.4.0-3
33c334
- Use weak deps to not require lua subpkg on ppc64(le)
33c334
33c334
* Wed Nov 01 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.4.0-2
33c334
- Rebuild for LLVM5
33c334
33c334
* Wed Nov 01 2017 Rafael Fonseca <rdossant@redhat.com> - 0.4.0-1
33c334
- Resolves #1460482 - rebase to new release
33c334
- Resolves #1505506 - add support for LLVM 5.0
33c334
- Resolves #1460482 - BPF module compilation issue
33c334
- Partially address #1479990 - location of man pages
33c334
- Enable ppc64(le) support without lua
33c334
- Soname versioning for libbpf by ignatenkobrain
33c334
33c334
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-4
33c334
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
33c334
33c334
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-3
33c334
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
33c334
33c334
* Thu Mar 30 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.3.0-2
33c334
- Rebuild for LLVM4
33c334
- Trivial fixes in spec
33c334
33c334
* Fri Mar 10 2017 Rafael Fonseca <rdossant@redhat.com> - 0.3.0-1
33c334
- Rebase to new release.
33c334
33c334
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-3
33c334
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
33c334
33c334
* Tue Jan 10 2017 Rafael Fonseca <rdossant@redhat.com> - 0.2.0-2
33c334
- Fix typo
33c334
33c334
* Tue Nov 29 2016 Rafael Fonseca <rdossant@redhat.com> - 0.2.0-1
33c334
- Initial import