Commit e1f7462c authored by Brenden Blanco's avatar Brenden Blanco Committed by GitHub

Merge pull request #935 from wcohen/wcohen/lua_opt

Allow RPMS to be built on ppc64 and aarch64 by making luajit optional
parents 4a57f4dd ef91b6ed
%bcond_with local_clang_static %bcond_with local_clang_static
#lua jit not available for some architectures
%ifarch ppc64 aarch64 ppc64le
%{!?with_lua: %global with_lua 0}
%else
%{!?with_lua: %global with_lua 1}
%endif
%define debug_package %{nil} %define debug_package %{nil}
Name: bcc Name: bcc
...@@ -11,10 +17,12 @@ License: ASL 2.0 ...@@ -11,10 +17,12 @@ License: ASL 2.0
URL: https://github.com/iovisor/bcc URL: https://github.com/iovisor/bcc
Source0: bcc.tar.gz Source0: bcc.tar.gz
ExclusiveArch: x86_64 ExclusiveArch: x86_64 ppc64 aarch64 ppc64le
BuildRequires: bison cmake >= 2.8.7 flex make BuildRequires: bison cmake >= 2.8.7 flex make
BuildRequires: gcc gcc-c++ python2-devel elfutils-libelf-devel-static BuildRequires: gcc gcc-c++ python2-devel elfutils-libelf-devel-static
%if %{with_lua}
BuildRequires: luajit luajit-devel BuildRequires: luajit luajit-devel
%endif
%if %{without local_clang_static} %if %{without local_clang_static}
BuildRequires: llvm-devel llvm-static BuildRequires: llvm-devel llvm-static
BuildRequires: clang-devel BuildRequires: clang-devel
...@@ -25,6 +33,11 @@ BuildRequires: pkgconfig ncurses-devel ...@@ -25,6 +33,11 @@ BuildRequires: pkgconfig ncurses-devel
Python bindings for BPF Compiler Collection (BCC). Control a BPF program from Python bindings for BPF Compiler Collection (BCC). Control a BPF program from
userspace. userspace.
%if %{with_lua}
%global lua_include `pkg-config --variable=includedir luajit`
%global lua_libs `pkg-config --variable=libdir luajit`/lib`pkg-config --variable=libname luajit`.so
%global lua_config -DLUAJIT_INCLUDE_DIR=%{lua_include} -DLUAJIT_LIBRARIES=%{lua_libs}
%endif
%prep %prep
%setup -q -n bcc %setup -q -n bcc
...@@ -35,8 +48,7 @@ mkdir build ...@@ -35,8 +48,7 @@ mkdir build
pushd build pushd build
cmake .. -DREVISION_LAST=%{version} -DREVISION=%{version} \ cmake .. -DREVISION_LAST=%{version} -DREVISION=%{version} \
-DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_PREFIX=/usr \
-DLUAJIT_INCLUDE_DIR=`pkg-config --variable=includedir luajit` \ %{?lua_config}
-DLUAJIT_LIBRARIES=`pkg-config --variable=libdir luajit`/lib`pkg-config --variable=libname luajit`.so
make %{?_smp_mflags} make %{?_smp_mflags}
popd popd
...@@ -56,16 +68,20 @@ Requires: libbcc = %{version}-%{release} ...@@ -56,16 +68,20 @@ Requires: libbcc = %{version}-%{release}
%description -n python-bcc %description -n python-bcc
Python bindings for BPF Compiler Collection (BCC) Python bindings for BPF Compiler Collection (BCC)
%if %{with_lua}
%package -n bcc-lua %package -n bcc-lua
Summary: Standalone tool to run BCC tracers written in Lua Summary: Standalone tool to run BCC tracers written in Lua
Requires: libbcc = %{version}-%{release} Requires: libbcc = %{version}-%{release}
%description -n bcc-lua %description -n bcc-lua
Standalone tool to run BCC tracers written in Lua Standalone tool to run BCC tracers written in Lua
%endif
%package -n libbcc-examples %package -n libbcc-examples
Summary: Examples for BPF Compiler Collection (BCC) Summary: Examples for BPF Compiler Collection (BCC)
Requires: python-bcc = %{version}-%{release} Requires: python-bcc = %{version}-%{release}
%if %{with_lua}
Requires: bcc-lua = %{version}-%{release} Requires: bcc-lua = %{version}-%{release}
%endif
%description -n libbcc-examples %description -n libbcc-examples
Examples for BPF Compiler Collection (BCC) Examples for BPF Compiler Collection (BCC)
...@@ -82,8 +98,10 @@ Command line tools for BPF Compiler Collection (BCC) ...@@ -82,8 +98,10 @@ Command line tools for BPF Compiler Collection (BCC)
%files -n python-bcc %files -n python-bcc
%{python_sitelib}/bcc* %{python_sitelib}/bcc*
%if %{with_lua}
%files -n bcc-lua %files -n bcc-lua
/usr/bin/bcc-lua /usr/bin/bcc-lua
%endif
%files -n libbcc-examples %files -n libbcc-examples
/usr/share/bcc/examples/* /usr/share/bcc/examples/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment