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