Browse Source

TT#124273 add non-NGCP Debian packaging

For this initial version, these are mostly copies of the existing
/debian tree, with `ngcp-rtpengine` renamed to `rtpengine`, added
"conflicts" with the `ngcp-rtpengine` packages, and NGCP-specific
"suggests" removed.

Change-Id: I64289f9907ec09d003a96b8ac81f83c79d413747
pull/1407/head
Richard Fuchs 4 years ago
parent
commit
bbfe168b72
132 changed files with 3823 additions and 0 deletions
  1. +15
    -0
      pkg/deb/bookworm/.gitignore
  2. +2
    -0
      pkg/deb/bookworm/clean
  3. +147
    -0
      pkg/deb/bookworm/control
  4. +18
    -0
      pkg/deb/bookworm/control.modules.in
  5. +36
    -0
      pkg/deb/bookworm/copyright
  6. +7
    -0
      pkg/deb/bookworm/dkms.conf.in
  7. +6
    -0
      pkg/deb/bookworm/rtpengine-daemon.default
  8. +117
    -0
      pkg/deb/bookworm/rtpengine-daemon.init
  9. +3
    -0
      pkg/deb/bookworm/rtpengine-daemon.install
  10. +1
    -0
      pkg/deb/bookworm/rtpengine-daemon.links
  11. +1
    -0
      pkg/deb/bookworm/rtpengine-daemon.manpages
  12. +38
    -0
      pkg/deb/bookworm/rtpengine-daemon.postinst
  13. +16
    -0
      pkg/deb/bookworm/rtpengine-daemon.service
  14. +1
    -0
      pkg/deb/bookworm/rtpengine-dev.install
  15. +101
    -0
      pkg/deb/bookworm/rtpengine-iptables-setup
  16. +46
    -0
      pkg/deb/bookworm/rtpengine-kernel-dkms.postinst
  17. +32
    -0
      pkg/deb/bookworm/rtpengine-kernel-dkms.prerm
  18. +1
    -0
      pkg/deb/bookworm/rtpengine-kernel-source.links
  19. +11
    -0
      pkg/deb/bookworm/rtpengine-recording-daemon.default
  20. +2
    -0
      pkg/deb/bookworm/rtpengine-recording-daemon.dirs
  21. +112
    -0
      pkg/deb/bookworm/rtpengine-recording-daemon.init
  22. +3
    -0
      pkg/deb/bookworm/rtpengine-recording-daemon.install
  23. +1
    -0
      pkg/deb/bookworm/rtpengine-recording-daemon.links
  24. +1
    -0
      pkg/deb/bookworm/rtpengine-recording-daemon.manpages
  25. +20
    -0
      pkg/deb/bookworm/rtpengine-recording-daemon.ngcp-rtpengine-recording-nfs-mount.service
  26. +16
    -0
      pkg/deb/bookworm/rtpengine-recording-daemon.service
  27. +42
    -0
      pkg/deb/bookworm/rtpengine-recording-nfs-setup
  28. +4
    -0
      pkg/deb/bookworm/rtpengine-utils.install
  29. +2
    -0
      pkg/deb/bookworm/rtpengine.docs
  30. +70
    -0
      pkg/deb/bookworm/rules
  31. +82
    -0
      pkg/deb/bookworm/rules.modules
  32. +1
    -0
      pkg/deb/bookworm/source/format
  33. +1
    -0
      pkg/deb/bookworm/source/options
  34. +15
    -0
      pkg/deb/bullseye/.gitignore
  35. +2
    -0
      pkg/deb/bullseye/clean
  36. +147
    -0
      pkg/deb/bullseye/control
  37. +18
    -0
      pkg/deb/bullseye/control.modules.in
  38. +36
    -0
      pkg/deb/bullseye/copyright
  39. +7
    -0
      pkg/deb/bullseye/dkms.conf.in
  40. +6
    -0
      pkg/deb/bullseye/rtpengine-daemon.default
  41. +117
    -0
      pkg/deb/bullseye/rtpengine-daemon.init
  42. +3
    -0
      pkg/deb/bullseye/rtpengine-daemon.install
  43. +1
    -0
      pkg/deb/bullseye/rtpengine-daemon.links
  44. +1
    -0
      pkg/deb/bullseye/rtpengine-daemon.manpages
  45. +38
    -0
      pkg/deb/bullseye/rtpengine-daemon.postinst
  46. +16
    -0
      pkg/deb/bullseye/rtpengine-daemon.service
  47. +1
    -0
      pkg/deb/bullseye/rtpengine-dev.install
  48. +101
    -0
      pkg/deb/bullseye/rtpengine-iptables-setup
  49. +46
    -0
      pkg/deb/bullseye/rtpengine-kernel-dkms.postinst
  50. +32
    -0
      pkg/deb/bullseye/rtpengine-kernel-dkms.prerm
  51. +1
    -0
      pkg/deb/bullseye/rtpengine-kernel-source.links
  52. +11
    -0
      pkg/deb/bullseye/rtpengine-recording-daemon.default
  53. +2
    -0
      pkg/deb/bullseye/rtpengine-recording-daemon.dirs
  54. +112
    -0
      pkg/deb/bullseye/rtpengine-recording-daemon.init
  55. +3
    -0
      pkg/deb/bullseye/rtpengine-recording-daemon.install
  56. +1
    -0
      pkg/deb/bullseye/rtpengine-recording-daemon.links
  57. +1
    -0
      pkg/deb/bullseye/rtpengine-recording-daemon.manpages
  58. +20
    -0
      pkg/deb/bullseye/rtpengine-recording-daemon.ngcp-rtpengine-recording-nfs-mount.service
  59. +16
    -0
      pkg/deb/bullseye/rtpengine-recording-daemon.service
  60. +42
    -0
      pkg/deb/bullseye/rtpengine-recording-nfs-setup
  61. +4
    -0
      pkg/deb/bullseye/rtpengine-utils.install
  62. +2
    -0
      pkg/deb/bullseye/rtpengine.docs
  63. +70
    -0
      pkg/deb/bullseye/rules
  64. +82
    -0
      pkg/deb/bullseye/rules.modules
  65. +1
    -0
      pkg/deb/bullseye/source/format
  66. +1
    -0
      pkg/deb/bullseye/source/options
  67. +15
    -0
      pkg/deb/buster/.gitignore
  68. +2
    -0
      pkg/deb/buster/clean
  69. +146
    -0
      pkg/deb/buster/control
  70. +18
    -0
      pkg/deb/buster/control.modules.in
  71. +36
    -0
      pkg/deb/buster/copyright
  72. +7
    -0
      pkg/deb/buster/dkms.conf.in
  73. +6
    -0
      pkg/deb/buster/rtpengine-daemon.default
  74. +117
    -0
      pkg/deb/buster/rtpengine-daemon.init
  75. +3
    -0
      pkg/deb/buster/rtpengine-daemon.install
  76. +1
    -0
      pkg/deb/buster/rtpengine-daemon.links
  77. +1
    -0
      pkg/deb/buster/rtpengine-daemon.manpages
  78. +38
    -0
      pkg/deb/buster/rtpengine-daemon.postinst
  79. +16
    -0
      pkg/deb/buster/rtpengine-daemon.service
  80. +1
    -0
      pkg/deb/buster/rtpengine-dev.install
  81. +101
    -0
      pkg/deb/buster/rtpengine-iptables-setup
  82. +46
    -0
      pkg/deb/buster/rtpengine-kernel-dkms.postinst
  83. +32
    -0
      pkg/deb/buster/rtpengine-kernel-dkms.prerm
  84. +1
    -0
      pkg/deb/buster/rtpengine-kernel-source.links
  85. +11
    -0
      pkg/deb/buster/rtpengine-recording-daemon.default
  86. +2
    -0
      pkg/deb/buster/rtpengine-recording-daemon.dirs
  87. +112
    -0
      pkg/deb/buster/rtpengine-recording-daemon.init
  88. +3
    -0
      pkg/deb/buster/rtpengine-recording-daemon.install
  89. +1
    -0
      pkg/deb/buster/rtpengine-recording-daemon.links
  90. +1
    -0
      pkg/deb/buster/rtpengine-recording-daemon.manpages
  91. +20
    -0
      pkg/deb/buster/rtpengine-recording-daemon.ngcp-rtpengine-recording-nfs-mount.service
  92. +16
    -0
      pkg/deb/buster/rtpengine-recording-daemon.service
  93. +42
    -0
      pkg/deb/buster/rtpengine-recording-nfs-setup
  94. +4
    -0
      pkg/deb/buster/rtpengine-utils.install
  95. +2
    -0
      pkg/deb/buster/rtpengine.docs
  96. +70
    -0
      pkg/deb/buster/rules
  97. +82
    -0
      pkg/deb/buster/rules.modules
  98. +1
    -0
      pkg/deb/buster/source/format
  99. +1
    -0
      pkg/deb/buster/source/options
  100. +15
    -0
      pkg/deb/sid/.gitignore

+ 15
- 0
pkg/deb/bookworm/.gitignore View File

@ -0,0 +1,15 @@
*.debhelper
*.log
*.substvars
/.debhelper/
/debhelper-build-stamp
/files
/rtpengine-daemon/
/rtpengine-iptables/
/rtpengine-kernel-dkms/
/rtpengine-kernel-source/
/rtpengine-recording-daemon/
/rtpengine-utils/
/rtpengine/
README.html.gz
README.md.gz

+ 2
- 0
pkg/deb/bookworm/clean View File

@ -0,0 +1,2 @@
debian/README.html.gz
debian/README.md.gz

+ 147
- 0
pkg/deb/bookworm/control View File

@ -0,0 +1,147 @@
Source: rtpengine
Section: net
Priority: optional
Maintainer: Sipwise Development Team <support@sipwise.com>
Homepage: https://www.sipwise.com/
Standards-Version: 3.9.8
Build-Depends:
debhelper-compat (= 12),
default-libmysqlclient-dev,
gperf,
libavcodec-dev (>= 6:10),
libavfilter-dev (>= 6:10),
libavformat-dev (>= 6:10),
libavutil-dev (>= 6:10),
libbcg729-dev <!pkg.rtpengine.nobcg729>,
libbencode-perl,
libcrypt-openssl-rsa-perl,
libcrypt-rijndael-perl,
libcurl4-openssl-dev | libcurl4-gnutls-dev,
libdigest-crc-perl,
libdigest-hmac-perl,
libevent-dev (>= 2.0),
libglib2.0-dev (>= 2.30),
libhiredis-dev,
libio-multiplex-perl,
libio-socket-inet6-perl,
libio-socket-ip-perl,
libiptc-dev,
libjson-glib-dev,
libmosquitto-dev,
libnet-interface-perl,
libpcap0.8-dev,
libpcre3-dev,
libsocket6-perl,
libspandsp-dev,
libssl-dev (>= 1.0.1),
libswresample-dev (>= 6:10),
libsystemd-dev,
libwebsockets-dev,
libxmlrpc-core-c3-dev (>= 1.16.07),
libxtables-dev (>= 1.4) | iptables-dev (>= 1.4),
markdown,
python3,
python3-websockets,
zlib1g-dev,
Package: rtpengine-daemon
Architecture: any
Recommends:
rtpengine-recording-daemon,
rtpengine-utils,
Depends:
iptables,
lsb-base (>= 3.0-6),
${misc:Depends},
${shlibs:Depends},
Conflicts:
ngcp-rtpengine-daemon,
Description: proxy for RTP and media streams used in NGCP, userspace part
This daemon handles the first stages of proxying media streams and talks to
the kernel part of the proxy for eventual high-performance packet forwarding.
Package: rtpengine-recording-daemon
Architecture: any
Build-Profiles: <!pkg.rtpengine.no-transcoding>
Recommends:
rtpengine-utils,
Depends:
lsb-base (>= 3.0-6),
nfs-common,
${misc:Depends},
${shlibs:Depends},
Conflicts:
ngcp-rtpengine-recording-daemon,
Description: recording daemon for RTP and media streams
This daemon handles the call recording (media intercept) component of rtpengine.
Package: rtpengine-iptables
Architecture: any
Depends:
${misc:Depends},
${shlibs:Depends},
Conflicts:
ngcp-rtpengine-iptables,
Description: IPtables extension module for the kernel-space NGCP media proxy
Provides the IPtables extension needed to configure the mediaproxy rule.
Package: rtpengine
Architecture: all
Depends:
rtpengine-daemon (>= ${source:Version}),
rtpengine-iptables (>= ${source:Version}),
rtpengine-kernel-dkms (>= ${source:Version}),
rtpengine-recording-daemon (>= ${source:Version}),
rtpengine-utils (>= ${source:Version}),
${misc:Depends},
Description: NGCP RTP/media proxy - meta package
This is a meta package for easy installation of all four parts of the NGCP
media proxy. It will install the user-space daemon, the kernel-space IPtables
module, the IPtables extension module and utility scripts.
Package: rtpengine-kernel-source
Architecture: all
Section: kernel
Depends:
debhelper-compat (= 12),
module-assistant,
${misc:Depends},
Conflicts:
ngcp-rtpengine-kernel-source,
Description: IPtables kernel module for the NGCP media proxy - source
Provides the kernel-space part of the NGCP media proxy for high-
performance packet forwarding.
This package contains the source to be built with module-assistant or
kernel-package.
Package: rtpengine-kernel-dkms
Architecture: all
Section: kernel
Depends:
dkms (>= 1.95),
lsb-release,
${misc:Depends},
Conflicts:
ngcp-rtpengine-kernel-dkms,
Description: IPtables kernel module for the NGCP media proxy - DKMS
Provides the kernel-space part of the NGCP media proxy for high-
performance packet forwarding.
This package contains the source to be built with dkms.
Package: rtpengine-utils
Architecture: all
Depends:
libbencode-perl,
libconfig-tiny-perl,
libcrypt-rijndael-perl,
libdigest-hmac-perl,
libio-socket-inet6-perl,
libio-socket-ip-perl,
libsocket6-perl,
netcat-openbsd | netcat,
${misc:Depends},
${perl:Depends},
Conflicts:
ngcp-rtpengine-utils,
Description: scripts and Perl modules for NGCP rtpengine
This package contains scripts and Perl modules for NGCP rtpengine

