Commit 5794642f authored by William Cohen's avatar William Cohen Committed by Brenden Blanco

Eliminate rpmlint errors and allow bcc srpm to build on Fedora koji b… (#815)

* Eliminate rpmlint errors and allow bcc srpm to build on Fedora koji build system

The nightly bcc srpm does not build as-is on Fedora 24. To get the
build to work the following changes were made in the bcc.spec file:

-Specify where to find luajit headers and libraries
-Correctly limit the build to the x86_64 architecture
-Add needed build requires so the srpm can build on Fedora koji
-Run ldconfig so shared library information is updated
-Follow spec conventions by putting %changelog at the end of the spec file

* Further refine the bcc.spec file

Make the following improvements to the gcc.spec file:

-Use local_clang_static variable to allow building with locally installed clang
-Adjust build requires to include nucurses-devel and make
-Put the subpackage descriptions and file list in a more logical order
-Correct the binary rpm dependencies for the subpackages
parent 81f7fb32
%bcond_with local_clang_static
%define debug_package %{nil} %define debug_package %{nil}
Name: bcc Name: bcc
...@@ -10,8 +11,15 @@ License: ASL 2.0 ...@@ -10,8 +11,15 @@ License: ASL 2.0
URL: https://github.com/iovisor/bcc URL: https://github.com/iovisor/bcc
Source0: bcc.tar.gz Source0: bcc.tar.gz
BuildArch: x86_64 ExclusiveArch: x86_64
BuildRequires: bison, cmake >= 2.8.7, flex, gcc, gcc-c++, python2-devel, elfutils-libelf-devel-static BuildRequires: bison cmake >= 2.8.7 flex make
BuildRequires: gcc gcc-c++ python2-devel elfutils-libelf-devel-static
BuildRequires: luajit luajit-devel
%if %{without local_clang_static}
BuildRequires: llvm-devel llvm-static
BuildRequires: clang-devel
%endif
BuildRequires: pkgconfig ncurses-devel
%description %description
Python bindings for BPF Compiler Collection (BCC). Control a BPF program from Python bindings for BPF Compiler Collection (BCC). Control a BPF program from
...@@ -19,13 +27,16 @@ userspace. ...@@ -19,13 +27,16 @@ userspace.
%prep %prep
%setup -n bcc %setup -q -n bcc
%build %build
mkdir build mkdir build
pushd build pushd build
cmake .. -DREVISION_LAST=%{version} -DREVISION=%{version} -DCMAKE_INSTALL_PREFIX=/usr 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
make %{?_smp_mflags} make %{?_smp_mflags}
popd popd
...@@ -33,56 +44,47 @@ popd ...@@ -33,56 +44,47 @@ popd
pushd build pushd build
make install/strip DESTDIR=%{buildroot} make install/strip DESTDIR=%{buildroot}
%changelog
* Mon Apr 04 2016 Vicent Marti <vicent@github.com> - 0.1.4-1
- Add bcc-lua package
* Sun Nov 29 2015 Brenden Blanco <bblanco@plumgrid.com> - 0.1.3-1
- Add bcc-tools package
* Mon Oct 12 2015 Brenden Blanco <bblanco@plumgrid.com> - 0.1.2-1
- Add better version numbering into libbcc.so
* Fri Jul 03 2015 Brenden Blanco <bblanco@plumgrid.com> - 0.1.1-2
- Initial RPM Release
%package -n libbcc %package -n libbcc
Summary: Shared Library for BPF Compiler Collection (BCC) Summary: Shared Library for BPF Compiler Collection (BCC)
Requires: elfutils-libelf Requires: elfutils-libelf
%description -n libbcc %description -n libbcc
Shared Library for BPF Compiler Collection (BCC) Shared Library for BPF Compiler Collection (BCC)
%package -n libbcc-examples
Summary: Examples for BPF Compiler Collection (BCC)
Requires: libbcc
%description -n libbcc-examples
Examples for BPF Compiler Collection (BCC)
%package -n python-bcc %package -n python-bcc
Summary: Python bindings for BPF Compiler Collection (BCC) Summary: Python bindings for BPF Compiler Collection (BCC)
Requires: libbcc 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)
%package -n bcc-tools
Summary: Command line tools for BPF Compiler Collection (BCC)
Requires: python-bcc
%description -n bcc-tools
Command line tools for BPF Compiler Collection (BCC)
%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 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
%files -n python-bcc %package -n libbcc-examples
%{python_sitelib}/bcc* Summary: Examples for BPF Compiler Collection (BCC)
Requires: python-bcc = %{version}-%{release}
Requires: bcc-lua = %{version}-%{release}
%description -n libbcc-examples
Examples for BPF Compiler Collection (BCC)
%package -n bcc-tools
Summary: Command line tools for BPF Compiler Collection (BCC)
Requires: python-bcc = %{version}-%{release}
%description -n bcc-tools
Command line tools for BPF Compiler Collection (BCC)
%files -n libbcc %files -n libbcc
/usr/lib64/* /usr/lib64/*
/usr/include/bcc/* /usr/include/bcc/*
%files -n python-bcc
%{python_sitelib}/bcc*
%files -n bcc-lua
/usr/bin/bcc-lua
%files -n libbcc-examples %files -n libbcc-examples
/usr/share/bcc/examples/* /usr/share/bcc/examples/*
%exclude /usr/share/bcc/examples/*.pyc %exclude /usr/share/bcc/examples/*.pyc
...@@ -96,5 +98,22 @@ Standalone tool to run BCC tracers written in Lua ...@@ -96,5 +98,22 @@ Standalone tool to run BCC tracers written in Lua
/usr/share/bcc/tools/* /usr/share/bcc/tools/*
/usr/share/bcc/man/* /usr/share/bcc/man/*
%files -n bcc-lua %post -n libbcc -p /sbin/ldconfig
/usr/bin/bcc-lua
%postun -n libbcc -p /sbin/ldconfig
%changelog
* Mon Nov 21 2016 William Cohen <wcohen@redhat.com> - 0.2.0-1
- Revise bcc.spec to address rpmlint issues and build properly in Fedora koji.
* Mon Apr 04 2016 Vicent Marti <vicent@github.com> - 0.1.4-1
- Add bcc-lua package
* Sun Nov 29 2015 Brenden Blanco <bblanco@plumgrid.com> - 0.1.3-1
- Add bcc-tools package
* Mon Oct 12 2015 Brenden Blanco <bblanco@plumgrid.com> - 0.1.2-1
- Add better version numbering into libbcc.so
* Fri Jul 03 2015 Brenden Blanco <bblanco@plumgrid.com> - 0.1.1-2
- Initial RPM Release
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