Add RPM packaging for el6,el7,fedora22
authorBrenden Blanco <bblanco@plumgrid.com>
Tue, 1 Sep 2015 01:19:33 +0000 (18:19 -0700)
committerBrenden Blanco <bblanco@plumgrid.com>
Tue, 1 Sep 2015 16:21:41 +0000 (09:21 -0700)
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
16 files changed:
Dockerfile.centos6 [deleted file]
Dockerfile.fedora [deleted file]
SPECS/Dockerfile.el6 [new file with mode: 0644]
SPECS/Dockerfile.el6.in [new file with mode: 0644]
SPECS/Dockerfile.el7 [new file with mode: 0644]
SPECS/Dockerfile.el7.in [new file with mode: 0644]
SPECS/Dockerfile.f22 [new file with mode: 0644]
SPECS/Dockerfile.f22.in [new file with mode: 0644]
SPECS/bcc.el6.spec [new file with mode: 0644]
SPECS/bcc.el6.spec.in [new file with mode: 0644]
SPECS/bcc.el7.spec [moved from SPECS/bcc.spec with 56% similarity]
SPECS/bcc.el7.spec.in [new file with mode: 0644]
SPECS/bcc.f22.spec [new file with mode: 0644]
SPECS/bcc.f22.spec.in [new file with mode: 0644]
scripts/CMakeLists.txt
scripts/bump_version.cmake [new file with mode: 0644]

diff --git a/Dockerfile.centos6 b/Dockerfile.centos6
deleted file mode 100644 (file)
index 9643150..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-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/Dockerfile.fedora b/Dockerfile.fedora
deleted file mode 100644 (file)
index e52fad6..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-# 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
diff --git a/SPECS/Dockerfile.el6 b/SPECS/Dockerfile.el6
new file mode 100644 (file)
index 0000000..2d5eabd
--- /dev/null
@@ -0,0 +1,21 @@
+# 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
diff --git a/SPECS/Dockerfile.el6.in b/SPECS/Dockerfile.el6.in
new file mode 100644 (file)
index 0000000..2d95127
--- /dev/null
@@ -0,0 +1,21 @@
+# 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
diff --git a/SPECS/Dockerfile.el7 b/SPECS/Dockerfile.el7
new file mode 100644 (file)
index 0000000..83c748d
--- /dev/null
@@ -0,0 +1,19 @@
+# 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
diff --git a/SPECS/Dockerfile.el7.in b/SPECS/Dockerfile.el7.in
new file mode 100644 (file)
index 0000000..f1f6b8e
--- /dev/null
@@ -0,0 +1,19 @@
+# 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
diff --git a/SPECS/Dockerfile.f22 b/SPECS/Dockerfile.f22
new file mode 100644 (file)
index 0000000..efd293c
--- /dev/null
@@ -0,0 +1,20 @@
+# 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
diff --git a/SPECS/Dockerfile.f22.in b/SPECS/Dockerfile.f22.in
new file mode 100644 (file)
index 0000000..43916b0
--- /dev/null
@@ -0,0 +1,20 @@
+# 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
diff --git a/SPECS/bcc.el6.spec b/SPECS/bcc.el6.spec
new file mode 100644 (file)
index 0000000..7768aa9
--- /dev/null
@@ -0,0 +1,115 @@
+# 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/*
diff --git a/SPECS/bcc.el6.spec.in b/SPECS/bcc.el6.spec.in
new file mode 100644 (file)
index 0000000..02da2d5
--- /dev/null
@@ -0,0 +1,115 @@
+# 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/*
similarity index 56%
rename from SPECS/bcc.spec
rename to SPECS/bcc.el7.spec
index 64e531a..e7ba518 100644 (file)
@@ -1,36 +1,55 @@
 %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
@@ -63,5 +82,3 @@ Python bindings for BPF Compiler Collection (BCC)
 
 %files -n libbcc-examples
 /usr/share/bcc/examples/*
-
-#rpmbuild --define "_topdir `pwd`" -ba SPECS/bcc.spec
diff --git a/SPECS/bcc.el7.spec.in b/SPECS/bcc.el7.spec.in
new file mode 100644 (file)
index 0000000..0a30da2
--- /dev/null
@@ -0,0 +1,84 @@
+%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/*
diff --git a/SPECS/bcc.f22.spec b/SPECS/bcc.f22.spec
new file mode 100644 (file)
index 0000000..e7ba518
--- /dev/null
@@ -0,0 +1,84 @@
+%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/*
diff --git a/SPECS/bcc.f22.spec.in b/SPECS/bcc.f22.spec.in
new file mode 100644 (file)
index 0000000..0a30da2
--- /dev/null
@@ -0,0 +1,84 @@
+%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/*
index 2c12c55..c23e3d1 100644 (file)
@@ -20,3 +20,6 @@ endif()
 # 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)
diff --git a/scripts/bump_version.cmake b/scripts/bump_version.cmake
new file mode 100644 (file)
index 0000000..d788862
--- /dev/null
@@ -0,0 +1,9 @@
+# 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)