Skip to content

Commit 49408b4

Browse files
author
4ast
committed
Merge pull request iovisor#173 from iovisor/bblanco_dev
Add RPM packaging for el6,el7,fedora22
2 parents f52dc88 + 3965a36 commit 49408b4

16 files changed

+644
-58
lines changed

Dockerfile.centos6

-24
This file was deleted.

Dockerfile.fedora

-21
This file was deleted.

SPECS/Dockerfile.el6

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) PLUMgrid, Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License")
3+
4+
FROM centos:6
5+
6+
MAINTAINER Brenden Blanco <[email protected]>
7+
8+
RUN yum -y install bison cmake flex gcc gcc-c++ git glibc-devel glibc-utils python2-devel rpm-build svn tar texinfo-tex wget zip zlib-devel
9+
10+
WORKDIR /root
11+
RUN mkdir -p {BUILD,RPMS,SOURCES,SPECS,SRPMS}
12+
RUN cd SOURCES && wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
13+
RUN cd SOURCES && wget https://ftp.gnu.org/gnu/gcc/gcc-5.1.0/gcc-5.1.0.tar.gz
14+
RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/llvm-3.7.0rc3.src.tar.xz
15+
RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/cfe-3.7.0rc3.src.tar.xz
16+
RUN cd SOURCES && wget https://github.com/iovisor/bcc/archive/v0.1.5.tar.gz
17+
18+
RUN cd SPECS && wget https://raw.githubusercontent.com/iovisor/bcc/v0.1.5/SPECS/bcc.el6.spec
19+
#COPY SPECS/bcc.el6.spec SPECS/
20+
21+
RUN rpmbuild --define "_topdir `pwd`" -ba SPECS/bcc.el6.spec

SPECS/Dockerfile.el6.in

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) PLUMgrid, Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License")
3+
4+
FROM centos:6
5+
6+
MAINTAINER Brenden Blanco <[email protected]>
7+
8+
RUN yum -y install bison cmake flex gcc gcc-c++ git glibc-devel glibc-utils python2-devel rpm-build svn tar texinfo-tex wget zip zlib-devel
9+
10+
WORKDIR /root
11+
RUN mkdir -p {BUILD,RPMS,SOURCES,SPECS,SRPMS}
12+
RUN cd SOURCES && wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
13+
RUN cd SOURCES && wget https://ftp.gnu.org/gnu/gcc/gcc-5.1.0/gcc-5.1.0.tar.gz
14+
RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/llvm-3.7.0rc3.src.tar.xz
15+
RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/cfe-3.7.0rc3.src.tar.xz
16+
RUN cd SOURCES && wget https://github.com/iovisor/bcc/archive/v@[email protected]
17+
18+
RUN cd SPECS && wget https://raw.githubusercontent.com/iovisor/bcc/v@REVISION_LAST@/SPECS/bcc.el6.spec
19+
#COPY SPECS/bcc.el6.spec SPECS/
20+
21+
RUN rpmbuild --define "_topdir `pwd`" -ba SPECS/bcc.el6.spec

SPECS/Dockerfile.el7

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright (c) PLUMgrid, Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License")
3+
4+
FROM centos:7
5+
6+
MAINTAINER Brenden Blanco <[email protected]>
7+
8+
RUN yum -y install bison cmake flex gcc gcc-c++ make python2-devel rpm-build wget zlib-devel
9+
10+
WORKDIR /root
11+
RUN mkdir -p {BUILD,RPMS,SOURCES,SPECS,SRPMS}
12+
RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/llvm-3.7.0rc3.src.tar.xz
13+
RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/cfe-3.7.0rc3.src.tar.xz
14+
RUN cd SOURCES && wget https://github.com/iovisor/bcc/archive/v0.1.5.tar.gz
15+
16+
RUN cd SPECS && wget https://raw.githubusercontent.com/iovisor/bcc/v0.1.5/SPECS/bcc.el7.spec
17+
#COPY SPECS/bcc.el7.spec SPECS/
18+
19+
RUN rpmbuild --define "_topdir `pwd`" -ba SPECS/bcc.el7.spec

