Skip to content

Commit

Permalink
Update rpm build scripts and README
Browse files Browse the repository at this point in the history
Remove the unused Dockerfiles.

Create two flavors of spec files, one which includes steps to build
clang from source and link against it, and one which assumes clang is
already available and just builds bcc. The former is more appropriate
for official packaging, the latter for nightly and quick builds.

Also, introduce a numbering scheme for nightly rpm files. The format
will be:
`libbcc-$latest_git_tag-g$latest_git_hash.x86_64.rpm`
as in:
`libbcc-0.1.7-g73c4d1a.x86_64.rpm`

Update the INSTALL.md to mention the RPMs

Signed-off-by: Brenden Blanco <[email protected]>
  • Loading branch information
Brenden Blanco committed Feb 22, 2016
1 parent db45465 commit 4fb1860
Show file tree
Hide file tree
Showing 17 changed files with 120 additions and 623 deletions.
26 changes: 12 additions & 14 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ Install a 4.3+ kernel from http:https://kernel.ubuntu.com/~kernel-ppa/mainline,
for example:

```bash
VER=4.3.0-040300
VER=4.4.2-040402
PREFIX=http:https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.3-wily/
REL=201511020949
REL=201602171633
wget ${PREFIX}/linux-headers-${VER}-generic_${VER}.${REL}_amd64.deb
wget ${PREFIX}/linux-headers-${VER}_${VER}.${REL}_all.deb
wget ${PREFIX}/linux-image-${VER}-generic_${VER}.${REL}_amd64.deb
Expand All @@ -48,8 +48,8 @@ sudo dpkg -i linux-*${VER}.${REL}*.deb

Update PREFIX to the latest date, and you can browse the files in the PREFIX url to find the REL number.

Tagged bcc binary packages are built for Ubuntu Trusty (14.04) and hosted at
http:https://52.8.15.63/apt/.
Tagged and signed bcc binary packages are built for Ubuntu Trusty (14.04) and
hosted at http:https://52.8.15.63/apt/.

To install:
```bash
Expand All @@ -76,18 +76,18 @@ Install a 4.2+ kernel from
http:https://alt.fedoraproject.org/pub/alt/rawhide-kernel-nodebug, for example:

```bash
sudo wget http:https://alt.fedoraproject.org/pub/alt/rawhide-kernel-nodebug/fedora-rawhide-kernel-nodebug.repo -O /etc/yum.repos.d/fedora-rawhide-kernel-nodebug.repo
sudo dnf install -y kernel-core-4.2.0-1.fc24.x86_64 kernel-4.2.0-1.fc24.x86_64 kernel-devel-4.2.0-1.fc24.x86_64 kernel-modules-4.2.0-1.fc24.x86_64 kernel-headers-4.2.0-1.fc24.x86_64
sudo dnf config-manager --add-repo=http:https://alt.fedoraproject.org/pub/alt/rawhide-kernel-nodebug/fedora-rawhide-kernel-nodebug.repo
sudo dnf update
# reboot
```

Tagged bcc binary packages are built for Fedora 22 and hosted at
http:https://52.8.15.63/yum/.
Nightly bcc binary packages are built for Fedora 23 and 24, hosted at
`http:https://52.8.15.63/yum/nightly/f{23,24}`.

To install:
To install (change 'f23' to 'f24' for rawhide):
```bash
sudo wget http:https://52.8.15.63/yum/main/f22/iovisor.repo -O /etc/yum.repos.d/iovisor.repo
sudo dnf install -y libbcc libbcc-examples python-bcc
echo -e '[iovisor]\nbaseurl=http:https://52.8.15.63/yum/nightly/f23/$basearch\nenabled=1\ngpgcheck=0' | sudo tee /etc/yum.repos.d/iovisor.repo
sudo dnf install bcc-tools
```

## Arch - AUR
Expand Down Expand Up @@ -157,8 +157,6 @@ sudo tar xf clang+llvm-3.7.0-x86_64-fedora22.tar.xz -C /usr/local --strip 1
```
git clone https://github.com/iovisor/bcc.git
mkdir bcc/build; cd bcc/build
# optional
export CC=/usr/local/bin/clang CXX=/usr/local/bin/clang++
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
Expand All @@ -174,7 +172,7 @@ cd llvm/tools; git clone http:https://llvm.org/git/clang.git
cd ..; mkdir -p build/install; cd build
cmake -G "Unix Makefiles" -DLLVM_TARGETS_TO_BUILD="BPF;X86" \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install ..
make -j4
make
make install
export PATH=$PWD/install/bin:$PATH
```
Expand Down
21 changes: 0 additions & 21 deletions SPECS/Dockerfile.el6

This file was deleted.

21 changes: 0 additions & 21 deletions SPECS/Dockerfile.el6.in

This file was deleted.

19 changes: 0 additions & 19 deletions SPECS/Dockerfile.el7

This file was deleted.

19 changes: 0 additions & 19 deletions SPECS/Dockerfile.el7.in

