From dec9eb20dec800cece721f7d09b2d9f70d446442 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Thu, 9 Dec 2021 11:09:49 +0100 Subject: [PATCH] TT#124273 pkg/deb/generator.sh * produces the non-NGCP debian dir * It will be called by a jenkins job Change-Id: I7e5eaabfc39a2ef3985a8a908998299c79d864a8 (cherry picked from commit bc09e94d6145c0d0cf21eda0de0a5a9b2764f63a) --- pkg/deb/{debian => }/backports/bookworm | 0 pkg/deb/{debian => }/backports/bullseye | 0 pkg/deb/{debian => }/backports/buster | 0 pkg/deb/{debian => }/backports/focal | 0 pkg/deb/{debian => }/backports/sid | 0 pkg/deb/debian/.gitignore | 15 -- pkg/deb/debian/clean | 2 - pkg/deb/debian/control | 144 -------------- pkg/deb/debian/control.modules.in | 18 -- pkg/deb/debian/copyright | 36 ---- pkg/deb/debian/dkms.conf.in | 7 - pkg/deb/debian/rtpengine-daemon.default | 8 - pkg/deb/debian/rtpengine-daemon.init | 187 ------------------ pkg/deb/debian/rtpengine-daemon.install | 3 - pkg/deb/debian/rtpengine-daemon.links | 1 - pkg/deb/debian/rtpengine-daemon.manpages | 1 - pkg/deb/debian/rtpengine-daemon.postinst | 38 ---- pkg/deb/debian/rtpengine-daemon.service | 16 -- pkg/deb/debian/rtpengine-dev.install | 1 - pkg/deb/debian/rtpengine-iptables-setup | 101 ---------- pkg/deb/debian/rtpengine-kernel-dkms.postinst | 46 ----- pkg/deb/debian/rtpengine-kernel-dkms.prerm | 32 --- pkg/deb/debian/rtpengine-kernel-source.links | 1 - .../debian/rtpengine-recording-daemon.default | 12 -- .../debian/rtpengine-recording-daemon.dirs | 2 - .../debian/rtpengine-recording-daemon.init | 116 ----------- .../debian/rtpengine-recording-daemon.install | 3 - .../debian/rtpengine-recording-daemon.links | 1 - .../rtpengine-recording-daemon.manpages | 1 - ...ngcp-rtpengine-recording-nfs-mount.service | 20 -- .../debian/rtpengine-recording-daemon.service | 16 -- pkg/deb/debian/rtpengine-recording-nfs-setup | 42 ---- pkg/deb/debian/rtpengine-utils.install | 3 - pkg/deb/debian/rtpengine.docs | 2 - pkg/deb/debian/rules | 64 ------ pkg/deb/debian/rules.modules | 82 -------- pkg/deb/debian/source/format | 1 - pkg/deb/debian/source/options | 1 - pkg/deb/generator.sh | 47 +++++ 39 files changed, 47 insertions(+), 1023 deletions(-) rename pkg/deb/{debian => }/backports/bookworm (100%) rename pkg/deb/{debian => }/backports/bullseye (100%) rename pkg/deb/{debian => }/backports/buster (100%) rename pkg/deb/{debian => }/backports/focal (100%) rename pkg/deb/{debian => }/backports/sid (100%) delete mode 100644 pkg/deb/debian/.gitignore delete mode 100644 pkg/deb/debian/clean delete mode 100644 pkg/deb/debian/control delete mode 100644 pkg/deb/debian/control.modules.in delete mode 100644 pkg/deb/debian/copyright delete mode 100644 pkg/deb/debian/dkms.conf.in delete mode 100644 pkg/deb/debian/rtpengine-daemon.default delete mode 100755 pkg/deb/debian/rtpengine-daemon.init delete mode 100644 pkg/deb/debian/rtpengine-daemon.install delete mode 100644 pkg/deb/debian/rtpengine-daemon.links delete mode 100644 pkg/deb/debian/rtpengine-daemon.manpages delete mode 100644 pkg/deb/debian/rtpengine-daemon.postinst delete mode 100644 pkg/deb/debian/rtpengine-daemon.service delete mode 100644 pkg/deb/debian/rtpengine-dev.install delete mode 100755 pkg/deb/debian/rtpengine-iptables-setup delete mode 100644 pkg/deb/debian/rtpengine-kernel-dkms.postinst delete mode 100644 pkg/deb/debian/rtpengine-kernel-dkms.prerm delete mode 100644 pkg/deb/debian/rtpengine-kernel-source.links delete mode 100644 pkg/deb/debian/rtpengine-recording-daemon.default delete mode 100644 pkg/deb/debian/rtpengine-recording-daemon.dirs delete mode 100755 pkg/deb/debian/rtpengine-recording-daemon.init delete mode 100644 pkg/deb/debian/rtpengine-recording-daemon.install delete mode 100644 pkg/deb/debian/rtpengine-recording-daemon.links delete mode 100644 pkg/deb/debian/rtpengine-recording-daemon.manpages delete mode 100644 pkg/deb/debian/rtpengine-recording-daemon.ngcp-rtpengine-recording-nfs-mount.service delete mode 100644 pkg/deb/debian/rtpengine-recording-daemon.service delete mode 100755 pkg/deb/debian/rtpengine-recording-nfs-setup delete mode 100644 pkg/deb/debian/rtpengine-utils.install delete mode 100644 pkg/deb/debian/rtpengine.docs delete mode 100755 pkg/deb/debian/rules delete mode 100644 pkg/deb/debian/rules.modules delete mode 100644 pkg/deb/debian/source/format delete mode 100644 pkg/deb/debian/source/options create mode 100755 pkg/deb/generator.sh diff --git a/pkg/deb/debian/backports/bookworm b/pkg/deb/backports/bookworm similarity index 100% rename from pkg/deb/debian/backports/bookworm rename to pkg/deb/backports/bookworm diff --git a/pkg/deb/debian/backports/bullseye b/pkg/deb/backports/bullseye similarity index 100% rename from pkg/deb/debian/backports/bullseye rename to pkg/deb/backports/bullseye diff --git a/pkg/deb/debian/backports/buster b/pkg/deb/backports/buster similarity index 100% rename from pkg/deb/debian/backports/buster rename to pkg/deb/backports/buster diff --git a/pkg/deb/debian/backports/focal b/pkg/deb/backports/focal similarity index 100% rename from pkg/deb/debian/backports/focal rename to pkg/deb/backports/focal diff --git a/pkg/deb/debian/backports/sid b/pkg/deb/backports/sid similarity index 100% rename from pkg/deb/debian/backports/sid rename to pkg/deb/backports/sid diff --git a/pkg/deb/debian/.gitignore b/pkg/deb/debian/.gitignore deleted file mode 100644 index 106b5fba1..000000000 --- a/pkg/deb/debian/.gitignore +++ /dev/null @@ -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 diff --git a/pkg/deb/debian/clean b/pkg/deb/debian/clean deleted file mode 100644 index 934cc4739..000000000 --- a/pkg/deb/debian/clean +++ /dev/null @@ -1,2 +0,0 @@ -debian/README.html.gz -debian/README.md.gz diff --git a/pkg/deb/debian/control b/pkg/deb/debian/control deleted file mode 100644 index ccb09c302..000000000 --- a/pkg/deb/debian/control +++ /dev/null @@ -1,144 +0,0 @@ -Source: rtpengine -Section: net -Priority: optional -Maintainer: Sipwise Development Team -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 , - 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, - 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, - 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: -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 diff --git a/pkg/deb/debian/control.modules.in b/pkg/deb/debian/control.modules.in deleted file mode 100644 index a251a0dc9..000000000 --- a/pkg/deb/debian/control.modules.in +++ /dev/null @@ -1,18 +0,0 @@ -Source: rtpengine -Section: kernel -Priority: optional -Maintainer: Sipwise Development Team -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_. diff --git a/pkg/deb/debian/copyright b/pkg/deb/debian/copyright deleted file mode 100644 index 336e4ef54..000000000 --- a/pkg/deb/debian/copyright +++ /dev/null @@ -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 - -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 . -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'. diff --git a/pkg/deb/debian/dkms.conf.in b/pkg/deb/debian/dkms.conf.in deleted file mode 100644 index 005b4445f..000000000 --- a/pkg/deb/debian/dkms.conf.in +++ /dev/null @@ -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 diff --git a/pkg/deb/debian/rtpengine-daemon.default b/pkg/deb/debian/rtpengine-daemon.default deleted file mode 100644 index dd24f9346..000000000 --- a/pkg/deb/debian/rtpengine-daemon.default +++ /dev/null @@ -1,8 +0,0 @@ -RUN_RTPENGINE=no -CONFIG_FILE=/etc/rtpengine/rtpengine.conf -# CONFIG_SECTION=rtpengine -PIDFILE=/run/rtpengine-daemon.pid -MANAGE_IPTABLES=yes -TABLE=0 -#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 diff --git a/pkg/deb/debian/rtpengine-daemon.init b/pkg/deb/debian/rtpengine-daemon.init deleted file mode 100755 index aa4a4d5b7..000000000 --- a/pkg/deb/debian/rtpengine-daemon.init +++ /dev/null @@ -1,187 +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" -TABLE=0 - -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 - -if [ "$RUN_RTPENGINE" != "yes" ]; then - log_action_msg "rtpengine not yet configured. Edit $DEFAULTS first." - exit 0 -fi -[ -z "$PIDFILE" ] && PIDFILE="/run/rtpengine.pid" - -OPTIONS="" -START_OPTIONS="" - -if [ -n "$INTERFACES" ]; then - for interface in $INTERFACES; do - OPTIONS="$OPTIONS --interface=$interface" - done -fi - - -if [ -n "$SUBSCRIBE_KEYSPACES" ]; then - for ks in $SUBSCRIBE_KEYSPACES; do - OPTIONS="$OPTIONS --subscribe-keyspace=$ks" - done -fi - -[ -z "$CONFIG_FILE" ] || OPTIONS="$OPTIONS --config-file=$CONFIG_FILE" -[ -z "$CONFIG_SECTION" ] || OPTIONS="$OPTIONS --config-section=$CONFIG_SECTION" -[ -z "$ADDRESS" ] || OPTIONS="$OPTIONS --interface=$ADDRESS" -[ -z "$ADV_ADDRESS" ] || OPTIONS="$OPTIONS!$ADV_ADDRESS" -[ -z "$ADDRESS_IPV6" ] || OPTIONS="$OPTIONS --interface=$ADDRESS_IPV6" -[ -z "$ADV_ADDRESS_IPV6" ] || OPTIONS="$OPTIONS!$ADV_ADDRESS_IPV6" -[ -z "$LISTEN_TCP" ] || OPTIONS="$OPTIONS --listen-tcp=$LISTEN_TCP" -[ -z "$LISTEN_UDP" ] || OPTIONS="$OPTIONS --listen-udp=$LISTEN_UDP" -[ -z "$LISTEN_NG" ] || OPTIONS="$OPTIONS --listen-ng=$LISTEN_NG" -[ -z "$LISTEN_CLI" ] || OPTIONS="$OPTIONS --listen-cli=$LISTEN_CLI" -[ -z "$TIMEOUT" ] || OPTIONS="$OPTIONS --timeout=$TIMEOUT" -[ -z "$SILENT_TIMEOUT" ] || OPTIONS="$OPTIONS --silent-timeout=$SILENT_TIMEOUT" -[ -z "$FINAL_TIMEOUT" ] || OPTIONS="$OPTIONS --final-timeout=$FINAL_TIMEOUT" -[ -z "$PIDFILE" ] || OPTIONS="$OPTIONS --pidfile=$PIDFILE" -[ -z "$TOS" ] || OPTIONS="$OPTIONS --tos=$TOS" -[ -z "$PORT_MIN" ] || OPTIONS="$OPTIONS --port-min=$PORT_MIN" -[ -z "$PORT_MAX" ] || OPTIONS="$OPTIONS --port-max=$PORT_MAX" -[ -z "$REDIS" ] || [ -z "$REDIS_DB" ] || OPTIONS="$OPTIONS --redis=$REDIS/$REDIS_DB" -[ -z "$REDIS_AUTH_PW" ] || export RTPENGINE_REDIS_AUTH_PW="$REDIS_AUTH_PW" -[ -z "$REDIS_WRITE" ] || [ -z "$REDIS_WRITE_DB" ] || OPTIONS="$OPTIONS --redis-write=$REDIS_WRITE/$REDIS_WRITE_DB" -[ -z "$REDIS_WRITE_AUTH_PW" ] || export RTPENGINE_REDIS_WRITE_AUTH_PW="$REDIS_WRITE_AUTH_PW" -[ -z "$REDIS_NUM_THREADS" ] || OPTIONS="$OPTIONS --redis-num-threads=$REDIS_NUM_THREADS" -[ -z "$REDIS_EXPIRES" ] || OPTIONS="$OPTIONS --redis-expires=$REDIS_EXPIRES" -[ -z "$REDIS_MULTIKEY" ] || OPTIONS="$OPTIONS --redis-multikey=$REDIS_MULTIKEY" -[ -z "$NO_REDIS_REQUIRED" ] || { [ "$NO_REDIS_REQUIRED" != "1" ] && [ "$NO_REDIS_REQUIRED" != "yes" ] ; } || OPTIONS="$OPTIONS --no-redis-required" -[ -z "$B2B_URL" ] || OPTIONS="$OPTIONS --b2b-url=$B2B_URL" -[ -z "$NO_FALLBACK" ] || { [ "$NO_FALLBACK" != "1" ] && [ "$NO_FALLBACK" != "yes" ] ; } || OPTIONS="$OPTIONS --no-fallback" -OPTIONS="$OPTIONS --table=$TABLE" -[ -z "$LOG_LEVEL" ] || OPTIONS="$OPTIONS --log-level=$LOG_LEVEL" -[ -z "$LOG_FACILITY" ] || OPTIONS="$OPTIONS --log-facility=$LOG_FACILITY" -[ -z "$LOG_FACILITY_CDR" ] || OPTIONS="$OPTIONS --log-facility-cdr=$LOG_FACILITY_CDR" -[ -z "$LOG_FACILITY_RTCP" ] || OPTIONS="$OPTIONS --log-facility-rtcp=$LOG_FACILITY_RTCP" -[ -z "$NUM_THREADS" ] || OPTIONS="$OPTIONS --num-threads=$NUM_THREADS" -[ -z "$DELETE_DELAY" ] || OPTIONS="$OPTIONS --delete-delay=$DELETE_DELAY" -[ -z "$GRAPHITE" ] || OPTIONS="$OPTIONS --graphite=$GRAPHITE" -[ -z "$GRAPHITE_INTERVAL" ] || OPTIONS="$OPTIONS --graphite-interval=$GRAPHITE_INTERVAL" -[ -z "$GRAPHITE_PREFIX" ] || OPTIONS="$OPTIONS --graphite-prefix=$GRAPHITE_PREFIX" -[ -z "$MAX_SESSIONS" ] || OPTIONS="$OPTIONS --max-sessions=$MAX_SESSIONS" -[ -z "$HOMER" ] || OPTIONS="$OPTIONS --homer=$HOMER" -[ -z "$HOMER_PROTOCOL" ] || OPTIONS="$OPTIONS --homer-protocol=$HOMER_PROTOCOL" -[ -z "$HOMER_ID" ] || OPTIONS="$OPTIONS --homer-id=$HOMER_ID" -if [ -n "$RECORDING_DIR" ]; then - OPTIONS="$OPTIONS --recording-dir=$RECORDING_DIR" - if [ ! -d "$RECORDING_DIR" ]; then - mkdir "$RECORDING_DIR" 2> /dev/null - chmod 700 "$RECORDING_DIR" 2> /dev/null - fi -fi -[ -z "$RECORDING_METHOD" ] || OPTIONS="$OPTIONS --recording-method=$RECORDING_METHOD" -[ -z "$RECORDING_FORMAT" ] || OPTIONS="$OPTIONS --recording-format=$RECORDING_FORMAT" -[ -z "$DTLS_PASSIVE" ] || { [ "$DTLS_PASSIVE" != "yes" ] && [ "$DTLS_PASSIVE" != "1" ] ; } || OPTIONS="$OPTIONS --dtls-passive" - -if test "$FORK" = "no" ; then - OPTIONS="$OPTIONS --foreground" -fi - -if test "$LOG_STDERR" = "yes" ; then - OPTIONS="$OPTIONS --log-stderr" -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 diff --git a/pkg/deb/debian/rtpengine-daemon.install b/pkg/deb/debian/rtpengine-daemon.install deleted file mode 100644 index e9ce0c197..000000000 --- a/pkg/deb/debian/rtpengine-daemon.install +++ /dev/null @@ -1,3 +0,0 @@ -daemon/rtpengine /usr/sbin/ -debian/rtpengine-iptables-setup /usr/sbin -etc/rtpengine.sample.conf /etc/rtpengine/ diff --git a/pkg/deb/debian/rtpengine-daemon.links b/pkg/deb/debian/rtpengine-daemon.links deleted file mode 100644 index 1fca77cef..000000000 --- a/pkg/deb/debian/rtpengine-daemon.links +++ /dev/null @@ -1 +0,0 @@ -/lib/systemd/system/rtpengine-daemon.service /lib/systemd/system/rtpengine.service diff --git a/pkg/deb/debian/rtpengine-daemon.manpages b/pkg/deb/debian/rtpengine-daemon.manpages deleted file mode 100644 index 702e181c3..000000000 --- a/pkg/deb/debian/rtpengine-daemon.manpages +++ /dev/null @@ -1 +0,0 @@ -daemon/rtpengine.8 diff --git a/pkg/deb/debian/rtpengine-daemon.postinst b/pkg/deb/debian/rtpengine-daemon.postinst deleted file mode 100644 index 0ee75e097..000000000 --- a/pkg/deb/debian/rtpengine-daemon.postinst +++ /dev/null @@ -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 - diff --git a/pkg/deb/debian/rtpengine-daemon.service b/pkg/deb/debian/rtpengine-daemon.service deleted file mode 100644 index 69acae6be..000000000 --- a/pkg/deb/debian/rtpengine-daemon.service +++ /dev/null @@ -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 diff --git a/pkg/deb/debian/rtpengine-dev.install b/pkg/deb/debian/rtpengine-dev.install deleted file mode 100644 index b7eda5b59..000000000 --- a/pkg/deb/debian/rtpengine-dev.install +++ /dev/null @@ -1 +0,0 @@ -daemon/*.h /usr/include/rtpengine/ diff --git a/pkg/deb/debian/rtpengine-iptables-setup b/pkg/deb/debian/rtpengine-iptables-setup deleted file mode 100755 index db66cbec9..000000000 --- a/pkg/deb/debian/rtpengine-iptables-setup +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/sh - -PATH=/sbin:/bin:/usr/sbin:/usr/bin -TABLE=0 -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="" - -# 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)" ]; 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 diff --git a/pkg/deb/debian/rtpengine-kernel-dkms.postinst b/pkg/deb/debian/rtpengine-kernel-dkms.postinst deleted file mode 100644 index f53a07d56..000000000 --- a/pkg/deb/debian/rtpengine-kernel-dkms.postinst +++ /dev/null @@ -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 - diff --git a/pkg/deb/debian/rtpengine-kernel-dkms.prerm b/pkg/deb/debian/rtpengine-kernel-dkms.prerm deleted file mode 100644 index 1b7153526..000000000 --- a/pkg/deb/debian/rtpengine-kernel-dkms.prerm +++ /dev/null @@ -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 diff --git a/pkg/deb/debian/rtpengine-kernel-source.links b/pkg/deb/debian/rtpengine-kernel-source.links deleted file mode 100644 index be44265c4..000000000 --- a/pkg/deb/debian/rtpengine-kernel-source.links +++ /dev/null @@ -1 +0,0 @@ -/usr/share/modass/packages/default.sh /usr/share/modass/overrides/rtpengine-kernel-source diff --git a/pkg/deb/debian/rtpengine-recording-daemon.default b/pkg/deb/debian/rtpengine-recording-daemon.default deleted file mode 100644 index a2d6ff55f..000000000 --- a/pkg/deb/debian/rtpengine-recording-daemon.default +++ /dev/null @@ -1,12 +0,0 @@ -RUN_RTPENGINE_RECORDING=no -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 diff --git a/pkg/deb/debian/rtpengine-recording-daemon.dirs b/pkg/deb/debian/rtpengine-recording-daemon.dirs deleted file mode 100644 index b7df8da6e..000000000 --- a/pkg/deb/debian/rtpengine-recording-daemon.dirs +++ /dev/null @@ -1,2 +0,0 @@ -var/lib/rtpengine-recording -var/spool/rtpengine diff --git a/pkg/deb/debian/rtpengine-recording-daemon.init b/pkg/deb/debian/rtpengine-recording-daemon.init deleted file mode 100755 index e84da1467..000000000 --- a/pkg/deb/debian/rtpengine-recording-daemon.init +++ /dev/null @@ -1,116 +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 - -if [ "$RUN_RTPENGINE_RECORDING" != "yes" ]; then - log_action_msg "rtpengine-recording not yet configured. Edit $DEFAULTS first." - exit 0 -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 diff --git a/pkg/deb/debian/rtpengine-recording-daemon.install b/pkg/deb/debian/rtpengine-recording-daemon.install deleted file mode 100644 index 484034025..000000000 --- a/pkg/deb/debian/rtpengine-recording-daemon.install +++ /dev/null @@ -1,3 +0,0 @@ -debian/rtpengine-recording-nfs-setup /usr/sbin/ -etc/rtpengine-recording.sample.conf /etc/rtpengine/ -recording-daemon/rtpengine-recording /usr/sbin/ diff --git a/pkg/deb/debian/rtpengine-recording-daemon.links b/pkg/deb/debian/rtpengine-recording-daemon.links deleted file mode 100644 index 8c7d9fbe3..000000000 --- a/pkg/deb/debian/rtpengine-recording-daemon.links +++ /dev/null @@ -1 +0,0 @@ -/lib/systemd/system/rtpengine-recording-daemon.service /lib/systemd/system/rtpengine-recording.service diff --git a/pkg/deb/debian/rtpengine-recording-daemon.manpages b/pkg/deb/debian/rtpengine-recording-daemon.manpages deleted file mode 100644 index 96515be0c..000000000 --- a/pkg/deb/debian/rtpengine-recording-daemon.manpages +++ /dev/null @@ -1 +0,0 @@ -recording-daemon/rtpengine-recording.8 diff --git a/pkg/deb/debian/rtpengine-recording-daemon.ngcp-rtpengine-recording-nfs-mount.service b/pkg/deb/debian/rtpengine-recording-daemon.ngcp-rtpengine-recording-nfs-mount.service deleted file mode 100644 index b64dd0d9a..000000000 --- a/pkg/deb/debian/rtpengine-recording-daemon.ngcp-rtpengine-recording-nfs-mount.service +++ /dev/null @@ -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 diff --git a/pkg/deb/debian/rtpengine-recording-daemon.service b/pkg/deb/debian/rtpengine-recording-daemon.service deleted file mode 100644 index 711ea34c8..000000000 --- a/pkg/deb/debian/rtpengine-recording-daemon.service +++ /dev/null @@ -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 diff --git a/pkg/deb/debian/rtpengine-recording-nfs-setup b/pkg/deb/debian/rtpengine-recording-nfs-setup deleted file mode 100755 index 4bbe5b4b3..000000000 --- a/pkg/deb/debian/rtpengine-recording-nfs-setup +++ /dev/null @@ -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 diff --git a/pkg/deb/debian/rtpengine-utils.install b/pkg/deb/debian/rtpengine-utils.install deleted file mode 100644 index 04c88eb1e..000000000 --- a/pkg/deb/debian/rtpengine-utils.install +++ /dev/null @@ -1,3 +0,0 @@ -perl/* /usr/share/perl5/ -utils/rtpengine-ctl /usr/sbin/ -utils/rtpengine-ng-client /usr/sbin/ diff --git a/pkg/deb/debian/rtpengine.docs b/pkg/deb/debian/rtpengine.docs deleted file mode 100644 index 934cc4739..000000000 --- a/pkg/deb/debian/rtpengine.docs +++ /dev/null @@ -1,2 +0,0 @@ -debian/README.html.gz -debian/README.md.gz diff --git a/pkg/deb/debian/rules b/pkg/deb/debian/rules deleted file mode 100755 index 9fdc0e021..000000000 --- a/pkg/deb/debian/rules +++ /dev/null @@ -1,64 +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 - -%: - 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 diff --git a/pkg/deb/debian/rules.modules b/pkg/deb/debian/rules.modules deleted file mode 100644 index eca1a6376..000000000 --- a/pkg/deb/debian/rules.modules +++ /dev/null @@ -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 diff --git a/pkg/deb/debian/source/format b/pkg/deb/debian/source/format deleted file mode 100644 index 163aaf8d8..000000000 --- a/pkg/deb/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/pkg/deb/debian/source/options b/pkg/deb/debian/source/options deleted file mode 100644 index bcdff0089..000000000 --- a/pkg/deb/debian/source/options +++ /dev/null @@ -1 +0,0 @@ -extend-diff-ignore=.gitreview diff --git a/pkg/deb/generator.sh b/pkg/deb/generator.sh new file mode 100755 index 000000000..05ca9ca97 --- /dev/null +++ b/pkg/deb/generator.sh @@ -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