diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6012607 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,39 @@ +# Do not include build artifacts in the docker container. + +# Object files +*.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/ diff --git a/.gitignore b/.gitignore index 3061ad3..132724a 100644 --- a/.gitignore +++ b/.gitignore @@ -28,5 +28,10 @@ *.x86_64 *.hex +# Debian build artifacts +*.deb +./debian/rtpsniff +./build + # Binary stuff /bin/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..51bc7ef --- /dev/null +++ b/Dockerfile @@ -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' diff --git a/README.md b/README.md index b63a4a5..ca42578 100644 --- a/README.md +++ b/README.md @@ -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 ---- diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..682945f --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +rtpsniff (1.0-1) unstable; urgency=low + + * Initial release + + -- Jasper Hafkenscheid Wed, 01 Nov 2017 13:34:41 +0000 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..692e80e --- /dev/null +++ b/debian/control @@ -0,0 +1,13 @@ +Source: rtpsniff +Section: net +Priority: optional +Maintainer: OSSO B.V. +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. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..4ffb77f --- /dev/null +++ b/debian/copyright @@ -0,0 +1,7 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: rtpsniff +Source: + +Files: * +Copyright: 2008,2009,2014 OSSO B.V. +License: GPL-3.0 diff --git a/debian/rtpsniff.install b/debian/rtpsniff.install new file mode 100644 index 0000000..1dae03e --- /dev/null +++ b/debian/rtpsniff.install @@ -0,0 +1,2 @@ +bin/rtpsniff usr/sbin/ +bin/libslowpoll.so usr/lib/ diff --git a/debian/rtpsniff.service b/debian/rtpsniff.service new file mode 100644 index 0000000..5da6981 --- /dev/null +++ b/debian/rtpsniff.service @@ -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 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..9fb906e --- /dev/null +++ b/debian/rules @@ -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 + +# 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)