Skip to content

Commit ed425b8

Browse files
committed
Implement basic debian packaging to create rtpproxy, rtpproxy-dev
and rtpproxy-debug packages. Refresh systemd config to match latest trends, make systemd socket allocation more robust.
1 parent 22c1785 commit ed425b8

22 files changed

+309
-7
lines changed

.github/workflows.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ do_FuncTest=true
66
do_Fuzzing=true
77
do_Glitch=true
88
do_MinBuild=true
9+
do_DebianPackage=true

.github/workflows/.jobs_configure.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ on:
2121
do_MinBuild:
2222
description: "Whether the current workflow should continue"
2323
value: ${{ jobs.check_disabled_actions.outputs.do_MinBuild }}
24+
do_DebianPackage:
25+
description: "Whether the current workflow should continue"
26+
value: ${{ jobs.check_disabled_actions.outputs.do_DebianPackage }}
2427

2528
jobs:
2629
check_disabled_actions:
@@ -33,6 +36,7 @@ jobs:
3336
do_Fuzzing: ${{ steps.check_status.outputs.do_Fuzzing }}
3437
do_Glitch: ${{ steps.check_status.outputs.do_Glitch }}
3538
do_MinBuild: ${{ steps.check_status.outputs.do_MinBuild }}
39+
do_DebianPackage: ${{ steps.check_status.outputs.do_DebianPackage }}
3640
steps:
3741
- name: Checkout code
3842
uses: actions/checkout@v4

.github/workflows/rtpproxy_ci.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,81 @@ jobs:
9999
- name: build
100100
run: sh -x ./scripts/do-build.sh cleanbuild
101101

