Add beta RPM spec and docker script for centos
authorBrenden Blanco <bblanco@plumgrid.com>
Sat, 29 Aug 2015 04:44:35 +0000 (21:44 -0700)
committerBrenden Blanco <bblanco@plumgrid.com>
Sat, 29 Aug 2015 04:44:35 +0000 (21:44 -0700)
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
Dockerfile.centos6 [new file with mode: 0644]
SPECS/bcc.spec [new file with mode: 0644]

diff --git a/Dockerfile.centos6 b/Dockerfile.centos6
new file mode 100644 (file)
index 0000000..9643150
--- /dev/null
@@ -0,0 +1,24 @@
+FROM centos:6
+
+MAINTAINER Brenden Blanco <bblanco@plumgrid.com>
+
+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://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
diff --git a/SPECS/bcc.spec b/SPECS/bcc.spec
new file mode 100644 (file)
index 0000000..128e371
--- /dev/null
@@ -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 <bblanco@plumgrid.com> - 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