This file was deleted.

20 changes: 0 additions & 20 deletions SPECS/Dockerfile.f22

This file was deleted.

20 changes: 0 additions & 20 deletions SPECS/Dockerfile.f22.in

This file was deleted.

20 changes: 20 additions & 0 deletions SPECS/Dockerfile.fedora
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")

FROM fedora:rawhide

MAINTAINER Brenden Blanco <[email protected]>

RUN dnf -y install bison cmake flex gcc gcc-c++ git libxml2-devel make python2-devel rpm-build wget zlib-devel

WORKDIR /root

RUN wget http:https://llvm.org/releases/3.7.1/{cfe,llvm}-3.7.1.src.tar.xz

RUN tar -xf llvm-3.7.1.src.tar.xz && mkdir llvm-3.7.1.src/tools/clang && tar -xf cfe-3.7.1.src.tar.xz -C llvm-3.7.1.src/tools/clang --strip 1 && mkdir llvm-3.7.1.src/build
RUN cd llvm-3.7.1.src/build && cmake .. -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86;BPF" -DCMAKE_INSTALL_PREFIX=/usr
RUN cd llvm-3.7.1.src/build && make -j8

COPY . bcc
WORKDIR /root/bcc
RUN PATH=/root/llvm-3.7.1.src/build/bin:$PATH ./scripts/build-rpm.sh
43 changes: 30 additions & 13 deletions SPECS/bcc.f22.spec.in → SPECS/bcc+clang.spec
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
%define debug_package %{nil}
%define llvmver 3.7.0
%define llvmver 3.7.1

Name: bcc
Version: @REVISION_LAST@
Release: 1%{?dist}
Version: @REVISION@
Release: @GIT_REV_COUNT@
Summary: BPF Compiler Collection (BCC)

Group: Development/Languages
License: ASL 2.0
URL: https://github.com/iovisor/bcc
Source0: https://github.com/iovisor/bcc/archive/v%{version}.tar.gz
Source1: http:https://llvm.org/releases/3.7.0/llvm-%{llvmver}.src.tar.xz
Source2: http:https://llvm.org/releases/3.7.0/cfe-%{llvmver}.src.tar.xz
Source1: http:https://llvm.org/releases/%{llvmver}/llvm-%{llvmver}.src.tar.xz
Source2: http:https://llvm.org/releases/%{llvmver}/cfe-%{llvmver}.src.tar.xz

BuildArch: x86_64
BuildRequires: bison, cmake >= 2.8.7, flex, gcc, gcc-c++, python2-devel
BuildRequires: bison, cmake >= 2.8.7, flex, gcc, gcc-c++, libxml2-devel, python2-devel

%description
Python bindings for BPF Compiler Collection (BCC). Control a BPF program from
Expand All @@ -25,7 +25,7 @@ userspace.
%setup -T -b 1 -n llvm-%{llvmver}.src
mkdir tools/clang
tar -xvvJf %{_sourcedir}/cfe-%{llvmver}.src.tar.xz -C tools/clang --strip 1
%setup -D -n bcc-%{version}
%setup -D -n bcc

%build

Expand All @@ -36,15 +36,15 @@ export PATH="%{_builddir}/usr/bin":$PATH
pushd %{_builddir}/llvm-%{llvmver}.src
mkdir build
cd build
../configure --disable-assertions --enable-optimized --prefix="%{_builddir}/usr"
make -j`grep -c ^process /proc/cpuinfo`
make install
cmake .. -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86;BPF" -DCMAKE_INSTALL_PREFIX=/usr
make %{?_smp_mflags}
make install DESTDIR="%{_builddir}"
popd

mkdir build
pushd build
cmake .. -DREVISION=%{version} -DCMAKE_INSTALL_PREFIX=/usr
make -j`grep -c ^process /proc/cpuinfo`
cmake .. -DREVISION_LAST=%{version} -DREVISION=%{version} -DCMAKE_INSTALL_PREFIX=/usr
make %{?_smp_mflags}
popd

%install
Expand All @@ -62,21 +62,38 @@ 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
Summary: Python bindings for BPF Compiler Collection (BCC)
Requires: libbcc
%description -n python-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)

%files -n python-bcc
%{python_sitelib}/bcc*
%exclude %{python_sitelib}/*.egg-info

%files -n libbcc
/usr/lib64/*
/usr/include/bcc/*

%files -n libbcc-examples
/usr/share/bcc/examples/*
%exclude /usr/share/bcc/examples/*.pyc
%exclude /usr/share/bcc/examples/*.pyo
%exclude /usr/share/bcc/examples/*/*.pyc
%exclude /usr/share/bcc/examples/*/*.pyo
%exclude /usr/share/bcc/examples/*/*/*.pyc
%exclude /usr/share/bcc/examples/*/*/*.pyo

%files -n bcc-tools
/usr/share/bcc/tools/*
/usr/share/bcc/man/*
Loading

0 comments on commit 4fb1860

Please sign in to comment.