+ 18
- 0
pkg/deb/bookworm/control.modules.in View File

@ -0,0 +1,18 @@
Source: rtpengine
Section: kernel
Priority: optional
Maintainer: Sipwise Development Team <support@sipwise.com>
Build-Depends:
debhelper-compat (= 12),
Standards-Version: 3.9.8
Homepage: https://www.sipwise.com/
Package: rtpengine-kernel-modules-_KVERS_
Architecture: any
Depends:
linux-modules-_KVERS_ | linux-image-_KVERS_,
Conflicts:
ngcp-rtpengine-kernel-modules-_KVERS_,
Description: IPtables kernel module for the NGCP media proxy
This package provides the rtpengine module for
the Linux kernel version _KVERS_.

+ 36
- 0
pkg/deb/bookworm/copyright View File

@ -0,0 +1,36 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://www.sipwise.com/
Upstream-Contact: Sipwise Development Team <support@sipwise.com>
Files: *
Copyright:
Copyright © 2007-2019 Sipwise GmbH, Austria
License: GPL-3+ with OpenSSL exception
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
In addition, as a special exception, the copyright holders give
permission to link the code of this release with the OpenSSL project's
"OpenSSL" library (or with modified versions of it that use the same
license as the "OpenSSL" library), and distribute the linked executables.
.
You must obey the GNU General Public License in all respects for all
of the code used other than "OpenSSL". If you modify file(s) with this
exception, you may extend this exception to your version of the file(s),
but you are not obligated to do so. If you do not wish to do so,
delete this exception statement from your version. If you delete
this exception statement from all source files in the program, then
also delete it here.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Comment:
On Debian systems, the full text of the GNU General Public License
version 3 can be found in the file '/usr/share/common-licenses/GPL-3'.

+ 7
- 0
pkg/deb/bookworm/dkms.conf.in View File

@ -0,0 +1,7 @@
PACKAGE_NAME="rtpengine"
PACKAGE_VERSION="__VERSION__"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build RTPENGINE_VERSION=\"__VERSION__\""
CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
AUTOINSTALL=yes
BUILT_MODULE_NAME[0]="xt_RTPENGINE"
DEST_MODULE_LOCATION[0]=/extra

+ 6
- 0
pkg/deb/bookworm/rtpengine-daemon.default View File

@ -0,0 +1,6 @@
CONFIG_FILE=/etc/rtpengine/rtpengine.conf
# CONFIG_SECTION=rtpengine
PIDFILE=/run/rtpengine-daemon.pid
MANAGE_IPTABLES=yes
#SET_USER=root
#SET_GROUP=root # GROUP only needs to be set if USER is not set or if the user isn't in the group

+ 117
- 0
pkg/deb/bookworm/rtpengine-daemon.init View File

@ -0,0 +1,117 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: rtpengine-daemon
# Required-Start: $network $local_fs $remote_fs $syslog
# Required-Stop: $network $local_fs $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Ngcp Rtpengine
# Description: Proxy for RTP and other media streams
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=rtpengine-daemon
DESC="RTP/media proxy"
DAEMON=$(which rtpengine)
DEFAULTS=/etc/default/${NAME}
test -f "$DAEMON" || exit 0
. /lib/lsb/init-functions
# Load startup options if available
if [ -f "$DEFAULTS" ]; then
. "$DEFAULTS" || true
fi
[ -z "$PIDFILE" ] && PIDFILE="/run/rtpengine.pid"
OPTIONS=""
START_OPTIONS=""
[ -z "$CONFIG_FILE" ] || OPTIONS="$OPTIONS --config-file=$CONFIG_FILE"
[ -z "$CONFIG_SECTION" ] || OPTIONS="$OPTIONS --config-section=$CONFIG_SECTION"
[ -z "$PIDFILE" ] || OPTIONS="$OPTIONS --pidfile=$PIDFILE"
if test "$FORK" = "no" ; then
OPTIONS="$OPTIONS --foreground"
fi
# check if directory for pid file needs to be created
PIDDIR=$(dirname "$PIDFILE")
DO_DIR_CHOWN=0
if ! test -z "$PIDDIR" && ! test -d "$PIDDIR"; then
mkdir -p "$PIDDIR"
DO_DIR_CHOWN=1
fi
# handle requested setuid/setgid
if ! test -z "$SET_USER"; then
START_OPTIONS="$START_OPTIONS --chuid $SET_USER"
test "$DO_DIR_CHOWN" = 1 && chown "$SET_USER": "$PIDDIR"
fi
if ! test -z "$SET_GROUP"; then
START_OPTIONS="$START_OPTIONS --group $SET_GROUP"
test "$DO_DIR_CHOWN" = 1 && chgrp "$SET_GROUP" "$PIDDIR"
fi
###
case "$1" in
start)
if [ -x "$(which ngcp-check-active)" ]; then
case "$(ngcp-check-active -v)" in
active|transition)
log_action_msg "Active node or transition."
;;
*)
log_action_msg "Ignored start action in inactive node"
exit 0
;;
esac
fi
RC=0
rtpengine-iptables-setup start || RC=$?
if [ "$RC" -ne 0 ]; then
log_action_msg "Failed to start rtpengine-iptables-setup"
log_end_msg "$RC"
exit 1
fi
log_daemon_msg "Starting $DESC" "$NAME"
# shellcheck disable=SC2086
start-stop-daemon --start --quiet --pidfile "$PIDFILE" \
--exec "$DAEMON" $START_OPTIONS -- $OPTIONS || log_progress_msg " already running"
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
RC=0
start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
--retry 5 --exec "$DAEMON" || RC=$?
if [ "$RC" -eq 0 ]; then
rtpengine-iptables-setup stop || true
fi
rm -f "$PIDFILE"
log_end_msg "$RC"
exit "$RC"
;;
restart|force-reload)
$0 stop
$0 start
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0

+ 3
- 0
pkg/deb/bookworm/rtpengine-daemon.install View File

@ -0,0 +1,3 @@
daemon/rtpengine /usr/sbin/
debian/rtpengine-iptables-setup /usr/sbin
etc/rtpengine.sample.conf /etc/rtpengine/

+ 1
- 0
pkg/deb/bookworm/rtpengine-daemon.links View File

@ -0,0 +1 @@
/lib/systemd/system/rtpengine-daemon.service /lib/systemd/system/rtpengine.service

+ 1
- 0
pkg/deb/bookworm/rtpengine-daemon.manpages View File

@ -0,0 +1 @@
daemon/rtpengine.8

+ 38
- 0
pkg/deb/bookworm/rtpengine-daemon.postinst View File

@ -0,0 +1,38 @@
#!/bin/sh
set -e
default=/etc/default/rtpengine-daemon
modname=xt_RTPENGINE
if [ -x "$(which ngcp-virt-identify)" ]; then
if ngcp-virt-identify --type container; then
VIRT="yes"
fi
fi
if [ "$VIRT" = "yes" ]; then
echo "Container environment detected. Skip kernel module check"
else
if [ -f $default ]; then
. $default || true
fi
if [ -n "$TABLE" ] && [ "$TABLE" -ge 0 ] && \
[ -n "$NO_FALLBACK" ] && \
{ [ "$NO_FALLBACK" = "1" ] || [ "$NO_FALLBACK" = "yes" ] ; }
then
if lsmod | grep -q $modname || modinfo $modname > /dev/null 2> /dev/null; then
true
else
echo "Kernel module $modname not found and NO_FALLBACK is set."
echo "Daemon restart not performed."
exit 0
fi
fi
fi
#DEBHELPER#
exit 0

+ 16
- 0
pkg/deb/bookworm/rtpengine-daemon.service View File

@ -0,0 +1,16 @@
[Unit]
Description=NGCP RTP/media Proxy Daemon
After=network-online.target
After=remote-fs.target
Requires=network-online.target
[Service]
Type=notify
EnvironmentFile=/etc/default/rtpengine-daemon
PIDFile=/run/rtpengine-daemon.pid
ExecStartPre=/usr/sbin/rtpengine-iptables-setup start
ExecStart=/usr/sbin/rtpengine -f -E --no-log-timestamps --pidfile /run/rtpengine-daemon.pid --config-file /etc/rtpengine/rtpengine.conf
ExecStopPost=/usr/sbin/rtpengine-iptables-setup stop
[Install]
WantedBy=multi-user.target

+ 1
- 0
pkg/deb/bookworm/rtpengine-dev.install View File