SPECS/Dockerfile.el7.in

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright (c) PLUMgrid, Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License")
3+
4+
FROM centos:7
5+
6+
MAINTAINER Brenden Blanco <[email protected]>
7+
8+
RUN yum -y install bison cmake flex gcc gcc-c++ make python2-devel rpm-build wget zlib-devel
9+
10+
WORKDIR /root
11+
RUN mkdir -p {BUILD,RPMS,SOURCES,SPECS,SRPMS}
12+
RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/llvm-3.7.0rc3.src.tar.xz
13+
RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/cfe-3.7.0rc3.src.tar.xz
14+
RUN cd SOURCES && wget https://github.com/iovisor/bcc/archive/v@[email protected]
15+
16+
RUN cd SPECS && wget https://raw.githubusercontent.com/iovisor/bcc/v@REVISION_LAST@/SPECS/bcc.el7.spec
17+
#COPY SPECS/bcc.el7.spec SPECS/
18+
19+
RUN rpmbuild --define "_topdir `pwd`" -ba SPECS/bcc.el7.spec

SPECS/Dockerfile.f22

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) PLUMgrid, Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License")
3+
4+
FROM fedora:22
5+
6+
MAINTAINER Brenden Blanco <[email protected]>
7+
8+
RUN dnf -y install bison cmake flex gcc gcc-c++ libstdc++-static make python2-devel rpm-build wget zlib-devel
9+
10+
WORKDIR /root
11+
RUN mkdir -p {BUILD,RPMS,SOURCES,SPECS,SRPMS}
12+
13+
RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/llvm-3.7.0rc3.src.tar.xz
14+
RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/cfe-3.7.0rc3.src.tar.xz
15+
RUN cd SOURCES && wget https://github.com/iovisor/bcc/archive/v0.1.5.tar.gz
16+
17+
RUN cd SPECS && wget https://raw.githubusercontent.com/iovisor/bcc/v0.1.5/SPECS/bcc.f22.spec
18+
#COPY SPECS/bcc.f22.spec SPECS/
19+
20+
RUN rpmbuild --define "_topdir `pwd`" -ba SPECS/bcc.f22.spec

SPECS/Dockerfile.f22.in

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) PLUMgrid, Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License")
3+
4+
FROM fedora:22
5+
6+
MAINTAINER Brenden Blanco <[email protected]>
7+
8+
RUN dnf -y install bison cmake flex gcc gcc-c++ libstdc++-static make python2-devel rpm-build wget zlib-devel
9+
10+
WORKDIR /root
11+
RUN mkdir -p {BUILD,RPMS,SOURCES,SPECS,SRPMS}
12+
13+
RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/llvm-3.7.0rc3.src.tar.xz
14+
RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/cfe-3.7.0rc3.src.tar.xz
15+
RUN cd SOURCES && wget https://github.com/iovisor/bcc/archive/v@[email protected]
16+
17+
RUN cd SPECS && wget https://raw.githubusercontent.com/iovisor/bcc/v@REVISION_LAST@/SPECS/bcc.f22.spec
18+
#COPY SPECS/bcc.f22.spec SPECS/
19+
20+
RUN rpmbuild --define "_topdir `pwd`" -ba SPECS/bcc.f22.spec

