mirror of https://github.com/sipwise/rtpengine.git
* produces the non-NGCP debian dir * It will be called by a jenkins job Change-Id: I7e5eaabfc39a2ef3985a8a908998299c79d864a8mika/coverity
parent
730cc646a8
commit
bc09e94d61
@ -1,15 +0,0 @@
|
|||||||
*.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
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
debian/README.html.gz
|
|
||||||
debian/README.md.gz
|
|
||||||
@ -1,147 +0,0 @@
|
|||||||
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
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
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_.
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
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'.
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
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
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
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
|
|
||||||
@ -1,117 +0,0 @@
|
|||||||
#! /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
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
daemon/rtpengine /usr/sbin/
|
|
||||||
debian/rtpengine-iptables-setup /usr/sbin
|
|
||||||
etc/rtpengine.sample.conf /etc/rtpengine/
|
|
||||||
@ -1 +0,0 @@
|
|||||||
/lib/systemd/system/rtpengine-daemon.service /lib/systemd/system/rtpengine.service
|
|
||||||
@ -1 +0,0 @@
|
|||||||
daemon/rtpengine.8
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
#!/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
|
|
||||||
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
[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,0 @@
|
|||||||
daemon/*.h /usr/include/rtpengine/
|
|
||||||
@ -1,101 +0,0 @@
|
|||||||
#!/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 [ -z "$TABLE" ] || [ "$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 [ -z "$TABLE" ] || [ "$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
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
#!/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
|
|
||||||
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
#!/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,0 @@
|
|||||||
/usr/share/modass/packages/default.sh /usr/share/modass/overrides/rtpengine-kernel-source
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
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
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
var/lib/rtpengine-recording
|
|
||||||
var/spool/rtpengine
|
|
||||||
@ -1,112 +0,0 @@
|
|||||||
#! /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
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
debian/rtpengine-recording-nfs-setup /usr/sbin/
|
|
||||||
etc/rtpengine-recording.sample.conf /etc/rtpengine/
|
|
||||||
recording-daemon/rtpengine-recording /usr/sbin/
|
|
||||||
@ -1 +0,0 @@
|
|||||||
/lib/systemd/system/rtpengine-recording-daemon.service /lib/systemd/system/rtpengine-recording.service
|
|
||||||
@ -1 +0,0 @@
|
|||||||
recording-daemon/rtpengine-recording.8
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
[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
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
[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
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
#!/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
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
perl/* /usr/share/perl5/
|
|
||||||
utils/rtpengine-ctl /usr/sbin/
|
|
||||||
utils/rtpengine-get-table /usr/libexec/rtpengine/
|
|
||||||
utils/rtpengine-ng-client /usr/sbin/
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
debian/README.html.gz
|
|
||||||
debian/README.md.gz
|
|
||||||
@ -1,70 +0,0 @@
|
|||||||
#!/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
|
|
||||||
@ -1,82 +0,0 @@
|
|||||||
#!/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,0 @@
|
|||||||
3.0 (quilt)
|
|
||||||
@ -1 +0,0 @@
|
|||||||
extend-diff-ignore=.gitreview
|
|
||||||
@ -0,0 +1,47 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# produces non-NGCP pkg/deb/debian from debian
|
||||||
|
|
||||||
|
if [ ! -d ../../pkg/deb ] ; then
|
||||||
|
echo "script needs to be executed at pkg/deb dir" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf debian
|
||||||
|
|
||||||
|
echo "- Copying origin debian dir"
|
||||||
|
cp -ra ../../debian .
|
||||||
|
echo "- Copying backports scripts"
|
||||||
|
cp -ra backports debian
|
||||||
|
|
||||||
|
# rules
|
||||||
|
echo "- Remove ngcp- prefix"
|
||||||
|
find debian -maxdepth 1 -type f -exec sed -i -e 's/ngcp-rtpengine/rtpengine/g' {} \;
|
||||||
|
|
||||||
|
## remove same file on links
|
||||||
|
while read -r file; do
|
||||||
|
file_new=$(echo "${file}" | sed -e 's/ngcp-//g')
|
||||||
|
while read -r line; do
|
||||||
|
sed -i -e "s#${line}\$#HH#g" "${file}"
|
||||||
|
done < <(awk '{print $1}' "${file}")
|
||||||
|
grep -v HH "${file}" > "${file_new}"
|
||||||
|
rm "${file}"
|
||||||
|
done < <(find debian -name '*links')
|
||||||
|
|
||||||
|
echo "- Remove NGCP packages from Suggests"
|
||||||
|
sed -i -e '/ngcp-system-tools/d' debian/control
|
||||||
|
|
||||||
|
echo "- Add Conflicts with NGCP packages"
|
||||||
|
while read -r line ; do
|
||||||
|
sed -i "/${line}$/ a Conflicts: ngcp-${line#Package: }" debian/control
|
||||||
|
done < <(awk '/Package:/' debian/control)
|
||||||
|
|
||||||
|
echo "- Rename files"
|
||||||
|
while read -r file; do
|
||||||
|
file_new=$(echo "${file}" | sed -e 's/ngcp-//g')
|
||||||
|
mv "${file}" "${file_new}"
|
||||||
|
done < <(find debian -maxdepth 1 -type f -name 'ngcp-rtpengine*')
|
||||||
|
|
||||||
|
echo "- Remove empty Suggests"
|
||||||
|
wrap-and-sort
|
||||||
|
sed -i -e '/Suggests:$/d' debian/control
|
||||||
|
wrap-and-sort -sat
|
||||||
Loading…
Reference in new issue