Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added debian package configuration and dockerfile for building #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Do not include build artifacts in the docker container.

# Object files
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hierboven even een "# When using docker in a build context, a COPY need not copy build products." ofzo.

Ik snapte niet meteen waar de dockerignore voor was.

*.o
*.ko
*.obj
*.elf

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Debian build artifacts
*.deb
./debian/rtpsniff
./build

# Binary stuff
/bin/
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,10 @@
*.x86_64
*.hex

# Debian build artifacts
*.deb
./debian/rtpsniff
./build

# Binary stuff
/bin/
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM debian:jessie

ARG version=1.0-1

RUN apt-get update && apt-get install -qy build-essential dh-make libpcap-dev dh-systemd
ADD . /rtpsniff
WORKDIR /rtpsniff
RUN dpkg-buildpackage -uc -us -b
CMD cp ../rtpsniff_${version}_amd64.deb .

ENV version=$version

CMD echo && mkdir /build/rtpsniff_${version} && \
mv /rtpsniff_${version}_amd64.deb /build/rtpsniff_${version}/ && \
chown -R ${UID}:root /build/rtpsniff_${version} && \
cd /build && find . -type f && echo && echo 'Output files created succesfully'
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ RTPSniff is a tool to sniff RTP traffic and show stats about it.
(I'm considering renaming `rtpsniff` to `rtpstat` -- like `vmstat` --
since it prints a status update every N seconds.)

Building Debian package
-----------------------

Debian packages can be build using the provided Dockerfile.

docker build . -t rtpsniff
docker run --rm --volume `pwd`/build:/build rtpsniff

TODO
----
Expand Down
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rtpsniff (1.0-1) unstable; urgency=low

* Initial release

-- Jasper Hafkenscheid <[email protected]> Wed, 01 Nov 2017 13:34:41 +0000
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
13 changes: 13 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Source: rtpsniff
Section: net
Priority: optional
Maintainer: OSSO B.V. <[email protected]>
Build-Depends: debhelper (>= 9), dh-systemd, libpcap0.8-dev
Standards-Version: 3.9.5
Homepage: https://github.com/ossobv/rtpsniff

Package: rtpsniff
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Standalone RTP sniffing tool.
RTPSniff is a tool to sniff RTP traffic and show stats about it.
7 changes: 7 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: rtpsniff
Source: <https://github.com/ossobv/rtpsniff>

Files: *
Copyright: 2008,2009,2014 OSSO B.V. <[email protected]>
License: GPL-3.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Special license? Niet gewoon alleen GPL-3.0?

2 changes: 2 additions & 0 deletions debian/rtpsniff.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bin/rtpsniff usr/sbin/
bin/libslowpoll.so usr/lib/
10 changes: 10 additions & 0 deletions debian/rtpsniff.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=RTPSniff is a tool to sniff RTP traffic and show stats about it.
After=network.target

[Service]
User=root
ExecStart=/usr/sbin/rtpsniff eth0 100 "udp and not port 53"

[Install]
WantedBy=multi-user.target
31 changes: 31 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#DH_VERBOSE = 1

# Select syslog as output module.
export MOD_OUT=out_syslog
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hierboven even een "# Select syslog as output module."


# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed


# main packaging script based on dh7 syntax
%:
dh $@ --with systemd

# debmake generated override targets
# This is example for Cmake (See http://bugs.debian.org/641051 )
#override_dh_auto_configure:
# dh_auto_configure -- \
# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)