+++ /dev/null
-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
+++ /dev/null
-# File to be used for building an Ubuntu .deb
-
-FROM fedora
-
-MAINTAINER Brenden Blanco <bblanco@plumgrid.com>
-
-RUN dnf -y install @rpm-development-tools @c-development @development-tools cmake libstdc++-static
-
-WORKDIR /root
-RUN git clone https://github.com/llvm-mirror/llvm.git
-RUN git clone https://github.com/llvm-mirror/clang.git llvm/tools/clang
-RUN mkdir -p /root/llvm/build
-WORKDIR /root/llvm/build
-RUN cmake .. -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86;BPF"
-RUN make -j$(grep -c ^process /proc/cpuinfo)
-
-RUN mkdir -p /root/bcc/build
-COPY ./ /root/bcc/
-WORKDIR /root/bcc/build
-RUN cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=/root/llvm/build
-RUN make -j$(grep -c ^process /proc/cpuinfo) package
--- /dev/null
+# Copyright (c) PLUMgrid, Inc.
+# Licensed under the Apache License, Version 2.0 (the "License")
+
+FROM centos:6
+
+MAINTAINER Brenden Blanco <bblanco@plumgrid.com>
+
+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
+
+WORKDIR /root
+RUN mkdir -p {BUILD,RPMS,SOURCES,SPECS,SRPMS}
+RUN cd SOURCES && wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
+RUN cd SOURCES && wget https://ftp.gnu.org/gnu/gcc/gcc-5.1.0/gcc-5.1.0.tar.gz
+RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/llvm-3.7.0rc3.src.tar.xz
+RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/cfe-3.7.0rc3.src.tar.xz
+RUN cd SOURCES && wget https://github.com/iovisor/bcc/archive/v0.1.5.tar.gz
+
+RUN cd SPECS && wget https://raw.githubusercontent.com/iovisor/bcc/v0.1.5/SPECS/bcc.el6.spec
+#COPY SPECS/bcc.el6.spec SPECS/
+
+RUN rpmbuild --define "_topdir `pwd`" -ba SPECS/bcc.el6.spec
--- /dev/null
+# Copyright (c) PLUMgrid, Inc.
+# Licensed under the Apache License, Version 2.0 (the "License")
+
+FROM centos:6
+
+MAINTAINER Brenden Blanco <bblanco@plumgrid.com>
+
+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
+
+WORKDIR /root
+RUN mkdir -p {BUILD,RPMS,SOURCES,SPECS,SRPMS}
+RUN cd SOURCES && wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
+RUN cd SOURCES && wget https://ftp.gnu.org/gnu/gcc/gcc-5.1.0/gcc-5.1.0.tar.gz
+RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/llvm-3.7.0rc3.src.tar.xz
+RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/cfe-3.7.0rc3.src.tar.xz
+RUN cd SOURCES && wget https://github.com/iovisor/bcc/archive/v@REVISION_LAST@.tar.gz
+
+RUN cd SPECS && wget https://raw.githubusercontent.com/iovisor/bcc/v@REVISION_LAST@/SPECS/bcc.el6.spec
+#COPY SPECS/bcc.el6.spec SPECS/
+
+RUN rpmbuild --define "_topdir `pwd`" -ba SPECS/bcc.el6.spec
--- /dev/null
+# Copyright (c) PLUMgrid, Inc.
+# Licensed under the Apache License, Version 2.0 (the "License")
+
+FROM centos:7
+
+MAINTAINER Brenden Blanco <bblanco@plumgrid.com>
+
+RUN yum -y install bison cmake flex gcc gcc-c++ make python2-devel rpm-build wget zlib-devel
+
+WORKDIR /root
+RUN mkdir -p {BUILD,RPMS,SOURCES,SPECS,SRPMS}
+RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/llvm-3.7.0rc3.src.tar.xz
+RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/cfe-3.7.0rc3.src.tar.xz
+RUN cd SOURCES && wget https://github.com/iovisor/bcc/archive/v0.1.5.tar.gz
+
+RUN cd SPECS && wget https://raw.githubusercontent.com/iovisor/bcc/v0.1.5/SPECS/bcc.el7.spec
+#COPY SPECS/bcc.el7.spec SPECS/
+
+RUN rpmbuild --define "_topdir `pwd`" -ba SPECS/bcc.el7.spec
--- /dev/null
+# Copyright (c) PLUMgrid, Inc.
+# Licensed under the Apache License, Version 2.0 (the "License")
+
+FROM centos:7
+
+MAINTAINER Brenden Blanco <bblanco@plumgrid.com>
+
+RUN yum -y install bison cmake flex gcc gcc-c++ make python2-devel rpm-build wget zlib-devel
+
+WORKDIR /root
+RUN mkdir -p {BUILD,RPMS,SOURCES,SPECS,SRPMS}
+RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/llvm-3.7.0rc3.src.tar.xz
+RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/cfe-3.7.0rc3.src.tar.xz
+RUN cd SOURCES && wget https://github.com/iovisor/bcc/archive/v@REVISION_LAST@.tar.gz
+
+RUN cd SPECS && wget https://raw.githubusercontent.com/iovisor/bcc/v@REVISION_LAST@/SPECS/bcc.el7.spec
+#COPY SPECS/bcc.el7.spec SPECS/
+
+RUN rpmbuild --define "_topdir `pwd`" -ba SPECS/bcc.el7.spec
--- /dev/null
+# Copyright (c) PLUMgrid, Inc.
+# Licensed under the Apache License, Version 2.0 (the "License")
+
+FROM fedora:22
+
+MAINTAINER Brenden Blanco <bblanco@plumgrid.com>
+
+RUN dnf -y install bison cmake flex gcc gcc-c++ libstdc++-static make python2-devel rpm-build wget zlib-devel
+
+WORKDIR /root
+RUN mkdir -p {BUILD,RPMS,SOURCES,SPECS,SRPMS}
+
+RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/llvm-3.7.0rc3.src.tar.xz
+RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/cfe-3.7.0rc3.src.tar.xz
+RUN cd SOURCES && wget https://github.com/iovisor/bcc/archive/v0.1.5.tar.gz
+
+RUN cd SPECS && wget https://raw.githubusercontent.com/iovisor/bcc/v0.1.5/SPECS/bcc.f22.spec
+#COPY SPECS/bcc.f22.spec SPECS/
+
+RUN rpmbuild --define "_topdir `pwd`" -ba SPECS/bcc.f22.spec
--- /dev/null
+# Copyright (c) PLUMgrid, Inc.
+# Licensed under the Apache License, Version 2.0 (the "License")
+
+FROM fedora:22
+
+MAINTAINER Brenden Blanco <bblanco@plumgrid.com>
+
+RUN dnf -y install bison cmake flex gcc gcc-c++ libstdc++-static make python2-devel rpm-build wget zlib-devel
+
+WORKDIR /root
+RUN mkdir -p {BUILD,RPMS,SOURCES,SPECS,SRPMS}
+
+RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/llvm-3.7.0rc3.src.tar.xz
+RUN cd SOURCES && wget http://llvm.org/pre-releases/3.7.0/rc3/cfe-3.7.0rc3.src.tar.xz
+RUN cd SOURCES && wget https://github.com/iovisor/bcc/archive/v@REVISION_LAST@.tar.gz
+
+RUN cd SPECS && wget https://raw.githubusercontent.com/iovisor/bcc/v@REVISION_LAST@/SPECS/bcc.f22.spec
+#COPY SPECS/bcc.f22.spec SPECS/
+
+RUN rpmbuild --define "_topdir `pwd`" -ba SPECS/bcc.f22.spec
--- /dev/null
+# Copyright (c) PLUMgrid, Inc.
+# Licensed under the Apache License, Version 2.0 (the "License")
+
+%define debug_package %{nil}
+%define llvmver 3.7.0rc3
+%define gccver 5.1.0
+%define pythonver 2.7.10
+
+Name: bcc
+Version: 0.1.5
+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}.tar.gz
+Source1: https://ftp.gnu.org/gnu/gcc/gcc-%{gccver}/gcc-%{gccver}.tar.gz
+Source2: https://www.python.org/ftp/python/%{pythonver}/Python-%{pythonver}.tgz
+Source3: http://llvm.org/pre-releases/3.7.0/rc3/llvm-%{llvmver}.src.tar.xz
+Source4: http://llvm.org/pre-releases/3.7.0/rc3/cfe-%{llvmver}.src.tar.xz
+
+BuildArch: x86_64
+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
+
+%description
+Python bindings for BPF Compiler Collection (BCC). Control a BPF program
+from userspace.
+
+
+%prep
+%setup -T -b 1 -n gcc-%{gccver}
+%setup -T -D -b 2 -n Python-%{pythonver}
+%setup -T -D -b 3 -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}
+
+%build
+
+export LD_LIBRARY_PATH="%{_builddir}/usr/lib64"
+export PATH="%{_builddir}/usr/bin":$PATH
+
+# build gcc to bootstrap llvm build
+pushd %{_builddir}/gcc-%{gccver}
+./contrib/download_prerequisites
+mkdir build
+cd build
+../configure --disable-multilib --prefix="%{_builddir}/usr"
+make -j`grep -c ^process /proc/cpuinfo`
+make install
+popd
+
+echo "%{_builddir}/usr/lib64" > /etc/ld.so.conf.d/usrLocalLib64.conf
+ldconfig
+
+# build newer python for llvm
+pushd %{_builddir}/Python-%{pythonver}
+./configure --prefix="%{_builddir}/usr"
+make -j`grep -c ^process /proc/cpuinfo`
+make install
+popd
+
+# build llvm with local gcc
+pushd %{_builddir}/llvm-%{llvmver}.src
+mkdir build
+cd build
+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"
+make -j`grep -c ^process /proc/cpuinfo`
+make install
+popd
+
+rm /etc/ld.so.conf.d/usrLocalLib64.conf
+ldconfig
+
+mkdir build
+cd build
+cmake .. -DREVISION=%{version} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_C_COMPILER="%{_builddir}/usr/bin/gcc" -DCMAKE_CXX_COMPILER="%{_builddir}/usr/bin/g++"
+make -j`grep -c ^process /proc/cpuinfo`
+
+%install
+cd build
+make install/strip 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/*
--- /dev/null
+# Copyright (c) PLUMgrid, Inc.
+# Licensed under the Apache License, Version 2.0 (the "License")
+
+%define debug_package %{nil}
+%define llvmver 3.7.0rc3
+%define gccver 5.1.0
+%define pythonver 2.7.10
+
+Name: bcc
+Version: @REVISION_LAST@
+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}.tar.gz
+Source1: https://ftp.gnu.org/gnu/gcc/gcc-%{gccver}/gcc-%{gccver}.tar.gz
+Source2: https://www.python.org/ftp/python/%{pythonver}/Python-%{pythonver}.tgz
+Source3: http://llvm.org/pre-releases/3.7.0/rc3/llvm-%{llvmver}.src.tar.xz
+Source4: http://llvm.org/pre-releases/3.7.0/rc3/cfe-%{llvmver}.src.tar.xz
+
+BuildArch: x86_64
+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
+
+%description
+Python bindings for BPF Compiler Collection (BCC). Control a BPF program
+from userspace.
+
+
+%prep
+%setup -T -b 1 -n gcc-%{gccver}
+%setup -T -D -b 2 -n Python-%{pythonver}
+%setup -T -D -b 3 -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}
+
+%build
+
+export LD_LIBRARY_PATH="%{_builddir}/usr/lib64"
+export PATH="%{_builddir}/usr/bin":$PATH
+
+# build gcc to bootstrap llvm build
+pushd %{_builddir}/gcc-%{gccver}
+./contrib/download_prerequisites
+mkdir build
+cd build
+../configure --disable-multilib --prefix="%{_builddir}/usr"
+make -j`grep -c ^process /proc/cpuinfo`
+make install
+popd
+
+echo "%{_builddir}/usr/lib64" > /etc/ld.so.conf.d/usrLocalLib64.conf
+ldconfig
+
+# build newer python for llvm
+pushd %{_builddir}/Python-%{pythonver}
+./configure --prefix="%{_builddir}/usr"
+make -j`grep -c ^process /proc/cpuinfo`
+make install
+popd
+
+# build llvm with local gcc
+pushd %{_builddir}/llvm-%{llvmver}.src
+mkdir build
+cd build
+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"
+make -j`grep -c ^process /proc/cpuinfo`
+make install
+popd
+
+rm /etc/ld.so.conf.d/usrLocalLib64.conf
+ldconfig
+
+mkdir build
+cd build
+cmake .. -DREVISION=%{version} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_C_COMPILER="%{_builddir}/usr/bin/gcc" -DCMAKE_CXX_COMPILER="%{_builddir}/usr/bin/g++"
+make -j`grep -c ^process /proc/cpuinfo`
+
+%install
+cd build
+make install/strip 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/*
%define debug_package %{nil}
+%define llvmver 3.7.0rc3
Name: bcc
-Version: @REVISION@
+Version: 0.1.5
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
+Source0: https://github.com/iovisor/bcc/archive/v%{version}.tar.gz
+Source1: http://llvm.org/pre-releases/3.7.0/rc3/llvm-%{llvmver}.src.tar.xz
+Source2: http://llvm.org/pre-releases/3.7.0/rc3/cfe-%{llvmver}.src.tar.xz
BuildArch: x86_64
-BuildRequires: python2-devel, cmake >= 2.8.7, flex, bison
+BuildRequires: bison, cmake >= 2.8.7, flex, gcc, gcc-c++, python2-devel
%description
-Python bindings for BPF Compiler Collection (BCC). Control a BPF program
-from userspace.
+Python bindings for BPF Compiler Collection (BCC). Control a BPF program from
+userspace.
%prep
-%setup -n bcc-%{version}
-
+%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}
%build
+
+export LD_LIBRARY_PATH="%{_builddir}/usr/lib64"
+export PATH="%{_builddir}/usr/bin":$PATH
+
+# build llvm
+pushd %{_builddir}/llvm-%{llvmver}.src
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
+../configure --disable-assertions --enable-optimized --prefix="%{_builddir}/usr"
+make -j`grep -c ^process /proc/cpuinfo`
+make install
+popd
+
+mkdir build
+pushd build
+cmake .. -DREVISION=%{version} -DCMAKE_INSTALL_PREFIX=/usr
+make -j`grep -c ^process /proc/cpuinfo`
+popd
%install
-cd build
-make install DESTDIR=%{buildroot}
+pushd build
+make install/strip DESTDIR=%{buildroot}
%changelog
* Fri Jul 03 2015 Brenden Blanco <bblanco@plumgrid.com> - 0.1.1-2
%files -n libbcc-examples
/usr/share/bcc/examples/*
-
-#rpmbuild --define "_topdir `pwd`" -ba SPECS/bcc.spec
--- /dev/null
+%define debug_package %{nil}
+%define llvmver 3.7.0rc3
+
+Name: bcc
+Version: @REVISION_LAST@
+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}.tar.gz
+Source1: http://llvm.org/pre-releases/3.7.0/rc3/llvm-%{llvmver}.src.tar.xz
+Source2: http://llvm.org/pre-releases/3.7.0/rc3/cfe-%{llvmver}.src.tar.xz
+
+BuildArch: x86_64
+BuildRequires: bison, cmake >= 2.8.7, flex, gcc, gcc-c++, python2-devel
+
+%description
+Python bindings for BPF Compiler Collection (BCC). Control a BPF program from
+userspace.
+
+
+%prep
+%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}
+
+%build
+
+export LD_LIBRARY_PATH="%{_builddir}/usr/lib64"
+export PATH="%{_builddir}/usr/bin":$PATH
+
+# build llvm
+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
+popd
+
+mkdir build
+pushd build
+cmake .. -DREVISION=%{version} -DCMAKE_INSTALL_PREFIX=/usr
+make -j`grep -c ^process /proc/cpuinfo`
+popd
+
+%install
+pushd build
+make install/strip 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/*
--- /dev/null
+%define debug_package %{nil}
+%define llvmver 3.7.0rc3
+
+Name: bcc
+Version: 0.1.5
+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}.tar.gz
+Source1: http://llvm.org/pre-releases/3.7.0/rc3/llvm-%{llvmver}.src.tar.xz
+Source2: http://llvm.org/pre-releases/3.7.0/rc3/cfe-%{llvmver}.src.tar.xz
+
+BuildArch: x86_64
+BuildRequires: bison, cmake >= 2.8.7, flex, gcc, gcc-c++, python2-devel
+
+%description
+Python bindings for BPF Compiler Collection (BCC). Control a BPF program from
+userspace.
+
+
+%prep
+%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}
+
+%build
+
+export LD_LIBRARY_PATH="%{_builddir}/usr/lib64"
+export PATH="%{_builddir}/usr/bin":$PATH
+
+# build llvm
+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
+popd
+
+mkdir build
+pushd build
+cmake .. -DREVISION=%{version} -DCMAKE_INSTALL_PREFIX=/usr
+make -j`grep -c ^process /proc/cpuinfo`
+popd
+
+%install
+pushd build
+make install/strip 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/*
--- /dev/null
+%define debug_package %{nil}
+%define llvmver 3.7.0rc3
+
+Name: bcc
+Version: @REVISION_LAST@
+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}.tar.gz
+Source1: http://llvm.org/pre-releases/3.7.0/rc3/llvm-%{llvmver}.src.tar.xz
+Source2: http://llvm.org/pre-releases/3.7.0/rc3/cfe-%{llvmver}.src.tar.xz
+
+BuildArch: x86_64
+BuildRequires: bison, cmake >= 2.8.7, flex, gcc, gcc-c++, python2-devel
+
+%description
+Python bindings for BPF Compiler Collection (BCC). Control a BPF program from
+userspace.
+
+
+%prep
+%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}
+
+%build
+
+export LD_LIBRARY_PATH="%{_builddir}/usr/lib64"
+export PATH="%{_builddir}/usr/bin":$PATH
+
+# build llvm
+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
+popd
+
+mkdir build
+pushd build
+cmake .. -DREVISION=%{version} -DCMAKE_INSTALL_PREFIX=/usr
+make -j`grep -c ^process /proc/cpuinfo`
+popd
+
+%install
+pushd build
+make install/strip 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/*
# strip leading 'v', and make unique for the tag
message(STATUS "Revision is ${REVISION}")
set(REVISION "${REVISION}" PARENT_SCOPE)
+# rpm/deb packaging uses this, only works on whole tag numbers
+string(SUBSTRING "${GIT_TAG_LAST}" 1 -1 REVISION_LAST)
+set(REVISION_LAST "${REVISION_LAST}" PARENT_SCOPE)
--- /dev/null
+# Copyright (c) PLUMgrid, Inc.
+# Licensed under the Apache License, Version 2.0 (the "License")
+
+configure_file(SPECS/Dockerfile.el6.in SPECS/Dockerfile.el6 @ONLY)
+configure_file(SPECS/Dockerfile.el7.in SPECS/Dockerfile.el7 @ONLY)
+configure_file(SPECS/Dockerfile.f22.in SPECS/Dockerfile.f22 @ONLY)
+configure_file(SPECS/bcc.el6.spec.in SPECS/bcc.el6.spec @ONLY)
+configure_file(SPECS/bcc.el7.spec.in SPECS/bcc.el7.spec @ONLY)
+configure_file(SPECS/bcc.f22.spec.in SPECS/bcc.f22.spec @ONLY)