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