102+
DebianPackage:
103+
name: Debian Package Build
104+
needs: [LoadJobs_conf, FullBuild]
105+
if: needs.LoadJobs_conf.outputs.do_DebianPackage == 'true'
106+
runs-on: ubuntu-24.04
107+
steps:
108+
- uses: actions/checkout@v4
109+
with:
110+
submodules: 'recursive'
111+
- name: Install build tools
112+
run: |
113+
sudo apt-get update
114+
sudo apt-get install -y build-essential devscripts debhelper pkg-config libssl-dev libbcg729-dev libgsm1-dev libsndfile1-dev libunwind-dev libsrtp2-dev libsystemd-dev fakeroot zip
115+
- name: Build Debian package
116+
env:
117+
DEB_BUILD_OPTIONS: nocheck
118+
run: |
119+
dpkg-buildpackage -us -uc -b
120+
121+
- name: Collect Debian packages
122+
run: |
123+
set -euo pipefail
124+
mkdir -p debian-artifacts
125+
shopt -s nullglob
126+
for artifact in ../*.deb ../*.ddeb ../*.buildinfo ../*.changes; do
127+
[ -e "${artifact}" ] || continue
128+
base=$(basename "${artifact}")
129+
mv "${artifact}" "debian-artifacts/${base}"
130+
done
131+
132+
- name: Test install Debian packages
133+
run: |
134+
set -euo pipefail
135+
shopt -s nullglob
136+
pkgs=(./debian-artifacts/*.deb)
137+
if [ "${#pkgs[@]}" -eq 0 ]; then
138+
echo "No Debian packages produced" >&2
139+
exit 1
140+
fi
141+
sudo apt-get install -y "${pkgs[@]}"
142+
143+
- name: Exercise systemd service
144+
run: |
145+
set -euo pipefail
146+
trap 'status=$?; sudo journalctl -xeu rtpproxy.service || true; exit $status' ERR
147+
trap 'sudo systemctl disable --now rtpproxy.socket || true' EXIT
148+
sudo systemctl daemon-reload
149+
sudo systemctl enable --now rtpproxy.socket
150+
sudo systemctl start rtpproxy.service
151+
sudo systemctl status --no-pager rtpproxy.service
152+
sudo systemctl restart rtpproxy.service
153+
sudo systemctl status --no-pager rtpproxy.service
154+
sudo systemctl stop rtpproxy.service
155+
sudo systemctl status --no-pager rtpproxy.service || true
156+
157+
- name: Setup GitHub Actions artifact client
158+
uses: lhotari/gh-actions-artifact-client@v2
159+
160+
- name: Upload Debian artifacts
161+
run: |
162+
set -euo pipefail
163+
shopt -s nullglob
164+
uploaded=0
165+
for file in debian-artifacts/*.deb debian-artifacts/*.ddeb debian-artifacts/*.buildinfo debian-artifacts/*.changes; do
166+
[ -e "$file" ] || continue
167+
uploaded=1
168+
name=$(basename "$file")
169+
echo "Uploading $name, file: $file"
170+
zip - "$file" | gh-actions-artifact-client.js upload "$name" --retentionDays=7
171+
done
172+
if [ "$uploaded" -eq 0 ]; then
173+
echo "No Debian artifacts found for upload" >&2
174+
exit 1
175+
fi
176+
102177
FullBuild:
103178
name: Full Build
104179
needs: [LoadJobs_conf, MinBuild]
@@ -550,6 +625,7 @@ jobs:
550625
run: sh -x docker/update_description.sh docker/README.md
551626

552627
roll_release:
628+
name: Roll Release
553629
needs: [LoadJobs_conf, Docker]
554630
permissions:
555631
contents: write

debian/README.source

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Building the Debian packaging helpers locally requires the Debian helper tools.
2+
3+
Before invoking commands such as `debian/rules clean` or `dpkg-buildpackage`,
4+
install the packaging toolchain, for example:
5+
6+
```
7+
sudo apt-get update
8+
sudo apt-get install debhelper
9+
```
10+
11+
The packaging workflow in CI already provisions these dependencies. When
12+
working on the packaging locally you need to provision them once per build
13+
environment.

debian/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
rtpproxy (3.1+dev1) unstable; urgency=medium
2+
3+
* Initial release of Debian packaging skeleton.
4+
5+
-- Maxim Sobolev <[email protected]> Wed, 15 May 2024 00:00:00 +0000

debian/control

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Source: rtpproxy
2+
Section: net
3+
Priority: optional
4+
Maintainer: Maxim Sobolev <[email protected]>
5+
Build-Depends: debhelper-compat (= 13),
6+
pkg-config,
7+
libssl-dev,
8+
libbcg729-dev,
9+
libgsm1-dev,
10+
libsndfile1-dev,
11+
libunwind-dev,
12+
libsrtp2-dev,
13+
libsystemd-dev
14+
Standards-Version: 4.6.2
15+
Homepage: https://github.com/sippy/rtpproxy
16+
Vcs-Git: https://github.com/sippy/rtpproxy.git
17+
Vcs-Browser: https://github.com/sippy/rtpproxy
18+
Rules-Requires-Root: no
19+
20+
Package: rtpproxy
21+
Architecture: any
22+
Depends: ${misc:Depends}, ${shlibs:Depends}, adduser
23+
Description: High-performance SIP RTP media proxy
24+
RTPProxy is a high-performance, scalable media relay designed for
25+
SIP-based applications. It supports advanced media handling features
26+
such as secure RTP, codec transcoding modules, and high availability
27+
deployments.
28+
29+
Package: rtpproxy-debug
30+
Section: debug
31+
Architecture: any
32+
Depends: ${misc:Depends}, rtpproxy (= ${binary:Version})
33+
Multi-Arch: same
34+
Description: Debug helpers and modules for RTPProxy
35+
This package provides the debugging-friendly binaries and modules for
36+
RTPProxy, including the rtpproxy_debug control tool, UDP contention
37+
tester, and the *_debug.so plugin variants.
38+
39+
Package: rtpproxy-dev
40+
Section: libdevel
41+
Architecture: any
42+
Depends: ${misc:Depends}, rtpproxy (= ${binary:Version})
43+
Multi-Arch: same
44+
Description: Development files for librtpproxy instrumentation library
45+
librtpproxy exposes the internal RTPProxy engine to external tooling
46+
for instrumentation and advanced control. This development package
47+
ships the static archive and public header needed to link against the
48+
library.

debian/copyright

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: rtpproxy
3+
Upstream-Contact: Maxim Sobolev <[email protected]>
4+
Source: https://github.com/sippy/rtpproxy
5+
6+
Files: *
7+
Copyright: 2004-2006 Maxim Sobolev <[email protected]>
8+
2006-2025 Sippy Software, Inc. <https://www.sippysoft.com/>
9+
License: BSD-2-Clause
10+
Redistribution and use in source and binary forms, with or without
11+
modification, are permitted provided that the following conditions are met:
12+
.
13+
1. Redistributions of source code must retain the above copyright notice,
14+
this list of conditions and the following disclaimer.
15+
.
16+
2. Redistributions in binary form must reproduce the above copyright notice,
17+
this list of conditions and the following disclaimer in the documentation
18+
and/or other materials provided with the distribution.
19+
.
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30+
POSSIBILITY OF SUCH DAMAGE.

debian/dirs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
etc/sysconfig
2+
var/lib/rtpproxy

debian/rtpproxy-debug.install

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
usr/bin/rtpproxy_debug
2+
usr/bin/udp_contention
3+
usr/lib/*/rtpproxy/rtpp_acct_csv_debug.so
4+
usr/lib/*/rtpproxy/rtpp_acct_rtcp_hep_debug.so
5+
usr/lib/*/rtpproxy/rtpp_catch_dtmf_debug.so
6+
usr/lib/*/rtpproxy/rtpp_dtls_gw_debug.so
7+
usr/lib/*/rtpproxy/rtpp_ice_lite_debug.so

debian/rtpproxy-dev.install

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
usr/include/librtpproxy.h
2+
usr/lib/*/librtpproxy.a

0 commit comments

Comments
 (0)