SPECS/bcc.el6.spec

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Copyright (c) PLUMgrid, Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License")
3+
4+
%define debug_package %{nil}
5+
%define llvmver 3.7.0rc3
6+
%define gccver 5.1.0
7+
%define pythonver 2.7.10
8+
9+
Name: bcc
10+
Version: 0.1.5
11+
Release: 1%{?dist}
12+
Summary: BPF Compiler Collection (BCC)
13+
14+
Group: Development/Languages
15+
License: ASL 2.0
16+
URL: https://github.com/iovisor/bcc
17+
Source0: https://github.com/iovisor/bcc/archive/v%{version}.tar.gz
18+
Source1: https://ftp.gnu.org/gnu/gcc/gcc-%{gccver}/gcc-%{gccver}.tar.gz
19+
Source2: https://www.python.org/ftp/python/%{pythonver}/Python-%{pythonver}.tgz
20+
Source3: http://llvm.org/pre-releases/3.7.0/rc3/llvm-%{llvmver}.src.tar.xz
21+
Source4: http://llvm.org/pre-releases/3.7.0/rc3/cfe-%{llvmver}.src.tar.xz
22+
23+
BuildArch: x86_64
24+
BuildRequires: bison, bzip2, cmake >= 2.8.7, file, flex, gcc, gcc-c++, git, glibc-devel, glibc-utils, python2-devel, rpm-build, svn, tar, texinfo-tex, wget, zip, zlib-devel
25+
26+
%description
27+
Python bindings for BPF Compiler Collection (BCC). Control a BPF program
28+
from userspace.
29+
30+
31+
%prep
32+
%setup -T -b 1 -n gcc-%{gccver}
33+
%setup -T -D -b 2 -n Python-%{pythonver}
34+
%setup -T -D -b 3 -n llvm-%{llvmver}.src
35+
mkdir tools/clang
36+
tar -xvvJf %{_sourcedir}/cfe-%{llvmver}.src.tar.xz -C tools/clang --strip 1
37+
%setup -D -n bcc-%{version}
38+
39+
%build
40+
41+
export LD_LIBRARY_PATH="%{_builddir}/usr/lib64"
42+
export PATH="%{_builddir}/usr/bin":$PATH
43+
44+
# build gcc to bootstrap llvm build
45+
pushd %{_builddir}/gcc-%{gccver}
46+
./contrib/download_prerequisites
47+
mkdir build
48+
cd build
49+
../configure --disable-multilib --prefix="%{_builddir}/usr"
50+
make -j`grep -c ^process /proc/cpuinfo`
51+
make install
52+
popd
53+
54+
echo "%{_builddir}/usr/lib64" > /etc/ld.so.conf.d/usrLocalLib64.conf
55+
ldconfig
56+
57+
# build newer python for llvm
58+
pushd %{_builddir}/Python-%{pythonver}
59+
./configure --prefix="%{_builddir}/usr"
60+
make -j`grep -c ^process /proc/cpuinfo`
61+
make install
62+
popd
63+
64+
# build llvm with local gcc
65+
pushd %{_builddir}/llvm-%{llvmver}.src
66+
mkdir build
67+
cd build
68+
cmake .. -DCMAKE_INSTALL_PREFIX="%{_builddir}/usr" -DCMAKE_C_COMPILER="%{_builddir}/usr/bin/gcc" -DCMAKE_CXX_COMPILER="%{_builddir}/usr/bin/g++" -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86;BPF"
69+
make -j`grep -c ^process /proc/cpuinfo`
70+
make install
71+
popd
72+
73+
rm /etc/ld.so.conf.d/usrLocalLib64.conf
74+
ldconfig
75+
76+
mkdir build
77+
cd build
78+
cmake .. -DREVISION=%{version} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_C_COMPILER="%{_builddir}/usr/bin/gcc" -DCMAKE_CXX_COMPILER="%{_builddir}/usr/bin/g++"
79+
make -j`grep -c ^process /proc/cpuinfo`
80+
81+
%install
82+
cd build
83+
make install/strip DESTDIR=%{buildroot}
84+
85+
%changelog
86+
* Fri Jul 03 2015 Brenden Blanco <[email protected]> - 0.1.1-2
87+
- Initial RPM Release
88+
89+
%package -n libbcc
90+
Summary: Shared Library for BPF Compiler Collection (BCC)
91+
%description -n libbcc
92+
Shared Library for BPF Compiler Collection (BCC)
93+
94+
%package -n libbcc-examples
95+
Summary: Examples for BPF Compiler Collection (BCC)
96+
%description -n libbcc-examples
97+
Examples for BPF Compiler Collection (BCC)
98+
99+
%package -n python-bpf
100+
Summary: Python bindings for BPF Compiler Collection (BCC)
101+
%description -n python-bpf
102+
Python bindings for BPF Compiler Collection (BCC)
103+
104+
%files -n python-bpf
105+
%{python_sitelib}/bpf*
106+
%exclude %{python_sitelib}/*.egg-info
107+
/usr/bin/bpf-run
108+
109+
%files -n libbcc
110+
/usr/lib64/*
111+
/usr/share/bcc/include/*
112+
/usr/include/bcc/*
113+
114+
%files -n libbcc-examples
115+
/usr/share/bcc/examples/*

0 commit comments

Comments
 (0)