Skip to content

Commit

Permalink
Add beta RPM spec and docker script for centos
Browse files Browse the repository at this point in the history
Signed-off-by: Brenden Blanco <[email protected]>
  • Loading branch information
Brenden Blanco committed Aug 29, 2015
1 parent ab4ca4c commit 7bdea11
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Dockerfile.centos6
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM centos:6

MAINTAINER Brenden Blanco <[email protected]>

RUN yum -y install @rpm-development-tools @c-development @development-tools cmake libstdc++-static
RUN yum -y install bison bzip2 file flex gcc gcc-c++ git glibc-devel glibc-devel glibc-utils libgcc svn tar texinfo-tex wget zip zlib-devel


WORKDIR /root
RUN svn co svn:https://gcc.gnu.org/svn/gcc/tags/gcc_5_1_0_release/ && cd gcc_5_1_0_release && ./contrib/download_prerequisites
RUN mkdir gcc_5_1_0_release_build && cd gcc_5_1_0_release_build && ../gcc_5_1_0_release/configure --disable-multilib && make -j8 && make install
RUN echo "/usr/local/lib64" > /etc/ld.so.conf.d/usrLocalLib64.conf && ldconfig

RUN wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz && tar zxf Python-2.7.10.tgz && cd Python-2.7.10 && ./configure && make -j8 && make install

RUN git clone https://github.com/llvm-mirror/llvm.git llvm && git clone https://github.com/llvm-mirror/clang.git llvm/tools/clang && mkdir llvm/build

RUN cd llvm/build && cmake .. -DCMAKE_C_COMPILER=/usr/local/bin/gcc -DCMAKE_CXX_COMPILER=/usr/local/bin/g++ -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86;BPF" && make -j$(grep -c ^process /proc/cpuinfo)

COPY ./ /root/bcc/
RUN rm /etc/ld.so.conf.d/usrLocalLib64.conf && ldconfig
#RUN mkdir bcc/build && cd bcc/build && cmake .. -DCMAKE_C_COMPILER=/usr/local/bin/gcc -DCMAKE_CXX_COMPILER=/usr/local/bin/g++ -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=/root/llvm/build && make -j8

RUN yum -y install rpm-build python2-devel
67 changes: 67 additions & 0 deletions SPECS/bcc.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
%define debug_package %{nil}

Name: bcc
Version: @REVISION@
Release: 1%{?dist}
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}.zip

BuildArch: x86_64
BuildRequires: python2-devel, cmake >= 2.8.7

%description
Python bindings for BPF Compiler Collection (BCC). Control a BPF program
from userspace.


%prep
%setup -n bcc-%{version}


%build
mkdir build
cd build
cmake .. -DREVISION=%{version} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_C_COMPILER=/usr/local/bin/gcc -DCMAKE_CXX_COMPILER=/usr/local/bin/g++ -DCMAKE_PREFIX_PATH=/root/llvm/build
make -j8

%install
cd build
make install DESTDIR=%{buildroot}

%changelog
* Fri Jul 03 2015 Brenden Blanco <[email protected]> - 0.1.1-2
- Initial RPM Release

%package -n libbcc
Summary: Shared Library for BPF Compiler Collection (BCC)
%description -n libbcc
Shared Library for BPF Compiler Collection (BCC)

%package -n libbcc-examples
Summary: Examples for BPF Compiler Collection (BCC)
%description -n libbcc-examples
Examples for BPF Compiler Collection (BCC)

%package -n python-bpf
Summary: Python bindings for BPF Compiler Collection (BCC)
%description -n python-bpf
Python bindings for BPF Compiler Collection (BCC)

%files -n python-bpf
%{python_sitelib}/bpf*
%exclude %{python_sitelib}/*.egg-info
/usr/bin/bpf-run

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

%files -n libbcc-examples
/usr/share/bcc/examples/*

#rpmbuild --define "_topdir `pwd`" -ba SPECS/bcc.spec

0 comments on commit 7bdea11

Please sign in to comment.