Skip to content

Commit bd8fea4

Browse files
author
Brenden Blanco
committed
Add proper debian build support
The cmake based build system is nice, but not quite production ready. Move to the more painful but featureful debuild style. This is one step towards an upstreamable package. Rename libbpfprog (ugh) to libbcc. Split out python-bpf and libbcc-examples into separate packages that depend on libbcc. Signed-off-by: Brenden Blanco <[email protected]>
1 parent 0c7ab87 commit bd8fea4

File tree

18 files changed

+85
-36
lines changed

18 files changed

+85
-36
lines changed

CMakeLists.txt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,3 @@ add_subdirectory(scripts)
4949
add_subdirectory(examples)
5050
add_subdirectory(src)
5151
add_subdirectory(tests)
52-
53-
set(CPACK_PACKAGE_NAME "libbcc")
54-
set(CPACK_PACKAGE_VERSION "${REVISION}")
55-
set(CPACK_PACKAGE_CONTACT "Brenden Blanco <[email protected]")
56-
if(EXISTS "/etc/redhat-release")
57-
set(CPACK_GENERATOR "RPM")
58-
else()
59-
set(CPACK_GENERATOR "DEB")
60-
endif()
61-
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
62-
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
63-
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, libstdc++6, python, make, gcc")
64-
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Shared Library for BPF Compiler Collection (BCC)")
65-
include(CPack)

Dockerfile.ubuntu

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ RUN printf "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty main\ndeb-src
99
RUN wget -q -O - http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add -
1010
RUN apt-get -y update
1111

12-
RUN apt-get -y install bison build-essential cmake flex git libedit-dev python zlib1g-dev
13-
RUN apt-get -y install libllvm3.7 llvm-3.7-dev libclang-3.7-dev
12+
RUN apt-get -y install bison build-essential cmake debhelper devscripts flex git libedit-dev python zlib1g-dev
13+
RUN apt-get -y install libllvm3.8 llvm-3.8-dev libclang-3.8-dev
1414

1515
RUN mkdir -p /root/bcc/build
1616
COPY ./ /root/bcc/
17-
WORKDIR /root/bcc/build
18-
RUN cmake .. -DCMAKE_INSTALL_PREFIX=/usr
19-
RUN make -j$(grep -c ^process /proc/cpuinfo) package
17+
WORKDIR /root
18+
RUN tar zcf bcc_0.1.1.orig.tar.gz bcc/
19+
WORKDIR /root/bcc
20+
RUN DEB_BUILD_OPTIONS="nocheck parallel=4" debuild -us -uc

FAQ.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ A: Install pyroute2:
55
cd pyroute2; sudo make install
66

77
Q: hello_world.py fails with:
8-
OSError: libbpfprog.so: cannot open shared object file: No such file or directory
8+
OSError: libbcc.so: cannot open shared object file: No such file or directory
99
A: make sure to 'make install' and add the directory
10-
where libbpfprog.so was installed into your LD_LIBRARY_PATH
10+
where libbcc.so was installed into your LD_LIBRARY_PATH
1111
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
1212

1313
Q: hello_world.py fails with:

debian/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
bcc (0.1.5-1) unstable; urgency=low
2+
3+
* Initial release
4+
5+
-- Brenden Blanco <[email protected]> Mon, 06 Jul 2015 18:04:28 +0000

debian/compat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9

debian/control

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Source: bcc
2+
Maintainer: Brenden Blanco <[email protected]>
3+
Section: misc
4+
Priority: optional
5+
Standards-Version: 3.9.5
6+
Build-Depends: debhelper (>= 9), cmake, libllvm3.8, llvm-3.8-dev, libclang-3.8-dev
7+
Homepage: https://github.com/iovisor/bcc
8+
9+
Package: libbcc
10+
Architecture: amd64
11+
Depends: libc6, libstdc++6, make, gcc
12+
Description: Shared Library for BPF Compiler Collection (BCC)
13+
Shared Library for BPF Compiler Collection to control BPF programs
14+
from userspace.
15+
16+
Package: libbcc-examples
17+
Architecture: any
18+
Depends: libbcc
19+
Description: Shared Library for BPF Compiler Collection (BCC)
20+
21+
Package: python-bpf
22+
Architecture: all
23+
Depends: libbcc, python
24+
Description: Python wrappers for BPF Compiler Collection (BCC)

debian/copyright

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: bcc
3+
Source: https://github.com/iovisor/bcc
4+
5+
Files: *
6+
Copyright: 2015 PLUMgrid, Inc.
7+
License: Apache-2.0

debian/docs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FAQ.txt
2+
LICENSE.txt
3+
README.md

debian/libbcc-examples.install

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
usr/share/bcc/examples/*

debian/libbcc.install

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
usr/include/bcc/*
2+
usr/lib/libbcc* /usr/lib/x86_64-linux-gnu/
3+
usr/share/bcc/include/*

0 commit comments

Comments
 (0)