From ef91b6ed64d022baec977a8415581cd1a4a218c5 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Thu, 2 Feb 2017 17:24:32 -0500 Subject: [PATCH] Allow RPMS to be built on ppc64 and aarch64 by making luajit optional Not all architectures have luajit supported. The bcc configure and build were already was set up to make the luajit dependent parts optional. The bcc.spec now makes the luajit dependent parts optional too allowing Fedora 25 builds on ppc64, ppc64le, and aarch64. This change has been tested and allows the resulting srpm to build on the Fedora koji build system for the newly added architectures. Signed-off-by: William Cohen --- SPECS/bcc.spec | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/SPECS/bcc.spec b/SPECS/bcc.spec index 0beadca..836c1ac 100644 --- a/SPECS/bcc.spec +++ b/SPECS/bcc.spec @@ -1,4 +1,10 @@ %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} Name: bcc @@ -11,10 +17,12 @@ License: ASL 2.0 URL: https://github.com/iovisor/bcc Source0: bcc.tar.gz -ExclusiveArch: x86_64 +ExclusiveArch: x86_64 ppc64 aarch64 ppc64le BuildRequires: bison cmake >= 2.8.7 flex make BuildRequires: gcc gcc-c++ python2-devel elfutils-libelf-devel-static +%if %{with_lua} BuildRequires: luajit luajit-devel +%endif %if %{without local_clang_static} BuildRequires: llvm-devel llvm-static BuildRequires: clang-devel @@ -25,6 +33,11 @@ BuildRequires: pkgconfig ncurses-devel Python bindings for BPF Compiler Collection (BCC). Control a BPF program from 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 %setup -q -n bcc @@ -35,8 +48,7 @@ mkdir build pushd build cmake .. -DREVISION_LAST=%{version} -DREVISION=%{version} \ -DCMAKE_INSTALL_PREFIX=/usr \ - -DLUAJIT_INCLUDE_DIR=`pkg-config --variable=includedir luajit` \ - -DLUAJIT_LIBRARIES=`pkg-config --variable=libdir luajit`/lib`pkg-config --variable=libname luajit`.so + %{?lua_config} make %{?_smp_mflags} popd @@ -56,16 +68,20 @@ Requires: libbcc = %{version}-%{release} %description -n python-bcc Python bindings for BPF Compiler Collection (BCC) +%if %{with_lua} %package -n bcc-lua Summary: Standalone tool to run BCC tracers written in Lua Requires: libbcc = %{version}-%{release} %description -n bcc-lua Standalone tool to run BCC tracers written in Lua +%endif %package -n libbcc-examples Summary: Examples for BPF Compiler Collection (BCC) Requires: python-bcc = %{version}-%{release} +%if %{with_lua} Requires: bcc-lua = %{version}-%{release} +%endif %description -n libbcc-examples Examples for BPF Compiler Collection (BCC) @@ -82,8 +98,10 @@ Command line tools for BPF Compiler Collection (BCC) %files -n python-bcc %{python_sitelib}/bcc* +%if %{with_lua} %files -n bcc-lua /usr/bin/bcc-lua +%endif %files -n libbcc-examples /usr/share/bcc/examples/* -- 2.7.4