Brenden Blanco | 4fb1860 | 2016-02-19 14:42:22 -0800 | [diff] [blame] | 1 | %define debug_package %{nil} |
| 2 | %define llvmver 3.7.1 |
| 3 | |
| 4 | Name: bcc |
| 5 | Version: @REVISION@ |
| 6 | Release: @GIT_REV_COUNT@ |
| 7 | Summary: BPF Compiler Collection (BCC) |
| 8 | |
| 9 | Group: Development/Languages |
| 10 | License: ASL 2.0 |
| 11 | URL: https://github.com/iovisor/bcc |
| 12 | Source0: https://github.com/iovisor/bcc/archive/v%{version}.tar.gz |
| 13 | Source1: http://llvm.org/releases/%{llvmver}/llvm-%{llvmver}.src.tar.xz |
| 14 | Source2: http://llvm.org/releases/%{llvmver}/cfe-%{llvmver}.src.tar.xz |
| 15 | |
| 16 | BuildArch: x86_64 |
Vicent Marti | 1ad2cef | 2016-04-20 13:24:54 +0200 | [diff] [blame] | 17 | BuildRequires: bison, cmake >= 2.8.7, flex, gcc, gcc-c++, libxml2-devel, python2-devel, elfutils-libelf-devel-static |
Brenden Blanco | 4fb1860 | 2016-02-19 14:42:22 -0800 | [diff] [blame] | 18 | |
| 19 | %description |
| 20 | Python bindings for BPF Compiler Collection (BCC). Control a BPF program from |
| 21 | userspace. |
| 22 | |
| 23 | |
| 24 | %prep |
| 25 | %setup -T -b 1 -n llvm-%{llvmver}.src |
| 26 | mkdir tools/clang |
| 27 | tar -xvvJf %{_sourcedir}/cfe-%{llvmver}.src.tar.xz -C tools/clang --strip 1 |
| 28 | %setup -D -n bcc |
| 29 | |
| 30 | %build |
| 31 | |
| 32 | export LD_LIBRARY_PATH="%{_builddir}/usr/lib64" |
| 33 | export PATH="%{_builddir}/usr/bin":$PATH |
| 34 | |
| 35 | # build llvm |
| 36 | pushd %{_builddir}/llvm-%{llvmver}.src |
| 37 | mkdir build |
| 38 | cd build |
| 39 | cmake .. -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86;BPF" -DCMAKE_INSTALL_PREFIX=/usr |
| 40 | make %{?_smp_mflags} |
| 41 | make install DESTDIR="%{_builddir}" |
| 42 | popd |
| 43 | |
| 44 | mkdir build |
| 45 | pushd build |
| 46 | cmake .. -DREVISION_LAST=%{version} -DREVISION=%{version} -DCMAKE_INSTALL_PREFIX=/usr |
| 47 | make %{?_smp_mflags} |
| 48 | popd |
| 49 | |
| 50 | %install |
| 51 | pushd build |
| 52 | make install/strip DESTDIR=%{buildroot} |
| 53 | |
| 54 | %changelog |
| 55 | * Fri Jul 03 2015 Brenden Blanco <bblanco@plumgrid.com> - 0.1.1-2 |
| 56 | - Initial RPM Release |
| 57 | |
| 58 | %package -n libbcc |
| 59 | Summary: Shared Library for BPF Compiler Collection (BCC) |
Vicent Marti | 11d107c | 2016-04-26 16:34:11 +0200 | [diff] [blame] | 60 | Requires: elfutils-libelf |
Brenden Blanco | 4fb1860 | 2016-02-19 14:42:22 -0800 | [diff] [blame] | 61 | %description -n libbcc |
| 62 | Shared Library for BPF Compiler Collection (BCC) |
| 63 | |
| 64 | %package -n libbcc-examples |
| 65 | Summary: Examples for BPF Compiler Collection (BCC) |
| 66 | Requires: libbcc |
| 67 | %description -n libbcc-examples |
| 68 | Examples for BPF Compiler Collection (BCC) |
| 69 | |
| 70 | %package -n python-bcc |
| 71 | Summary: Python bindings for BPF Compiler Collection (BCC) |
| 72 | Requires: libbcc |
| 73 | %description -n python-bcc |
| 74 | Python bindings for BPF Compiler Collection (BCC) |
| 75 | |
| 76 | %package -n bcc-tools |
| 77 | Summary: Command line tools for BPF Compiler Collection (BCC) |
| 78 | Requires: python-bcc |
| 79 | %description -n bcc-tools |
| 80 | Command line tools for BPF Compiler Collection (BCC) |
| 81 | |
| 82 | %files -n python-bcc |
| 83 | %{python_sitelib}/bcc* |
| 84 | |
| 85 | %files -n libbcc |
| 86 | /usr/lib64/* |
| 87 | /usr/include/bcc/* |
| 88 | |
| 89 | %files -n libbcc-examples |
| 90 | /usr/share/bcc/examples/* |
| 91 | %exclude /usr/share/bcc/examples/*.pyc |
| 92 | %exclude /usr/share/bcc/examples/*.pyo |
| 93 | %exclude /usr/share/bcc/examples/*/*.pyc |
| 94 | %exclude /usr/share/bcc/examples/*/*.pyo |
| 95 | %exclude /usr/share/bcc/examples/*/*/*.pyc |
| 96 | %exclude /usr/share/bcc/examples/*/*/*.pyo |
| 97 | |
| 98 | %files -n bcc-tools |
Martin KaFai Lau | f89cb40 | 2017-10-19 23:52:54 -0700 | [diff] [blame] | 99 | /usr/share/bcc/introspection/* |
Brenden Blanco | 4fb1860 | 2016-02-19 14:42:22 -0800 | [diff] [blame] | 100 | /usr/share/bcc/tools/* |
| 101 | /usr/share/bcc/man/* |