@ -0,0 +1 @@
daemon/*.h /usr/include/rtpengine/

+ 101
- 0
pkg/deb/bookworm/rtpengine-iptables-setup View File

@ -0,0 +1,101 @@
#!/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MODNAME=xt_RTPENGINE
MANAGE_IPTABLES=yes
DEFAULTS=/etc/default/rtpengine-daemon
# Load startup options if available
if [ -f "$DEFAULTS" ]; then
. "$DEFAULTS" || true
fi
MODPROBE_OPTIONS=""
TABLE=$(/usr/libexec/rtpengine/rtpengine-get-table --config-file="${CONFIG_FILE-/etc/rtpengine/rtpengine.conf}")
# Handle requested setuid/setgid.
if ! test -z "$SET_USER"; then
PUID=$(id -u "$SET_USER" 2> /dev/null)
test -z "$PUID" || MODPROBE_OPTIONS="$MODPROBE_OPTIONS proc_uid=$PUID"
if test -z "$SET_GROUP"; then
PGID=$(id -g "$SET_USER" 2> /dev/null)
test -z "$PGID" || MODPROBE_OPTIONS="$MODPROBE_OPTIONS proc_gid=$PGID"
fi
fi
if ! test -z "$SET_GROUP"; then
PGID=$(grep "^$SET_GROUP:" /etc/group | cut -d: -f3 2> /dev/null)
test -z "$PGID" || MODPROBE_OPTIONS="$MODPROBE_OPTIONS proc_gid=$PGID"
fi
###
if [ -x "$(which ngcp-virt-identify 2>/dev/null)" ]; then
if ngcp-virt-identify --type container; then
VIRT="yes"
fi
fi
firewall_setup()
{
if [ "$TABLE" -lt 0 ] || [ "$VIRT" = "yes" ]; then
return
fi
if [ "$MANAGE_IPTABLES" != "yes" ]; then
return
fi
# shellcheck disable=SC2086
modprobe $MODNAME $MODPROBE_OPTIONS
iptables -N rtpengine 2>/dev/null
iptables -D INPUT -j rtpengine 2>/dev/null
iptables -D INPUT -p udp -j rtpengine 2>/dev/null
iptables -I INPUT -p udp -j rtpengine
iptables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null
iptables -I rtpengine -p udp -j RTPENGINE --id "$TABLE"
ip6tables -N rtpengine 2>/dev/null
ip6tables -D INPUT -j rtpengine 2>/dev/null
ip6tables -D INPUT -p udp -j rtpengine 2>/dev/null
ip6tables -I INPUT -p udp -j rtpengine
ip6tables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null
ip6tables -I rtpengine -p udp -j RTPENGINE --id "$TABLE"
}
firewall_teardown()
{
if [ "$TABLE" -lt 0 ] || [ "$VIRT" = "yes" ]; then
return
fi
# XXX: Wait a bit to make sure the daemon has been stopped.
sleep 1
if [ -e /proc/rtpengine/control ]; then
echo "del $TABLE" >/proc/rtpengine/control 2>/dev/null
fi
if [ "$MANAGE_IPTABLES" != "yes" ]; then
return
fi
iptables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null
ip6tables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null
}
case "$1" in
start)
firewall_setup
;;
stop)
firewall_teardown
;;
*)
echo "Usage: $0 {start|stop}" >&2
exit 1
;;
esac
exit 0

+ 46
- 0
pkg/deb/bookworm/rtpengine-kernel-dkms.postinst View File

@ -0,0 +1,46 @@
#!/bin/sh
set -e
package=rtpengine-kernel-dkms
name=rtpengine
version=$(dpkg-query -W -f="\${Version}" "$package" \
|rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n")
if [ -x "$(which ngcp-virt-identify)" ]; then
if ngcp-virt-identify --type container; then
VIRT="yes"
fi
fi
if [ "$VIRT" = "yes" ]; then
echo "Container environment detected. Skip dkms"
else
isadded=$(dkms status -m "$name" -v "$version")
if [ -z "${isadded}" ] ; then
dkms add -m "$name" -v "$version"
fi
if [ "$1" = 'configure' ] ; then
KERNELS=$(ls /lib/modules/ 2>/dev/null || true)
for kernel in $KERNELS; do
if [ ! -r "/lib/modules/$kernel/build" ]; then
# cannot build modules for this kernel
continue
fi
( dkms build -m "$name" -v "$version" -k "$kernel" && dkms install -m "$name" -v "$version" -k "$kernel" ) || true
done
# try to start the daemon
if [ -x /etc/init.d/rtpengine-daemon ] ; then
invoke-rc.d rtpengine-daemon restart || true
fi
fi
fi
#DEBHELPER#
exit 0

+ 32
- 0
pkg/deb/bookworm/rtpengine-kernel-dkms.prerm View File

@ -0,0 +1,32 @@
#!/bin/sh
set -e
package=rtpengine-kernel-dkms
name=rtpengine
modname=xt_RTPENGINE
version=$(dpkg-query -W -f="\${Version}" "$package" \
|rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n")
if [ -x "$(which ngcp-virt-identify)" ]; then
if ngcp-virt-identify --type container; then
VIRT="yes"
fi
fi
# make sure it's not running
if [ -x /etc/init.d/rtpengine-daemon ] ; then
invoke-rc.d rtpengine-daemon stop || true
rmmod "$modname" 2>/dev/null || true
fi
if [ "$VIRT" = "yes" ]; then
echo "Container environment detected. Skip dkms"
else
dkms remove -m "$name" -v "$version" --all || true
fi
#DEBHELPER#
exit 0

+ 1
- 0
pkg/deb/bookworm/rtpengine-kernel-source.links View File

@ -0,0 +1 @@
/usr/share/modass/packages/default.sh /usr/share/modass/overrides/rtpengine-kernel-source

+ 11
- 0
pkg/deb/bookworm/rtpengine-recording-daemon.default View File

@ -0,0 +1,11 @@
CONFIG_FILE=/etc/rtpengine/rtpengine-recording.conf
# CONFIG_SECTION=rtpengine-recording
PIDFILE=/run/rtpengine-recording-daemon.pid
#SET_USER=root
#SET_GROUP=root # GROUP only needs to be set if USER is not set or if the user isn't in the group
#
MUST_NFS=no
NFS_HOST=192.168.1.1
NFS_REMOTE_PATH=/var/recordings
NFS_LOCAL_MOUNT=/var/lib/rtpengine-recording # must match output-dir if used
NFS_OPTIONS=hard,intr,tcp

+ 2
- 0
pkg/deb/bookworm/rtpengine-recording-daemon.dirs View File

@ -0,0 +1,2 @@
var/lib/rtpengine-recording
var/spool/rtpengine

+ 112
- 0
pkg/deb/bookworm/rtpengine-recording-daemon.init View File

@ -0,0 +1,112 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: rtpengine-recording-daemon
# Required-Start: $network $local_fs $remote_fs $syslog
# Required-Stop: $network $local_fs $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Ngcp Rtpengine Recording Daemon
# Description: Recording daemon for RTP and other media streams
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=rtpengine-recording-daemon
DESC="RTP/media recording daemon"
DAEMON=$(which rtpengine-recording)
DEFAULTS=/etc/default/${NAME}
test -f "$DAEMON" || exit 0
. /lib/lsb/init-functions
# Load startup options if available
if [ -f "$DEFAULTS" ]; then
. "$DEFAULTS" || true
fi
[ -z "$PIDFILE" ] && PIDFILE="/run/rtpengine-recording.pid"
OPTIONS=""
START_OPTIONS=""
[ -z "$CONFIG_FILE" ] || OPTIONS="$OPTIONS --config-file=$CONFIG_FILE"
[ -z "$PIDFILE" ] || OPTIONS="$OPTIONS --pidfile=$PIDFILE"
# check if directory for pid file needs to be created
PIDDIR=$(dirname "$PIDFILE")
DO_DIR_CHOWN=0
if ! test -z "$PIDDIR" && ! test -d "$PIDDIR"; then
mkdir -p "$PIDDIR"
DO_DIR_CHOWN=1
fi
# handle requested setuid/setgid
if ! test -z "$SET_USER"; then
START_OPTIONS="$START_OPTIONS --chuid $SET_USER"
test "$DO_DIR_CHOWN" = 1 && chown "$SET_USER": "$PIDDIR"
fi
if ! test -z "$SET_GROUP"; then
START_OPTIONS="$START_OPTIONS --group $SET_GROUP"
test "$DO_DIR_CHOWN" = 1 && chgrp "$SET_GROUP" "$PIDDIR"
fi
###
case "$1" in
start)
if [ -x "$(which ngcp-check-active)" ]; then
case "$(ngcp-check-active -v)" in
active|transition)
log_action_msg "Active node or transition."
;;
*)
log_action_msg "Ignored start action in inactive node"
exit 0
;;
esac
fi
RC=0
rtpengine-recording-nfs-setup start || RC=$?
if [ "$RC" -ne 0 ] ; then
log_action_msg "Failed to start rtpengine-recording-nfs-setup"
log_end_msg "$RC"
exit "$RC"
fi
log_daemon_msg "Starting $DESC" "$NAME"
# shellcheck disable=SC2086
start-stop-daemon --start --quiet --pidfile "$PIDFILE" \
--exec "$DAEMON" $START_OPTIONS -- $OPTIONS || log_progress_msg " already running"
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
RC=0
start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
--retry 5 --exec "$DAEMON" || RC=$?
rm -f "$PIDFILE"
log_end_msg "$RC"
exit "$RC"
;;
force-reload|restart)
$0 stop
$0 start
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0

+ 3
- 0
pkg/deb/bookworm/rtpengine-recording-daemon.install View File

@ -0,0 +1,3 @@
debian/rtpengine-recording-nfs-setup /usr/sbin/
etc/rtpengine-recording.sample.conf /etc/rtpengine/
recording-daemon/rtpengine-recording /usr/sbin/

+ 1
- 0
pkg/deb/bookworm/rtpengine-recording-daemon.links View File

@ -0,0 +1 @@
/lib/systemd/system/rtpengine-recording-daemon.service /lib/systemd/system/rtpengine-recording.service

+ 1
- 0
pkg/deb/bookworm/rtpengine-recording-daemon.manpages View File

@ -0,0 +1 @@
recording-daemon/rtpengine-recording.8

+ 20
- 0
pkg/deb/bookworm/rtpengine-recording-daemon.ngcp-rtpengine-recording-nfs-mount.service View File

@ -0,0 +1,20 @@
[Unit]
Description=NGCP RTP/media Recording Daemon NFS mount point
After=network-online.target
After=remote-fs.target
After=rpcbind.socket
After=rpcbind.service
After=nfs-client.target
Requires=network-online.target
Requires=rpcbind.socket
Requires=rpcbind.service
Requires=nfs-client.target
[Service]
Type=simple
RemainAfterExit=yes
ExecStart=/usr/sbin/rtpengine-recording-nfs-setup start
ExecStop=/usr/sbin/rtpengine-recording-nfs-setup stop
[Install]
WantedBy=multi-user.target

+ 16
- 0
pkg/deb/bookworm/rtpengine-recording-daemon.service View File

@ -0,0 +1,16 @@
[Unit]
Description=NGCP RTP/media Recording Daemon
After=network-online.target
After=remote-fs.target
After=rtpengine-recording-nfs-mount.service
Requires=network-online.target
Requires=rtpengine-recording-nfs-mount.service
[Service]
Type=notify
LimitNOFILE=100000
PIDFile=/run/rtpengine-recording-daemon.pid
ExecStart=/usr/sbin/rtpengine-recording -f -E --no-log-timestamps --pidfile /run/rtpengine-recording-daemon.pid --config-file /etc/rtpengine/rtpengine-recording.conf
[Install]
WantedBy=multi-user.target

+ 42
- 0
pkg/deb/bookworm/rtpengine-recording-nfs-setup View File

@ -0,0 +1,42 @@
#!/bin/sh
set -e
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DEFAULTS=/etc/default/rtpengine-recording-daemon
DESC="RTP engine recording NFS share"
. /lib/lsb/init-functions
# Load startup options if available
if [ -f "$DEFAULTS" ]; then
. "$DEFAULTS" || true
fi
[ -z "$NFS_OPTIONS" ] && NFS_OPTIONS="hard,tcp,intr"
###
case "$1" in
start)
if [ "$MUST_NFS" = yes ]; then
if ! grep -E -q "^[^ :]+:[^ :]+ $NFS_LOCAL_MOUNT nfs.? " /proc/mounts; then
log_action_msg "Mounting $DESC"
test -d "$NFS_LOCAL_MOUNT" || mkdir -p "$NFS_LOCAL_MOUNT"
mount -t nfs -o "$NFS_OPTIONS" "$NFS_HOST:$NFS_REMOTE_PATH" "$NFS_LOCAL_MOUNT"
fi
fi
;;
stop)
if grep -E -q "^[^ :]+:[^ :]+ $NFS_LOCAL_MOUNT nfs.? " /proc/mounts; then
log_action_msg "Unmounting $DESC"
umount "$NFS_LOCAL_MOUNT"
fi
;;
*)
echo "Usage: $0 {start|stop}" >&2
exit 1
;;
esac
exit 0

+ 4
- 0
pkg/deb/bookworm/rtpengine-utils.install View File

@ -0,0 +1,4 @@
perl/* /usr/share/perl5/
utils/rtpengine-ctl /usr/sbin/
utils/rtpengine-get-table /usr/libexec/rtpengine/
utils/rtpengine-ng-client /usr/sbin/

+ 2
- 0
pkg/deb/bookworm/rtpengine.docs View File

@ -0,0 +1,2 @@
debian/README.html.gz
debian/README.md.gz

+ 70
- 0
pkg/deb/bookworm/rules View File

@ -0,0 +1,70 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1
include /usr/share/dpkg/pkg-info.mk
## kernel package specific stuff
# Name of the source package
psource:=rtpengine-kernel-source
# Name of the dkms package
pdkms:=rtpengine-kernel-dkms
# short upstream name, used for module source directory
sname:=rtpengine
# Source version
sversion:=$(DEB_VERSION_UPSTREAM)
## end of kernel package specific stuff
XTABLES_DIR:=$(shell pkg-config xtables --variable=xtlibdir || echo /lib/xtables)
ifneq (,$(filter $(DEB_BUILD_PROFILES),pkg.rtpengine.no-transcoding))
export with_transcoding = no
endif
ifneq (,$(filter $(DEB_BUILD_PROFILES),pkg.rtpengine.asan))
export DO_ASAN_FLAGS = 1
# this prevents dh from setting default (including -O2) which we don't want
export DEB_CFLAGS_MAINT_SET =
export DEB_LDFLAGS_MAINT_SET =
endif
%:
dh $@
override_dh_auto_install-indep:
# Create the directories to install the source into
dh_installdirs -p$(psource) usr/src/modules/$(sname)/debian
dh_installdirs -p$(pdkms) usr/src/$(sname)-$(sversion)
# Copy only the driver source to the proper locations
cd kernel-module && cp Makefile *.c *.h ../debian/$(psource)/usr/src/modules/$(sname)
cd kernel-module && cp Makefile *.c *.h ../debian/$(pdkms)/usr/src/$(sname)-$(sversion)
# Copy the needed debian/ pieces to the proper location
cp debian/*.modules.in* debian/$(psource)/usr/src/modules/$(sname)/debian
cp debian/control debian/changelog debian/copyright \
debian/$(psource)/usr/src/modules/$(sname)/debian/
install -m 0755 debian/rules.modules debian/$(psource)/usr/src/modules/$(sname)/debian/rules
cd debian/$(psource)/usr/src && tar c modules | bzip2 -9 > $(sname).tar.bz2 && rm -rf modules
# Prepare dkms.conf from the dkms.conf.in template
sed "s/__VERSION__/$(sversion)/g" debian/dkms.conf.in > debian/$(pdkms)/usr/src/$(sname)-$(sversion)/dkms.conf
# markdown README
markdown README.md | gzip -9 > debian/README.html.gz
gzip -9 < README.md > debian/README.md.gz
dh_auto_install
override_dh_install:
dh_install
dh_installdirs -prtpengine-iptables $(XTABLES_DIR)
install -m 0644 iptables-extension/libxt_RTPENGINE.so debian/rtpengine-iptables/$(XTABLES_DIR)
override_dh_dwz:
# Disable, as dwz cannot cope with some of the plugins generated.
override_dh_installsystemd:
dh_installsystemd
dh_installsystemd -prtpengine-recording-daemon --name=rtpengine-recording-nfs-mount

+ 82
- 0
pkg/deb/bookworm/rules.modules View File

@ -0,0 +1,82 @@
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
CFLAGS ?= -g -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wstrict-prototypes
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
# Name of the source package
psource:=rtpengine-kernel-source
# The short upstream name, used for the module source directory
sname:=rtpengine
### KERNEL SETUP
### Setup the stuff needed for making kernel module packages
### taken from /usr/share/kernel-package/sample.module.rules
# prefix of the target package name
PACKAGE=rtpengine-kernel-modules
# modifieable for experiments or debugging m-a
MA_DIR ?= /usr/share/modass
# load generic variable handling
-include $(MA_DIR)/include/generic.make
# load default rules, including kdist, kdist_image, ...
-include $(MA_DIR)/include/common-rules.make
# module assistant calculates all needed things for us and sets
# following variables:
# KSRC (kernel source directory), KVERS (kernel version string), KDREV
# (revision of the Debian kernel-image package), CC (the correct
# compiler), VERSION (the final package version string), PKGNAME (full
# package name with KVERS included), DEB_DESTDIR (path to store DEBs)
# The kdist_configure target is called by make-kpkg modules_config and
# by kdist* rules by dependency. It should configure the module so it is
# ready for compilation (mostly useful for calling configure).
# prep-deb-files from module-assistant creates the necessary debian/ files
kdist_configure: prep-deb-files
# the kdist_clean target is called by make-kpkg modules_clean and from
# kdist* rules. It is responsible for cleaning up any changes that have
# been made by the other kdist_commands (except for the .deb files created)
kdist_clean: clean
$(MAKE) $(MFLAGS) -f debian/rules clean
#
### end KERNEL SETUP
# the binary-modules rule is invoked by module-assistant while processing the
# kdist* targets. It is called by module-assistant or make-kpkg and *not*
# during a normal build
binary-modules: prep-deb-files
dh_testroot
dh_prep
# Build the module
$(MAKE) modules KSRC=$(KSRC) KVER=$(KVERS)
# Install the module
install -D -m 0644 xt_RTPENGINE.ko debian/$(PACKAGE)-$(KVERS)/lib/modules/$(KVERS)/extra/xt_RTPENGINE.ko
dh_installdocs
dh_installchangelogs
dh_compress
dh_fixperms
dh_installmodules
dh_installdeb
dh_gencontrol -- -v$(VERSION)
dh_md5sums
dh_builddeb --destdir=$(DEB_DESTDIR)
clean:
dh_testdir
$(MAKE) clean
dh_clean
.PHONY: clean binary-modules kdist kdist_configure kdist_image kdist_clean

+ 1
- 0
pkg/deb/bookworm/source/format View File

@ -0,0 +1 @@
3.0 (quilt)

+ 1
- 0
pkg/deb/bookworm/source/options View File

@ -0,0 +1 @@
extend-diff-ignore=.gitreview

+ 15
- 0
pkg/deb/bullseye/.gitignore View File

@ -0,0 +1,15 @@
*.debhelper
*.log
*.substvars
/.debhelper/
/debhelper-build-stamp
/files
/rtpengine-daemon/
/rtpengine-iptables/
/rtpengine-kernel-dkms/
/rtpengine-kernel-source/
/rtpengine-recording-daemon/
/rtpengine-utils/
/rtpengine/
README.html.gz
README.md.gz

+ 2
- 0
pkg/deb/bullseye/clean View File

@ -0,0 +1,2 @@
debian/README.html.gz
debian/README.md.gz

+ 147
- 0
pkg/deb/bullseye/control View File

@ -0,0 +1,147 @@
Source: rtpengine
Section: net
Priority: optional
Maintainer: Sipwise Development Team <support@sipwise.com>
Homepage: https://www.sipwise.com/
Standards-Version: 3.9.8
Build-Depends:
debhelper-compat (= 12),
default-libmysqlclient-dev,
gperf,
libavcodec-dev (>= 6:10),
libavfilter-dev (>= 6:10),
libavformat-dev (>= 6:10),
libavutil-dev (>= 6:10),
libbcg729-dev <!pkg.rtpengine.nobcg729>,
libbencode-perl,
libcrypt-openssl-rsa-perl,
libcrypt-rijndael-perl,
libcurl4-openssl-dev | libcurl4-gnutls-dev,
libdigest-crc-perl,
libdigest-hmac-perl,
libevent-dev (>= 2.0),
libglib2.0-dev (>= 2.30),
libhiredis-dev,
libio-multiplex-perl,
libio-socket-inet6-perl,
libio-socket-ip-perl,
libiptc-dev,
libjson-glib-dev,
libmosquitto-dev,
libnet-interface-perl,
libpcap0.8-dev,
libpcre3-dev,
libsocket6-perl,
libspandsp-dev,
libssl-dev (>= 1.0.1),
libswresample-dev (>= 6:10),
libsystemd-dev,
libwebsockets-dev,
libxmlrpc-core-c3-dev (>= 1.16.07),
libxtables-dev (>= 1.4) | iptables-dev (>= 1.4),
markdown,
python3,
python3-websockets,
zlib1g-dev,
Package: rtpengine-daemon
Architecture: any
Recommends:
rtpengine-recording-daemon,
rtpengine-utils,
Depends:
iptables,
lsb-base (>= 3.0-6),
${misc:Depends},
${shlibs:Depends},
Conflicts:
ngcp-rtpengine-daemon,
Description: proxy for RTP and media streams used in NGCP, userspace part
This daemon handles the first stages of proxying media streams and talks to
the kernel part of the proxy for eventual high-performance packet forwarding.
Package: rtpengine-recording-daemon
Architecture: any
Build-Profiles: <!pkg.rtpengine.no-transcoding>
Recommends:
rtpengine-utils,
Depends:
lsb-base (>= 3.0-6),
nfs-common,
${misc:Depends},
${shlibs:Depends},
Conflicts:
ngcp-rtpengine-recording-daemon,
Description: recording daemon for RTP and media streams
This daemon handles the call recording (media intercept) component of rtpengine.
Package: rtpengine-iptables
Architecture: any
Depends:
${misc:Depends},
${shlibs:Depends},
Conflicts:
ngcp-rtpengine-iptables,
Description: IPtables extension module for the kernel-space NGCP media proxy
Provides the IPtables extension needed to configure the mediaproxy rule.
Package: rtpengine
Architecture: all
Depends:
rtpengine-daemon (>= ${source:Version}),
rtpengine-iptables (>= ${source:Version}),
rtpengine-kernel-dkms (>= ${source:Version}),
rtpengine-recording-daemon (>= ${source:Version}),
rtpengine-utils (>= ${source:Version}),
${misc:Depends},
Description: NGCP RTP/media proxy - meta package
This is a meta package for easy installation of all four parts of the NGCP
media proxy. It will install the user-space daemon, the kernel-space IPtables
module, the IPtables extension module and utility scripts.
Package: rtpengine-kernel-source
Architecture: all
Section: kernel
Depends:
debhelper-compat (= 12),
module-assistant,
${misc:Depends},
Conflicts:
ngcp-rtpengine-kernel-source,
Description: IPtables kernel module for the NGCP media proxy - source
Provides the kernel-space part of the NGCP media proxy for high-
performance packet forwarding.
This package contains the source to be built with module-assistant or
kernel-package.
Package: rtpengine-kernel-dkms
Architecture: all
Section: kernel
Depends:
dkms (>= 1.95),
lsb-release,
${misc:Depends},
Conflicts:
ngcp-rtpengine-kernel-dkms,
Description: IPtables kernel module for the NGCP media proxy - DKMS
Provides the kernel-space part of the NGCP media proxy for high-
performance packet forwarding.
This package contains the source to be built with dkms.
Package: rtpengine-utils
Architecture: all
Depends:
libbencode-perl,
libconfig-tiny-perl,
libcrypt-rijndael-perl,
libdigest-hmac-perl,
libio-socket-inet6-perl,
libio-socket-ip-perl,
libsocket6-perl,
netcat-openbsd | netcat,
${misc:Depends},
${perl:Depends},
Conflicts:
ngcp-rtpengine-utils,
Description: scripts and Perl modules for NGCP rtpengine
This package contains scripts and Perl modules for NGCP rtpengine

+ 18
- 0
pkg/deb/bullseye/control.modules.in View File

@ -0,0 +1,18 @@
Source: rtpengine
Section: kernel
Priority: optional
Maintainer: Sipwise Development Team <support@sipwise.com>
Build-Depends:
debhelper-compat (= 12),
Standards-Version: 3.9.8
Homepage: https://www.sipwise.com/
Package: rtpengine-kernel-modules-_KVERS_
Architecture: any
Depends:
linux-modules-_KVERS_ | linux-image-_KVERS_,
Conflicts:
ngcp-rtpengine-kernel-modules-_KVERS_,
Description: IPtables kernel module for the NGCP media proxy
This package provides the rtpengine module for
the Linux kernel version _KVERS_.

+ 36
- 0
pkg/deb/bullseye/copyright View File

@ -0,0 +1,36 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://www.sipwise.com/
Upstream-Contact: Sipwise Development Team <support@sipwise.com>
Files: *
Copyright:
Copyright © 2007-2019 Sipwise GmbH, Austria
License: GPL-3+ with OpenSSL exception
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
In addition, as a special exception, the copyright holders give
permission to link the code of this release with the OpenSSL project's
"OpenSSL" library (or with modified versions of it that use the same
license as the "OpenSSL" library), and distribute the linked executables.
.
You must obey the GNU General Public License in all respects for all
of the code used other than "OpenSSL". If you modify file(s) with this
exception, you may extend this exception to your version of the file(s),
but you are not obligated to do so. If you do not wish to do so,
delete this exception statement from your version. If you delete
this exception statement from all source files in the program, then
also delete it here.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Comment:
On Debian systems, the full text of the GNU General Public License
version 3 can be found in the file '/usr/share/common-licenses/GPL-3'.

+ 7
- 0
pkg/deb/bullseye/dkms.conf.in View File

@ -0,0 +1,7 @@
PACKAGE_NAME="rtpengine"
PACKAGE_VERSION="__VERSION__"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build RTPENGINE_VERSION=\"__VERSION__\""
CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
AUTOINSTALL=yes
BUILT_MODULE_NAME[0]="xt_RTPENGINE"
DEST_MODULE_LOCATION[0]=/extra

+ 6
- 0
pkg/deb/bullseye/rtpengine-daemon.default View File

@ -0,0 +1,6 @@
CONFIG_FILE=/etc/rtpengine/rtpengine.conf
# CONFIG_SECTION=rtpengine
PIDFILE=/run/rtpengine-daemon.pid
MANAGE_IPTABLES=yes
#SET_USER=root
#SET_GROUP=root # GROUP only needs to be set if USER is not set or if the user isn't in the group

+ 117
- 0
pkg/deb/bullseye/rtpengine-daemon.init View File

@ -0,0 +1,117 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: rtpengine-daemon
# Required-Start: $network $local_fs $remote_fs $syslog
# Required-Stop: $network $local_fs $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Ngcp Rtpengine
# Description: Proxy for RTP and other media streams
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=rtpengine-daemon
DESC="RTP/media proxy"
DAEMON=$(which rtpengine)
DEFAULTS=/etc/default/${NAME}
test -f "$DAEMON" || exit 0
. /lib/lsb/init-functions
# Load startup options if available
if [ -f "$DEFAULTS" ]; then
. "$DEFAULTS" || true
fi
[ -z "$PIDFILE" ] && PIDFILE="/run/rtpengine.pid"
OPTIONS=""
START_OPTIONS=""
[ -z "$CONFIG_FILE" ] || OPTIONS="$OPTIONS --config-file=$CONFIG_FILE"
[ -z "$CONFIG_SECTION" ] || OPTIONS="$OPTIONS --config-section=$CONFIG_SECTION"
[ -z "$PIDFILE" ] || OPTIONS="$OPTIONS --pidfile=$PIDFILE"
if test "$FORK" = "no" ; then
OPTIONS="$OPTIONS --foreground"
fi
# check if directory for pid file needs to be created
PIDDIR=$(dirname "$PIDFILE")
DO_DIR_CHOWN=0
if ! test -z "$PIDDIR" && ! test -d "$PIDDIR"; then
mkdir -p "$PIDDIR"
DO_DIR_CHOWN=1
fi
# handle requested setuid/setgid
if ! test -z "$SET_USER"; then
START_OPTIONS="$START_OPTIONS --chuid $SET_USER"
test "$DO_DIR_CHOWN" = 1 && chown "$SET_USER": "$PIDDIR"
fi
if ! test -z "$SET_GROUP"; then
START_OPTIONS="$START_OPTIONS --group $SET_GROUP"
test "$DO_DIR_CHOWN" = 1 && chgrp "$SET_GROUP" "$PIDDIR"
fi
###
case "$1" in
start)
if [ -x "$(which ngcp-check-active)" ]; then
case "$(ngcp-check-active -v)" in
active|transition)
log_action_msg "Active node or transition."
;;
*)
log_action_msg "Ignored start action in inactive node"
exit 0
;;
esac
fi
RC=0
rtpengine-iptables-setup start || RC=$?
if [ "$RC" -ne 0 ]; then
log_action_msg "Failed to start rtpengine-iptables-setup"
log_end_msg "$RC"
exit 1
fi
log_daemon_msg "Starting $DESC" "$NAME"
# shellcheck disable=SC2086
start-stop-daemon --start --quiet --pidfile "$PIDFILE" \
--exec "$DAEMON" $START_OPTIONS -- $OPTIONS || log_progress_msg " already running"
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
RC=0
start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
--retry 5 --exec "$DAEMON" || RC=$?
if [ "$RC" -eq 0 ]; then
rtpengine-iptables-setup stop || true
fi
rm -f "$PIDFILE"
log_end_msg "$RC"
exit "$RC"
;;
restart|force-reload)
$0 stop
$0 start
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0

+ 3
- 0
pkg/deb/bullseye/rtpengine-daemon.install View File

@ -0,0 +1,3 @@
daemon/rtpengine /usr/sbin/
debian/rtpengine-iptables-setup /usr/sbin
etc/rtpengine.sample.conf /etc/rtpengine/

+ 1
- 0
pkg/deb/bullseye/rtpengine-daemon.links View File

@ -0,0 +1 @@
/lib/systemd/system/rtpengine-daemon.service /lib/systemd/system/rtpengine.service

+ 1
- 0
pkg/deb/bullseye/rtpengine-daemon.manpages View File

@ -0,0 +1 @@
daemon/rtpengine.8

+ 38
- 0
pkg/deb/bullseye/rtpengine-daemon.postinst View File

@ -0,0 +1,38 @@
#!/bin/sh
set -e
default=/etc/default/rtpengine-daemon
modname=xt_RTPENGINE
if [ -x "$(which ngcp-virt-identify)" ]; then
if ngcp-virt-identify --type container; then
VIRT="yes"
fi
fi
if [ "$VIRT" = "yes" ]; then
echo "Container environment detected. Skip kernel module check"
else
if [ -f $default ]; then
. $default || true
fi
if [ -n "$TABLE" ] && [ "$TABLE" -ge 0 ] && \
[ -n "$NO_FALLBACK" ] && \
{ [ "$NO_FALLBACK" = "1" ] || [ "$NO_FALLBACK" = "yes" ] ; }
then
if lsmod | grep -q $modname || modinfo $modname > /dev/null 2> /dev/null; then
true
else
echo "Kernel module $modname not found and NO_FALLBACK is set."
echo "Daemon restart not performed."
exit 0
fi
fi
fi
#DEBHELPER#
exit 0

+ 16
- 0
pkg/deb/bullseye/rtpengine-daemon.service View File

@ -0,0 +1,16 @@
[Unit]
Description=NGCP RTP/media Proxy Daemon
After=network-online.target
After=remote-fs.target
Requires=network-online.target
[Service]
Type=notify
EnvironmentFile=/etc/default/rtpengine-daemon
PIDFile=/run/rtpengine-daemon.pid
ExecStartPre=/usr/sbin/rtpengine-iptables-setup start
ExecStart=/usr/sbin/rtpengine -f -E --no-log-timestamps --pidfile /run/rtpengine-daemon.pid --config-file /etc/rtpengine/rtpengine.conf
ExecStopPost=/usr/sbin/rtpengine-iptables-setup stop
[Install]
WantedBy=multi-user.target

+ 1
- 0
pkg/deb/bullseye/rtpengine-dev.install View File

@ -0,0 +1 @@
daemon/*.h /usr/include/rtpengine/

+ 101
- 0
pkg/deb/bullseye/rtpengine-iptables-setup View File

@ -0,0 +1,101 @@
#!/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MODNAME=xt_RTPENGINE
MANAGE_IPTABLES=yes
DEFAULTS=/etc/default/rtpengine-daemon
# Load startup options if available
if [ -f "$DEFAULTS" ]; then
. "$DEFAULTS" || true
fi
MODPROBE_OPTIONS=""
TABLE=$(/usr/libexec/rtpengine/rtpengine-get-table --config-file="${CONFIG_FILE-/etc/rtpengine/rtpengine.conf}")
# Handle requested setuid/setgid.
if ! test -z "$SET_USER"; then
PUID=$(id -u "$SET_USER" 2> /dev/null)
test -z "$PUID" || MODPROBE_OPTIONS="$MODPROBE_OPTIONS proc_uid=$PUID"
if test -z "$SET_GROUP"; then
PGID=$(id -g "$SET_USER" 2> /dev/null)
test -z "$PGID" || MODPROBE_OPTIONS="$MODPROBE_OPTIONS proc_gid=$PGID"
fi
fi
if ! test -z "$SET_GROUP"; then
PGID=$(grep "^$SET_GROUP:" /etc/group | cut -d: -f3 2> /dev/null)
test -z "$PGID" || MODPROBE_OPTIONS="$MODPROBE_OPTIONS proc_gid=$PGID"
fi
###
if [ -x "$(which ngcp-virt-identify 2>/dev/null)" ]; then
if ngcp-virt-identify --type container; then
VIRT="yes"
fi
fi
firewall_setup()
{
if [ "$TABLE" -lt 0 ] || [ "$VIRT" = "yes" ]; then
return
fi
if [ "$MANAGE_IPTABLES" != "yes" ]; then
return
fi
# shellcheck disable=SC2086
modprobe $MODNAME $MODPROBE_OPTIONS
iptables -N rtpengine 2>/dev/null
iptables -D INPUT -j rtpengine 2>/dev/null
iptables -D INPUT -p udp -j rtpengine 2>/dev/null
iptables -I INPUT -p udp -j rtpengine
iptables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null
iptables -I rtpengine -p udp -j RTPENGINE --id "$TABLE"
ip6tables -N rtpengine 2>/dev/null
ip6tables -D INPUT -j rtpengine 2>/dev/null
ip6tables -D INPUT -p udp -j rtpengine 2>/dev/null
ip6tables -I INPUT -p udp -j rtpengine
ip6tables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null
ip6tables -I rtpengine -p udp -j RTPENGINE --id "$TABLE"
}
firewall_teardown()
{
if [ "$TABLE" -lt 0 ] || [ "$VIRT" = "yes" ]; then
return
fi
# XXX: Wait a bit to make sure the daemon has been stopped.
sleep 1
if [ -e /proc/rtpengine/control ]; then
echo "del $TABLE" >/proc/rtpengine/control 2>/dev/null
fi
if [ "$MANAGE_IPTABLES" != "yes" ]; then
return
fi
iptables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null
ip6tables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null
}
case "$1" in
start)
firewall_setup
;;
stop)
firewall_teardown
;;
*)
echo "Usage: $0 {start|stop}" >&2
exit 1
;;
esac
exit 0

+ 46
- 0
pkg/deb/bullseye/rtpengine-kernel-dkms.postinst View File

@ -0,0 +1,46 @@
#!/bin/sh
set -e
package=rtpengine-kernel-dkms
name=rtpengine
version=$(dpkg-query -W -f="\${Version}" "$package" \
|rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n")
if [ -x "$(which ngcp-virt-identify)" ]; then
if ngcp-virt-identify --type container; then
VIRT="yes"
fi
fi
if [ "$VIRT" = "yes" ]; then
echo "Container environment detected. Skip dkms"
else
isadded=$(dkms status -m "$name" -v "$version")
if [ -z "${isadded}" ] ; then
dkms add -m "$name" -v "$version"
fi
if [ "$1" = 'configure' ] ; then
KERNELS=$(ls /lib/modules/ 2>/dev/null || true)
for kernel in $KERNELS; do
if [ ! -r "/lib/modules/$kernel/build" ]; then
# cannot build modules for this kernel
continue
fi
( dkms build -m "$name" -v "$version" -k "$kernel" && dkms install -m "$name" -v "$version" -k "$kernel" ) || true
done
# try to start the daemon
if [ -x /etc/init.d/rtpengine-daemon ] ; then
invoke-rc.d rtpengine-daemon restart || true
fi
fi
fi
#DEBHELPER#
exit 0

+ 32
- 0
pkg/deb/bullseye/rtpengine-kernel-dkms.prerm View File

@ -0,0 +1,32 @@
#!/bin/sh
set -e
package=rtpengine-kernel-dkms
name=rtpengine
modname=xt_RTPENGINE
version=$(dpkg-query -W -f="\${Version}" "$package" \
|rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n")
if [ -x "$(which ngcp-virt-identify)" ]; then
if ngcp-virt-identify --type container; then
VIRT="yes"
fi
fi
# make sure it's not running
if [ -x /etc/init.d/rtpengine-daemon ] ; then
invoke-rc.d rtpengine-daemon stop || true
rmmod "$modname" 2>/dev/null || true
fi
if [ "$VIRT" = "yes" ]; then
echo "Container environment detected. Skip dkms"
else
dkms remove -m "$name" -v "$version" --all || true
fi
#DEBHELPER#
exit 0

+ 1
- 0
pkg/deb/bullseye/rtpengine-kernel-source.links View File

@ -0,0 +1 @@
/usr/share/modass/packages/default.sh /usr/share/modass/overrides/rtpengine-kernel-source

+ 11
- 0
pkg/deb/bullseye/rtpengine-recording-daemon.default View File

@ -0,0 +1,11 @@
CONFIG_FILE=/etc/rtpengine/rtpengine-recording.conf
# CONFIG_SECTION=rtpengine-recording
PIDFILE=/run/rtpengine-recording-daemon.pid
#SET_USER=root
#SET_GROUP=root # GROUP only needs to be set if USER is not set or if the user isn't in the group
#
MUST_NFS=no
NFS_HOST=192.168.1.1
NFS_REMOTE_PATH=/var/recordings
NFS_LOCAL_MOUNT=/var/lib/rtpengine-recording # must match output-dir if used
NFS_OPTIONS=hard,intr,tcp

+ 2
- 0
pkg/deb/bullseye/rtpengine-recording-daemon.dirs View File

@ -0,0 +1,2 @@
var/lib/rtpengine-recording
var/spool/rtpengine

+ 112
- 0
pkg/deb/bullseye/rtpengine-recording-daemon.init View File

@ -0,0 +1,112 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: rtpengine-recording-daemon
# Required-Start: $network $local_fs $remote_fs $syslog
# Required-Stop: $network $local_fs $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Ngcp Rtpengine Recording Daemon
# Description: Recording daemon for RTP and other media streams
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=rtpengine-recording-daemon
DESC="RTP/media recording daemon"
DAEMON=$(which rtpengine-recording)
DEFAULTS=/etc/default/${NAME}
test -f "$DAEMON" || exit 0
. /lib/lsb/init-functions
# Load startup options if available
if [ -f "$DEFAULTS" ]; then
. "$DEFAULTS" || true
fi
[ -z "$PIDFILE" ] && PIDFILE="/run/rtpengine-recording.pid"
OPTIONS=""
START_OPTIONS=""
[ -z "$CONFIG_FILE" ] || OPTIONS="$OPTIONS --config-file=$CONFIG_FILE"
[ -z "$PIDFILE" ] || OPTIONS="$OPTIONS --pidfile=$PIDFILE"
# check if directory for pid file needs to be created
PIDDIR=$(dirname "$PIDFILE")
DO_DIR_CHOWN=0
if ! test -z "$PIDDIR" && ! test -d "$PIDDIR"; then
mkdir -p "$PIDDIR"
DO_DIR_CHOWN=1
fi
# handle requested setuid/setgid
if ! test -z "$SET_USER"; then
START_OPTIONS="$START_OPTIONS --chuid $SET_USER"
test "$DO_DIR_CHOWN" = 1 && chown "$SET_USER": "$PIDDIR"
fi
if ! test -z "$SET_GROUP"; then
START_OPTIONS="$START_OPTIONS --group $SET_GROUP"
test "$DO_DIR_CHOWN" = 1 && chgrp "$SET_GROUP" "$PIDDIR"
fi
###
case "$1" in
start)
if [ -x "$(which ngcp-check-active)" ]; then
case "$(ngcp-check-active -v)" in
active|transition)
log_action_msg "Active node or transition."
;;
*)
log_action_msg "Ignored start action in inactive node"
exit 0
;;
esac
fi
RC=0
rtpengine-recording-nfs-setup start || RC=$?
if [ "$RC" -ne 0 ] ; then
log_action_msg "Failed to start rtpengine-recording-nfs-setup"
log_end_msg "$RC"
exit "$RC"
fi
log_daemon_msg "Starting $DESC" "$NAME"
# shellcheck disable=SC2086
start-stop-daemon --start --quiet --pidfile "$PIDFILE" \
--exec "$DAEMON" $START_OPTIONS -- $OPTIONS || log_progress_msg " already running"
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
RC=0
start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
--retry 5 --exec "$DAEMON" || RC=$?
rm -f "$PIDFILE"
log_end_msg "$RC"
exit "$RC"
;;
force-reload|restart)
$0 stop
$0 start
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0

+ 3
- 0
pkg/deb/bullseye/rtpengine-recording-daemon.install View File

@ -0,0 +1,3 @@
debian/rtpengine-recording-nfs-setup /usr/sbin/
etc/rtpengine-recording.sample.conf /etc/rtpengine/
recording-daemon/rtpengine-recording /usr/sbin/

+ 1
- 0
pkg/deb/bullseye/rtpengine-recording-daemon.links View File

@ -0,0 +1 @@
/lib/systemd/system/rtpengine-recording-daemon.service /lib/systemd/system/rtpengine-recording.service

+ 1
- 0
pkg/deb/bullseye/rtpengine-recording-daemon.manpages View File

@ -0,0 +1 @@
recording-daemon/rtpengine-recording.8

+ 20
- 0
pkg/deb/bullseye/rtpengine-recording-daemon.ngcp-rtpengine-recording-nfs-mount.service View File

@ -0,0 +1,20 @@
[Unit]
Description=NGCP RTP/media Recording Daemon NFS mount point
After=network-online.target
After=remote-fs.target
After=rpcbind.socket
After=rpcbind.service
After=nfs-client.target
Requires=network-online.target
Requires=rpcbind.socket
Requires=rpcbind.service
Requires=nfs-client.target
[Service]
Type=simple
RemainAfterExit=yes
ExecStart=/usr/sbin/rtpengine-recording-nfs-setup start
ExecStop=/usr/sbin/rtpengine-recording-nfs-setup stop
[Install]
WantedBy=multi-user.target

+ 16
- 0
pkg/deb/bullseye/rtpengine-recording-daemon.service View File

@ -0,0 +1,16 @@
[Unit]
Description=NGCP RTP/media Recording Daemon
After=network-online.target
After=remote-fs.target
After=rtpengine-recording-nfs-mount.service
Requires=network-online.target
Requires=rtpengine-recording-nfs-mount.service
[Service]
Type=notify
LimitNOFILE=100000
PIDFile=/run/rtpengine-recording-daemon.pid
ExecStart=/usr/sbin/rtpengine-recording -f -E --no-log-timestamps --pidfile /run/rtpengine-recording-daemon.pid --config-file /etc/rtpengine/rtpengine-recording.conf
[Install]
WantedBy=multi-user.target

+ 42
- 0
pkg/deb/bullseye/rtpengine-recording-nfs-setup View File

@ -0,0 +1,42 @@
#!/bin/sh
set -e
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DEFAULTS=/etc/default/rtpengine-recording-daemon
DESC="RTP engine recording NFS share"
. /lib/lsb/init-functions
# Load startup options if available
if [ -f "$DEFAULTS" ]; then
. "$DEFAULTS" || true
fi
[ -z "$NFS_OPTIONS" ] && NFS_OPTIONS="hard,tcp,intr"
###
case "$1" in
start)
if [ "$MUST_NFS" = yes ]; then
if ! grep -E -q "^[^ :]+:[^ :]+ $NFS_LOCAL_MOUNT nfs.? " /proc/mounts; then
log_action_msg "Mounting $DESC"
test -d "$NFS_LOCAL_MOUNT" || mkdir -p "$NFS_LOCAL_MOUNT"
mount -t nfs -o "$NFS_OPTIONS" "$NFS_HOST:$NFS_REMOTE_PATH" "$NFS_LOCAL_MOUNT"
fi
fi
;;
stop)
if grep -E -q "^[^ :]+:[^ :]+ $NFS_LOCAL_MOUNT nfs.? " /proc/mounts; then
log_action_msg "Unmounting $DESC"
umount "$NFS_LOCAL_MOUNT"
fi
;;
*)
echo "Usage: $0 {start|stop}" >&2
exit 1
;;
esac
exit 0

+ 4
- 0
pkg/deb/bullseye/rtpengine-utils.install View File

@ -0,0 +1,4 @@
perl/* /usr/share/perl5/
utils/rtpengine-ctl /usr/sbin/
utils/rtpengine-get-table /usr/libexec/rtpengine/
utils/rtpengine-ng-client /usr/sbin/

+ 2
- 0
pkg/deb/bullseye/rtpengine.docs View File

@ -0,0 +1,2 @@
debian/README.html.gz
debian/README.md.gz

+ 70
- 0
pkg/deb/bullseye/rules View File

@ -0,0 +1,70 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1
include /usr/share/dpkg/pkg-info.mk
## kernel package specific stuff
# Name of the source package
psource:=rtpengine-kernel-source
# Name of the dkms package
pdkms:=rtpengine-kernel-dkms
# short upstream name, used for module source directory
sname:=rtpengine
# Source version
sversion:=$(DEB_VERSION_UPSTREAM)
## end of kernel package specific stuff
XTABLES_DIR:=$(shell pkg-config xtables --variable=xtlibdir || echo /lib/xtables)
ifneq (,$(filter $(DEB_BUILD_PROFILES),pkg.rtpengine.no-transcoding))
export with_transcoding = no
endif
ifneq (,$(filter $(DEB_BUILD_PROFILES),pkg.rtpengine.asan))
export DO_ASAN_FLAGS = 1
# this prevents dh from setting default (including -O2) which we don't want
export DEB_CFLAGS_MAINT_SET =
export DEB_LDFLAGS_MAINT_SET =
endif
%:
dh $@
override_dh_auto_install-indep:
# Create the directories to install the source into
dh_installdirs -p$(psource) usr/src/modules/$(sname)/debian
dh_installdirs -p$(pdkms) usr/src/$(sname)-$(sversion)
# Copy only the driver source to the proper locations
cd kernel-module && cp Makefile *.c *.h ../debian/$(psource)/usr/src/modules/$(sname)
cd kernel-module && cp Makefile *.c *.h ../debian/$(pdkms)/usr/src/$(sname)-$(sversion)
# Copy the needed debian/ pieces to the proper location
cp debian/*.modules.in* debian/$(psource)/usr/src/modules/$(sname)/debian
cp debian/control debian/changelog debian/copyright \
debian/$(psource)/usr/src/modules/$(sname)/debian/
install -m 0755 debian/rules.modules debian/$(psource)/usr/src/modules/$(sname)/debian/rules
cd debian/$(psource)/usr/src && tar c modules | bzip2 -9 > $(sname).tar.bz2 && rm -rf modules
# Prepare dkms.conf from the dkms.conf.in template
sed "s/__VERSION__/$(sversion)/g" debian/dkms.conf.in > debian/$(pdkms)/usr/src/$(sname)-$(sversion)/dkms.conf
# markdown README
markdown README.md | gzip -9 > debian/README.html.gz
gzip -9 < README.md > debian/README.md.gz
dh_auto_install
override_dh_install:
dh_install
dh_installdirs -prtpengine-iptables $(XTABLES_DIR)
install -m 0644 iptables-extension/libxt_RTPENGINE.so debian/rtpengine-iptables/$(XTABLES_DIR)
override_dh_dwz:
# Disable, as dwz cannot cope with some of the plugins generated.
override_dh_installsystemd:
dh_installsystemd
dh_installsystemd -prtpengine-recording-daemon --name=rtpengine-recording-nfs-mount

+ 82
- 0
pkg/deb/bullseye/rules.modules View File

@ -0,0 +1,82 @@
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
CFLAGS ?= -g -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wstrict-prototypes
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
# Name of the source package
psource:=rtpengine-kernel-source
# The short upstream name, used for the module source directory
sname:=rtpengine
### KERNEL SETUP
### Setup the stuff needed for making kernel module packages
### taken from /usr/share/kernel-package/sample.module.rules
# prefix of the target package name
PACKAGE=rtpengine-kernel-modules
# modifieable for experiments or debugging m-a
MA_DIR ?= /usr/share/modass
# load generic variable handling
-include $(MA_DIR)/include/generic.make
# load default rules, including kdist, kdist_image, ...
-include $(MA_DIR)/include/common-rules.make
# module assistant calculates all needed things for us and sets
# following variables:
# KSRC (kernel source directory), KVERS (kernel version string), KDREV
# (revision of the Debian kernel-image package), CC (the correct
# compiler), VERSION (the final package version string), PKGNAME (full
# package name with KVERS included), DEB_DESTDIR (path to store DEBs)
# The kdist_configure target is called by make-kpkg modules_config and
# by kdist* rules by dependency. It should configure the module so it is
# ready for compilation (mostly useful for calling configure).
# prep-deb-files from module-assistant creates the necessary debian/ files
kdist_configure: prep-deb-files
# the kdist_clean target is called by make-kpkg modules_clean and from
# kdist* rules. It is responsible for cleaning up any changes that have
# been made by the other kdist_commands (except for the .deb files created)
kdist_clean: clean
$(MAKE) $(MFLAGS) -f debian/rules clean
#
### end KERNEL SETUP
# the binary-modules rule is invoked by module-assistant while processing the
# kdist* targets. It is called by module-assistant or make-kpkg and *not*
# during a normal build
binary-modules: prep-deb-files
dh_testroot
dh_prep
# Build the module
$(MAKE) modules KSRC=$(KSRC) KVER=$(KVERS)
# Install the module
install -D -m 0644 xt_RTPENGINE.ko debian/$(PACKAGE)-$(KVERS)/lib/modules/$(KVERS)/extra/xt_RTPENGINE.ko
dh_installdocs
dh_installchangelogs
dh_compress
dh_fixperms
dh_installmodules
dh_installdeb
dh_gencontrol -- -v$(VERSION)
dh_md5sums
dh_builddeb --destdir=$(DEB_DESTDIR)
clean:
dh_testdir
$(MAKE) clean
dh_clean
.PHONY: clean binary-modules kdist kdist_configure kdist_image kdist_clean

+ 1
- 0
pkg/deb/bullseye/source/format View File

@ -0,0 +1 @@
3.0 (quilt)

+ 1
- 0
pkg/deb/bullseye/source/options View File

@ -0,0 +1 @@
extend-diff-ignore=.gitreview

+ 15
- 0
pkg/deb/buster/.gitignore View File

@ -0,0 +1,15 @@
*.debhelper
*.log
*.substvars
/.debhelper/
/debhelper-build-stamp
/files
/rtpengine-daemon/
/rtpengine-iptables/
/rtpengine-kernel-dkms/
/rtpengine-kernel-source/
/rtpengine-recording-daemon/
/rtpengine-utils/
/rtpengine/
README.html.gz
README.md.gz

+ 2
- 0
pkg/deb/buster/clean View File

@ -0,0 +1,2 @@
debian/README.html.gz
debian/README.md.gz

+ 146
- 0
pkg/deb/buster/control View File

@ -0,0 +1,146 @@
Source: rtpengine
Section: net
Priority: optional
Maintainer: Sipwise Development Team <support@sipwise.com>
Homepage: https://www.sipwise.com/
Standards-Version: 3.9.8
Build-Depends:
debhelper-compat (= 12),
default-libmysqlclient-dev,
gperf,
libavcodec-dev (>= 6:10),
libavfilter-dev (>= 6:10),
libavformat-dev (>= 6:10),
libavutil-dev (>= 6:10),
libbencode-perl,
libcrypt-openssl-rsa-perl,
libcrypt-rijndael-perl,
libcurl4-openssl-dev | libcurl4-gnutls-dev,
libdigest-crc-perl,
libdigest-hmac-perl,
libevent-dev (>= 2.0),
libglib2.0-dev (>= 2.30),
libhiredis-dev,
libio-multiplex-perl,
libio-socket-inet6-perl,
libio-socket-ip-perl,
libiptc-dev,
libjson-glib-dev,
libmosquitto-dev,
libnet-interface-perl,
libpcap0.8-dev,
libpcre3-dev,
libsocket6-perl,
libspandsp-dev,
libssl-dev (>= 1.0.1),
libswresample-dev (>= 6:10),
libsystemd-dev,
libwebsockets-dev,
libxmlrpc-core-c3-dev (>= 1.16.07),
libxtables-dev (>= 1.4) | iptables-dev (>= 1.4),
markdown,
python3,
python3-websockets,
zlib1g-dev,
Package: rtpengine-daemon
Architecture: any
Recommends:
rtpengine-recording-daemon,
rtpengine-utils,
Depends:
iptables,
lsb-base (>= 3.0-6),
${misc:Depends},
${shlibs:Depends},
Conflicts:
ngcp-rtpengine-daemon,
Description: proxy for RTP and media streams used in NGCP, userspace part
This daemon handles the first stages of proxying media streams and talks to
the kernel part of the proxy for eventual high-performance packet forwarding.
Package: rtpengine-recording-daemon
Architecture: any
Build-Profiles: <!pkg.rtpengine.no-transcoding>
Recommends:
rtpengine-utils,
Depends:
lsb-base (>= 3.0-6),
nfs-common,
${misc:Depends},
${shlibs:Depends},
Conflicts:
ngcp-rtpengine-recording-daemon,
Description: recording daemon for RTP and media streams
This daemon handles the call recording (media intercept) component of rtpengine.
Package: rtpengine-iptables
Architecture: any
Depends:
${misc:Depends},
${shlibs:Depends},
Conflicts:
ngcp-rtpengine-iptables,
Description: IPtables extension module for the kernel-space NGCP media proxy
Provides the IPtables extension needed to configure the mediaproxy rule.
Package: rtpengine
Architecture: all
Depends:
rtpengine-daemon (>= ${source:Version}),
rtpengine-iptables (>= ${source:Version}),
rtpengine-kernel-dkms (>= ${source:Version}),
rtpengine-recording-daemon (>= ${source:Version}),
rtpengine-utils (>= ${source:Version}),
${misc:Depends},
Description: NGCP RTP/media proxy - meta package
This is a meta package for easy installation of all four parts of the NGCP
media proxy. It will install the user-space daemon, the kernel-space IPtables
module, the IPtables extension module and utility scripts.
Package: rtpengine-kernel-source
Architecture: all
Section: kernel
Depends:
debhelper-compat (= 12),
module-assistant,
${misc:Depends},
Conflicts:
ngcp-rtpengine-kernel-source,
Description: IPtables kernel module for the NGCP media proxy - source
Provides the kernel-space part of the NGCP media proxy for high-
performance packet forwarding.
This package contains the source to be built with module-assistant or
kernel-package.
Package: rtpengine-kernel-dkms
Architecture: all
Section: kernel
Depends:
dkms (>= 1.95),
lsb-release,
${misc:Depends},
Conflicts:
ngcp-rtpengine-kernel-dkms,
Description: IPtables kernel module for the NGCP media proxy - DKMS
Provides the kernel-space part of the NGCP media proxy for high-
performance packet forwarding.
This package contains the source to be built with dkms.
Package: rtpengine-utils
Architecture: all
Depends:
libbencode-perl,
libconfig-tiny-perl,
libcrypt-rijndael-perl,
libdigest-hmac-perl,
libio-socket-inet6-perl,
libio-socket-ip-perl,
libsocket6-perl,
netcat-openbsd | netcat,
${misc:Depends},
${perl:Depends},
Conflicts:
ngcp-rtpengine-utils,
Description: scripts and Perl modules for NGCP rtpengine
This package contains scripts and Perl modules for NGCP rtpengine

+ 18
- 0
pkg/deb/buster/control.modules.in View File

@ -0,0 +1,18 @@
Source: rtpengine
Section: kernel
Priority: optional
Maintainer: Sipwise Development Team <support@sipwise.com>
Build-Depends:
debhelper-compat (= 12),
Standards-Version: 3.9.8
Homepage: https://www.sipwise.com/
Package: rtpengine-kernel-modules-_KVERS_
Architecture: any
Depends:
linux-modules-_KVERS_ | linux-image-_KVERS_,
Conflicts:
ngcp-rtpengine-kernel-modules-_KVERS_,
Description: IPtables kernel module for the NGCP media proxy
This package provides the rtpengine module for
the Linux kernel version _KVERS_.

+ 36
- 0
pkg/deb/buster/copyright View File

@ -0,0 +1,36 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://www.sipwise.com/
Upstream-Contact: Sipwise Development Team <support@sipwise.com>
Files: *
Copyright:
Copyright © 2007-2019 Sipwise GmbH, Austria
License: GPL-3+ with OpenSSL exception
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
In addition, as a special exception, the copyright holders give
permission to link the code of this release with the OpenSSL project's
"OpenSSL" library (or with modified versions of it that use the same
license as the "OpenSSL" library), and distribute the linked executables.
.
You must obey the GNU General Public License in all respects for all
of the code used other than "OpenSSL". If you modify file(s) with this
exception, you may extend this exception to your version of the file(s),
but you are not obligated to do so. If you do not wish to do so,
delete this exception statement from your version. If you delete
this exception statement from all source files in the program, then
also delete it here.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Comment:
On Debian systems, the full text of the GNU General Public License
version 3 can be found in the file '/usr/share/common-licenses/GPL-3'.

+ 7
- 0
pkg/deb/buster/dkms.conf.in View File

@ -0,0 +1,7 @@
PACKAGE_NAME="rtpengine"
PACKAGE_VERSION="__VERSION__"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build RTPENGINE_VERSION=\"__VERSION__\""
CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
AUTOINSTALL=yes
BUILT_MODULE_NAME[0]="xt_RTPENGINE"
DEST_MODULE_LOCATION[0]=/extra

+ 6
- 0
pkg/deb/buster/rtpengine-daemon.default View File

@ -0,0 +1,6 @@
CONFIG_FILE=/etc/rtpengine/rtpengine.conf
# CONFIG_SECTION=rtpengine
PIDFILE=/run/rtpengine-daemon.pid
MANAGE_IPTABLES=yes
#SET_USER=root
#SET_GROUP=root # GROUP only needs to be set if USER is not set or if the user isn't in the group

+ 117
- 0
pkg/deb/buster/rtpengine-daemon.init View File

@ -0,0 +1,117 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: rtpengine-daemon
# Required-Start: $network $local_fs $remote_fs $syslog
# Required-Stop: $network $local_fs $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Ngcp Rtpengine
# Description: Proxy for RTP and other media streams
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=rtpengine-daemon
DESC="RTP/media proxy"
DAEMON=$(which rtpengine)
DEFAULTS=/etc/default/${NAME}
test -f "$DAEMON" || exit 0
. /lib/lsb/init-functions
# Load startup options if available
if [ -f "$DEFAULTS" ]; then
. "$DEFAULTS" || true
fi
[ -z "$PIDFILE" ] && PIDFILE="/run/rtpengine.pid"
OPTIONS=""
START_OPTIONS=""
[ -z "$CONFIG_FILE" ] || OPTIONS="$OPTIONS --config-file=$CONFIG_FILE"
[ -z "$CONFIG_SECTION" ] || OPTIONS="$OPTIONS --config-section=$CONFIG_SECTION"
[ -z "$PIDFILE" ] || OPTIONS="$OPTIONS --pidfile=$PIDFILE"
if test "$FORK" = "no" ; then
OPTIONS="$OPTIONS --foreground"
fi
# check if directory for pid file needs to be created
PIDDIR=$(dirname "$PIDFILE")
DO_DIR_CHOWN=0
if ! test -z "$PIDDIR" && ! test -d "$PIDDIR"; then
mkdir -p "$PIDDIR"
DO_DIR_CHOWN=1
fi
# handle requested setuid/setgid
if ! test -z "$SET_USER"; then
START_OPTIONS="$START_OPTIONS --chuid $SET_USER"
test "$DO_DIR_CHOWN" = 1 && chown "$SET_USER": "$PIDDIR"
fi
if ! test -z "$SET_GROUP"; then
START_OPTIONS="$START_OPTIONS --group $SET_GROUP"
test "$DO_DIR_CHOWN" = 1 && chgrp "$SET_GROUP" "$PIDDIR"
fi
###
case "$1" in
start)
if [ -x "$(which ngcp-check-active)" ]; then
case "$(ngcp-check-active -v)" in
active|transition)
log_action_msg "Active node or transition."
;;
*)
log_action_msg "Ignored start action in inactive node"
exit 0
;;
esac
fi
RC=0
rtpengine-iptables-setup start || RC=$?
if [ "$RC" -ne 0 ]; then
log_action_msg "Failed to start rtpengine-iptables-setup"
log_end_msg "$RC"
exit 1
fi
log_daemon_msg "Starting $DESC" "$NAME"
# shellcheck disable=SC2086
start-stop-daemon --start --quiet --pidfile "$PIDFILE" \
--exec "$DAEMON" $START_OPTIONS -- $OPTIONS || log_progress_msg " already running"
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
RC=0
start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
--retry 5 --exec "$DAEMON" || RC=$?
if [ "$RC" -eq 0 ]; then
rtpengine-iptables-setup stop || true
fi
rm -f "$PIDFILE"
log_end_msg "$RC"
exit "$RC"
;;
restart|force-reload)
$0 stop
$0 start
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0

+ 3
- 0
pkg/deb/buster/rtpengine-daemon.install View File

@ -0,0 +1,3 @@
daemon/rtpengine /usr/sbin/
debian/rtpengine-iptables-setup /usr/sbin
etc/rtpengine.sample.conf /etc/rtpengine/

+ 1
- 0
pkg/deb/buster/rtpengine-daemon.links View File

@ -0,0 +1 @@
/lib/systemd/system/rtpengine-daemon.service /lib/systemd/system/rtpengine.service

+ 1
- 0
pkg/deb/buster/rtpengine-daemon.manpages View File

@ -0,0 +1 @@
daemon/rtpengine.8

+ 38
- 0
pkg/deb/buster/rtpengine-daemon.postinst View File

@ -0,0 +1,38 @@
#!/bin/sh
set -e
default=/etc/default/rtpengine-daemon
modname=xt_RTPENGINE
if [ -x "$(which ngcp-virt-identify)" ]; then
if ngcp-virt-identify --type container; then
VIRT="yes"
fi
fi
if [ "$VIRT" = "yes" ]; then
echo "Container environment detected. Skip kernel module check"
else
if [ -f $default ]; then
. $default || true
fi
if [ -n "$TABLE" ] && [ "$TABLE" -ge 0 ] && \
[ -n "$NO_FALLBACK" ] && \
{ [ "$NO_FALLBACK" = "1" ] || [ "$NO_FALLBACK" = "yes" ] ; }
then
if lsmod | grep -q $modname || modinfo $modname > /dev/null 2> /dev/null; then
true
else
echo "Kernel module $modname not found and NO_FALLBACK is set."
echo "Daemon restart not performed."
exit 0
fi
fi
fi
#DEBHELPER#
exit 0

+ 16
- 0
pkg/deb/buster/rtpengine-daemon.service View File

@ -0,0 +1,16 @@
[Unit]
Description=NGCP RTP/media Proxy Daemon
After=network-online.target
After=remote-fs.target
Requires=network-online.target
[Service]
Type=notify
EnvironmentFile=/etc/default/rtpengine-daemon
PIDFile=/run/rtpengine-daemon.pid
ExecStartPre=/usr/sbin/rtpengine-iptables-setup start
ExecStart=/usr/sbin/rtpengine -f -E --no-log-timestamps --pidfile /run/rtpengine-daemon.pid --config-file /etc/rtpengine/rtpengine.conf
ExecStopPost=/usr/sbin/rtpengine-iptables-setup stop
[Install]
WantedBy=multi-user.target

+ 1
- 0
pkg/deb/buster/rtpengine-dev.install View File

@ -0,0 +1 @@
daemon/*.h /usr/include/rtpengine/

+ 101
- 0
pkg/deb/buster/rtpengine-iptables-setup View File

@ -0,0 +1,101 @@
#!/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MODNAME=xt_RTPENGINE
MANAGE_IPTABLES=yes
DEFAULTS=/etc/default/rtpengine-daemon
# Load startup options if available
if [ -f "$DEFAULTS" ]; then
. "$DEFAULTS" || true
fi
MODPROBE_OPTIONS=""
TABLE=$(/usr/libexec/rtpengine/rtpengine-get-table --config-file="${CONFIG_FILE-/etc/rtpengine/rtpengine.conf}")
# Handle requested setuid/setgid.
if ! test -z "$SET_USER"; then
PUID=$(id -u "$SET_USER" 2> /dev/null)
test -z "$PUID" || MODPROBE_OPTIONS="$MODPROBE_OPTIONS proc_uid=$PUID"
if test -z "$SET_GROUP"; then
PGID=$(id -g "$SET_USER" 2> /dev/null)
test -z "$PGID" || MODPROBE_OPTIONS="$MODPROBE_OPTIONS proc_gid=$PGID"
fi
fi
if ! test -z "$SET_GROUP"; then
PGID=$(grep "^$SET_GROUP:" /etc/group | cut -d: -f3 2> /dev/null)
test -z "$PGID" || MODPROBE_OPTIONS="$MODPROBE_OPTIONS proc_gid=$PGID"
fi
###
if [ -x "$(which ngcp-virt-identify 2>/dev/null)" ]; then
if ngcp-virt-identify --type container; then
VIRT="yes"
fi
fi
firewall_setup()
{
if [ "$TABLE" -lt 0 ] || [ "$VIRT" = "yes" ]; then
return
fi
if [ "$MANAGE_IPTABLES" != "yes" ]; then
return
fi
# shellcheck disable=SC2086
modprobe $MODNAME $MODPROBE_OPTIONS
iptables -N rtpengine 2>/dev/null
iptables -D INPUT -j rtpengine 2>/dev/null
iptables -D INPUT -p udp -j rtpengine 2>/dev/null
iptables -I INPUT -p udp -j rtpengine
iptables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null
iptables -I rtpengine -p udp -j RTPENGINE --id "$TABLE"
ip6tables -N rtpengine 2>/dev/null
ip6tables -D INPUT -j rtpengine 2>/dev/null
ip6tables -D INPUT -p udp -j rtpengine 2>/dev/null
ip6tables -I INPUT -p udp -j rtpengine
ip6tables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null
ip6tables -I rtpengine -p udp -j RTPENGINE --id "$TABLE"
}
firewall_teardown()
{
if [ "$TABLE" -lt 0 ] || [ "$VIRT" = "yes" ]; then
return
fi
# XXX: Wait a bit to make sure the daemon has been stopped.
sleep 1
if [ -e /proc/rtpengine/control ]; then
echo "del $TABLE" >/proc/rtpengine/control 2>/dev/null
fi
if [ "$MANAGE_IPTABLES" != "yes" ]; then
return
fi
iptables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null
ip6tables -D rtpengine -p udp -j RTPENGINE --id "$TABLE" 2>/dev/null
}
case "$1" in
start)
firewall_setup
;;
stop)
firewall_teardown
;;
*)
echo "Usage: $0 {start|stop}" >&2
exit 1
;;
esac
exit 0

+ 46
- 0
pkg/deb/buster/rtpengine-kernel-dkms.postinst View File

@ -0,0 +1,46 @@
#!/bin/sh
set -e
package=rtpengine-kernel-dkms
name=rtpengine
version=$(dpkg-query -W -f="\${Version}" "$package" \
|rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n")
if [ -x "$(which ngcp-virt-identify)" ]; then
if ngcp-virt-identify --type container; then
VIRT="yes"
fi
fi
if [ "$VIRT" = "yes" ]; then
echo "Container environment detected. Skip dkms"
else
isadded=$(dkms status -m "$name" -v "$version")
if [ -z "${isadded}" ] ; then
dkms add -m "$name" -v "$version"
fi
if [ "$1" = 'configure' ] ; then
KERNELS=$(ls /lib/modules/ 2>/dev/null || true)
for kernel in $KERNELS; do
if [ ! -r "/lib/modules/$kernel/build" ]; then
# cannot build modules for this kernel
continue
fi
( dkms build -m "$name" -v "$version" -k "$kernel" && dkms install -m "$name" -v "$version" -k "$kernel" ) || true
done
# try to start the daemon
if [ -x /etc/init.d/rtpengine-daemon ] ; then
invoke-rc.d rtpengine-daemon restart || true
fi
fi
fi
#DEBHELPER#
exit 0

+ 32
- 0
pkg/deb/buster/rtpengine-kernel-dkms.prerm View File

@ -0,0 +1,32 @@
#!/bin/sh
set -e
package=rtpengine-kernel-dkms
name=rtpengine
modname=xt_RTPENGINE
version=$(dpkg-query -W -f="\${Version}" "$package" \
|rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n")
if [ -x "$(which ngcp-virt-identify)" ]; then
if ngcp-virt-identify --type container; then
VIRT="yes"
fi
fi
# make sure it's not running
if [ -x /etc/init.d/rtpengine-daemon ] ; then
invoke-rc.d rtpengine-daemon stop || true
rmmod "$modname" 2>/dev/null || true
fi
if [ "$VIRT" = "yes" ]; then
echo "Container environment detected. Skip dkms"
else
dkms remove -m "$name" -v "$version" --all || true
fi
#DEBHELPER#
exit 0

+ 1
- 0
pkg/deb/buster/rtpengine-kernel-source.links View File

@ -0,0 +1 @@
/usr/share/modass/packages/default.sh /usr/share/modass/overrides/rtpengine-kernel-source

+ 11
- 0
pkg/deb/buster/rtpengine-recording-daemon.default View File

@ -0,0 +1,11 @@
CONFIG_FILE=/etc/rtpengine/rtpengine-recording.conf
# CONFIG_SECTION=rtpengine-recording
PIDFILE=/run/rtpengine-recording-daemon.pid
#SET_USER=root
#SET_GROUP=root # GROUP only needs to be set if USER is not set or if the user isn't in the group
#
MUST_NFS=no
NFS_HOST=192.168.1.1
NFS_REMOTE_PATH=/var/recordings
NFS_LOCAL_MOUNT=/var/lib/rtpengine-recording # must match output-dir if used
NFS_OPTIONS=hard,intr,tcp

+ 2
- 0
pkg/deb/buster/rtpengine-recording-daemon.dirs View File

@ -0,0 +1,2 @@
var/lib/rtpengine-recording
var/spool/rtpengine

+ 112
- 0
pkg/deb/buster/rtpengine-recording-daemon.init View File

@ -0,0 +1,112 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: rtpengine-recording-daemon
# Required-Start: $network $local_fs $remote_fs $syslog
# Required-Stop: $network $local_fs $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Ngcp Rtpengine Recording Daemon
# Description: Recording daemon for RTP and other media streams
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=rtpengine-recording-daemon
DESC="RTP/media recording daemon"
DAEMON=$(which rtpengine-recording)
DEFAULTS=/etc/default/${NAME}
test -f "$DAEMON" || exit 0
. /lib/lsb/init-functions
# Load startup options if available
if [ -f "$DEFAULTS" ]; then
. "$DEFAULTS" || true
fi
[ -z "$PIDFILE" ] && PIDFILE="/run/rtpengine-recording.pid"
OPTIONS=""
START_OPTIONS=""
[ -z "$CONFIG_FILE" ] || OPTIONS="$OPTIONS --config-file=$CONFIG_FILE"
[ -z "$PIDFILE" ] || OPTIONS="$OPTIONS --pidfile=$PIDFILE"
# check if directory for pid file needs to be created
PIDDIR=$(dirname "$PIDFILE")
DO_DIR_CHOWN=0
if ! test -z "$PIDDIR" && ! test -d "$PIDDIR"; then
mkdir -p "$PIDDIR"
DO_DIR_CHOWN=1
fi
# handle requested setuid/setgid
if ! test -z "$SET_USER"; then
START_OPTIONS="$START_OPTIONS --chuid $SET_USER"
test "$DO_DIR_CHOWN" = 1 && chown "$SET_USER": "$PIDDIR"
fi
if ! test -z "$SET_GROUP"; then
START_OPTIONS="$START_OPTIONS --group $SET_GROUP"
test "$DO_DIR_CHOWN" = 1 && chgrp "$SET_GROUP" "$PIDDIR"
fi
###
case "$1" in
start)
if [ -x "$(which ngcp-check-active)" ]; then
case "$(ngcp-check-active -v)" in
active|transition)
log_action_msg "Active node or transition."
;;
*)
log_action_msg "Ignored start action in inactive node"
exit 0
;;
esac
fi
RC=0
rtpengine-recording-nfs-setup start || RC=$?
if [ "$RC" -ne 0 ] ; then
log_action_msg "Failed to start rtpengine-recording-nfs-setup"
log_end_msg "$RC"
exit "$RC"
fi
log_daemon_msg "Starting $DESC" "$NAME"
# shellcheck disable=SC2086
start-stop-daemon --start --quiet --pidfile "$PIDFILE" \
--exec "$DAEMON" $START_OPTIONS -- $OPTIONS || log_progress_msg " already running"
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
RC=0
start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
--retry 5 --exec "$DAEMON" || RC=$?
rm -f "$PIDFILE"
log_end_msg "$RC"
exit "$RC"
;;
force-reload|restart)
$0 stop
$0 start
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0

+ 3
- 0
pkg/deb/buster/rtpengine-recording-daemon.install View File

@ -0,0 +1,3 @@
debian/rtpengine-recording-nfs-setup /usr/sbin/
etc/rtpengine-recording.sample.conf /etc/rtpengine/
recording-daemon/rtpengine-recording /usr/sbin/

+ 1
- 0
pkg/deb/buster/rtpengine-recording-daemon.links View File

@ -0,0 +1 @@
/lib/systemd/system/rtpengine-recording-daemon.service /lib/systemd/system/rtpengine-recording.service

+ 1
- 0
pkg/deb/buster/rtpengine-recording-daemon.manpages View File

@ -0,0 +1 @@
recording-daemon/rtpengine-recording.8

+ 20
- 0
pkg/deb/buster/rtpengine-recording-daemon.ngcp-rtpengine-recording-nfs-mount.service View File

@ -0,0 +1,20 @@
[Unit]
Description=NGCP RTP/media Recording Daemon NFS mount point
After=network-online.target
After=remote-fs.target
After=rpcbind.socket
After=rpcbind.service
After=nfs-client.target
Requires=network-online.target
Requires=rpcbind.socket
Requires=rpcbind.service
Requires=nfs-client.target
[Service]
Type=simple
RemainAfterExit=yes
ExecStart=/usr/sbin/rtpengine-recording-nfs-setup start
ExecStop=/usr/sbin/rtpengine-recording-nfs-setup stop
[Install]
WantedBy=multi-user.target

+ 16
- 0
pkg/deb/buster/rtpengine-recording-daemon.service View File

@ -0,0 +1,16 @@
[Unit]
Description=NGCP RTP/media Recording Daemon
After=network-online.target
After=remote-fs.target
After=rtpengine-recording-nfs-mount.service
Requires=network-online.target
Requires=rtpengine-recording-nfs-mount.service
[Service]
Type=notify
LimitNOFILE=100000
PIDFile=/run/rtpengine-recording-daemon.pid
ExecStart=/usr/sbin/rtpengine-recording -f -E --no-log-timestamps --pidfile /run/rtpengine-recording-daemon.pid --config-file /etc/rtpengine/rtpengine-recording.conf
[Install]
WantedBy=multi-user.target

+ 42
- 0
pkg/deb/buster/rtpengine-recording-nfs-setup View File

@ -0,0 +1,42 @@
#!/bin/sh
set -e
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DEFAULTS=/etc/default/rtpengine-recording-daemon
DESC="RTP engine recording NFS share"
. /lib/lsb/init-functions
# Load startup options if available
if [ -f "$DEFAULTS" ]; then
. "$DEFAULTS" || true
fi
[ -z "$NFS_OPTIONS" ] && NFS_OPTIONS="hard,tcp,intr"
###
case "$1" in
start)
if [ "$MUST_NFS" = yes ]; then
if ! grep -E -q "^[^ :]+:[^ :]+ $NFS_LOCAL_MOUNT nfs.? " /proc/mounts; then
log_action_msg "Mounting $DESC"
test -d "$NFS_LOCAL_MOUNT" || mkdir -p "$NFS_LOCAL_MOUNT"
mount -t nfs -o "$NFS_OPTIONS" "$NFS_HOST:$NFS_REMOTE_PATH" "$NFS_LOCAL_MOUNT"
fi
fi
;;
stop)
if grep -E -q "^[^ :]+:[^ :]+ $NFS_LOCAL_MOUNT nfs.? " /proc/mounts; then
log_action_msg "Unmounting $DESC"
umount "$NFS_LOCAL_MOUNT"
fi
;;
*)
echo "Usage: $0 {start|stop}" >&2
exit 1
;;
esac
exit 0

+ 4
- 0
pkg/deb/buster/rtpengine-utils.install View File

@ -0,0 +1,4 @@
perl/* /usr/share/perl5/
utils/rtpengine-ctl /usr/sbin/
utils/rtpengine-get-table /usr/libexec/rtpengine/
utils/rtpengine-ng-client /usr/sbin/

+ 2
- 0
pkg/deb/buster/rtpengine.docs View File

@ -0,0 +1,2 @@
debian/README.html.gz
debian/README.md.gz

+ 70
- 0
pkg/deb/buster/rules View File

@ -0,0 +1,70 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1
include /usr/share/dpkg/pkg-info.mk
## kernel package specific stuff
# Name of the source package
psource:=rtpengine-kernel-source
# Name of the dkms package
pdkms:=rtpengine-kernel-dkms
# short upstream name, used for module source directory
sname:=rtpengine
# Source version
sversion:=$(DEB_VERSION_UPSTREAM)
## end of kernel package specific stuff
XTABLES_DIR:=$(shell pkg-config xtables --variable=xtlibdir || echo /lib/xtables)
ifneq (,$(filter $(DEB_BUILD_PROFILES),pkg.rtpengine.no-transcoding))
export with_transcoding = no
endif
ifneq (,$(filter $(DEB_BUILD_PROFILES),pkg.rtpengine.asan))
export DO_ASAN_FLAGS = 1
# this prevents dh from setting default (including -O2) which we don't want
export DEB_CFLAGS_MAINT_SET =
export DEB_LDFLAGS_MAINT_SET =
endif
%:
dh $@
override_dh_auto_install-indep:
# Create the directories to install the source into
dh_installdirs -p$(psource) usr/src/modules/$(sname)/debian
dh_installdirs -p$(pdkms) usr/src/$(sname)-$(sversion)
# Copy only the driver source to the proper locations
cd kernel-module && cp Makefile *.c *.h ../debian/$(psource)/usr/src/modules/$(sname)
cd kernel-module && cp Makefile *.c *.h ../debian/$(pdkms)/usr/src/$(sname)-$(sversion)
# Copy the needed debian/ pieces to the proper location
cp debian/*.modules.in* debian/$(psource)/usr/src/modules/$(sname)/debian
cp debian/control debian/changelog debian/copyright \
debian/$(psource)/usr/src/modules/$(sname)/debian/
install -m 0755 debian/rules.modules debian/$(psource)/usr/src/modules/$(sname)/debian/rules
cd debian/$(psource)/usr/src && tar c modules | bzip2 -9 > $(sname).tar.bz2 && rm -rf modules
# Prepare dkms.conf from the dkms.conf.in template
sed "s/__VERSION__/$(sversion)/g" debian/dkms.conf.in > debian/$(pdkms)/usr/src/$(sname)-$(sversion)/dkms.conf
# markdown README
markdown README.md | gzip -9 > debian/README.html.gz
gzip -9 < README.md > debian/README.md.gz
dh_auto_install
override_dh_install:
dh_install
dh_installdirs -prtpengine-iptables $(XTABLES_DIR)
install -m 0644 iptables-extension/libxt_RTPENGINE.so debian/rtpengine-iptables/$(XTABLES_DIR)
override_dh_dwz:
# Disable, as dwz cannot cope with some of the plugins generated.
override_dh_installsystemd:
dh_installsystemd
dh_installsystemd -prtpengine-recording-daemon --name=rtpengine-recording-nfs-mount

+ 82
- 0
pkg/deb/buster/rules.modules View File

@ -0,0 +1,82 @@
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
CFLAGS ?= -g -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wstrict-prototypes
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
# Name of the source package
psource:=rtpengine-kernel-source
# The short upstream name, used for the module source directory
sname:=rtpengine
### KERNEL SETUP
### Setup the stuff needed for making kernel module packages
### taken from /usr/share/kernel-package/sample.module.rules
# prefix of the target package name
PACKAGE=rtpengine-kernel-modules
# modifieable for experiments or debugging m-a
MA_DIR ?= /usr/share/modass
# load generic variable handling
-include $(MA_DIR)/include/generic.make
# load default rules, including kdist, kdist_image, ...
-include $(MA_DIR)/include/common-rules.make
# module assistant calculates all needed things for us and sets
# following variables:
# KSRC (kernel source directory), KVERS (kernel version string), KDREV
# (revision of the Debian kernel-image package), CC (the correct
# compiler), VERSION (the final package version string), PKGNAME (full
# package name with KVERS included), DEB_DESTDIR (path to store DEBs)
# The kdist_configure target is called by make-kpkg modules_config and
# by kdist* rules by dependency. It should configure the module so it is
# ready for compilation (mostly useful for calling configure).
# prep-deb-files from module-assistant creates the necessary debian/ files
kdist_configure: prep-deb-files
# the kdist_clean target is called by make-kpkg modules_clean and from
# kdist* rules. It is responsible for cleaning up any changes that have
# been made by the other kdist_commands (except for the .deb files created)
kdist_clean: clean
$(MAKE) $(MFLAGS) -f debian/rules clean
#
### end KERNEL SETUP
# the binary-modules rule is invoked by module-assistant while processing the
# kdist* targets. It is called by module-assistant or make-kpkg and *not*
# during a normal build
binary-modules: prep-deb-files
dh_testroot
dh_prep
# Build the module
$(MAKE) modules KSRC=$(KSRC) KVER=$(KVERS)
# Install the module
install -D -m 0644 xt_RTPENGINE.ko debian/$(PACKAGE)-$(KVERS)/lib/modules/$(KVERS)/extra/xt_RTPENGINE.ko
dh_installdocs
dh_installchangelogs
dh_compress
dh_fixperms
dh_installmodules
dh_installdeb
dh_gencontrol -- -v$(VERSION)
dh_md5sums
dh_builddeb --destdir=$(DEB_DESTDIR)
clean:
dh_testdir
$(MAKE) clean
dh_clean
.PHONY: clean binary-modules kdist kdist_configure kdist_image kdist_clean

+ 1
- 0
pkg/deb/buster/source/format View File

@ -0,0 +1 @@
3.0 (quilt)

+ 1
- 0
pkg/deb/buster/source/options View File

@ -0,0 +1 @@
extend-diff-ignore=.gitreview

+ 15
- 0
pkg/deb/sid/.gitignore View File

@ -0,0 +1,15 @@
*.debhelper
*.log
*.substvars
/.debhelper/
/debhelper-build-stamp
/files
/rtpengine-daemon/
/rtpengine-iptables/
/rtpengine-kernel-dkms/
/rtpengine-kernel-source/
/rtpengine-recording-daemon/
/rtpengine-utils/
/rtpengine/
README.html.gz
README.md.gz

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save