From 6295586cef944c47f7e8a2002923ea115e798d19 Mon Sep 17 00:00:00 2001 From: ttyyls Date: Thu, 25 Apr 2024 08:23:14 +0100 Subject: [PATCH] contrib/coturn: new package (4.6.2) --- contrib/coturn-devel | 1 + contrib/coturn/files/coturn | 6 ++++ contrib/coturn/files/sysusers.conf | 3 ++ contrib/coturn/files/tmpfiles.conf | 3 ++ contrib/coturn/template.py | 44 ++++++++++++++++++++++++++++++ contrib/coturn/update.py | 2 ++ 6 files changed, 59 insertions(+) create mode 120000 contrib/coturn-devel create mode 100644 contrib/coturn/files/coturn create mode 100644 contrib/coturn/files/sysusers.conf create mode 100644 contrib/coturn/files/tmpfiles.conf create mode 100644 contrib/coturn/template.py create mode 100644 contrib/coturn/update.py diff --git a/contrib/coturn-devel b/contrib/coturn-devel new file mode 120000 index 0000000000..9dd253159c --- /dev/null +++ b/contrib/coturn-devel @@ -0,0 +1 @@ +coturn \ No newline at end of file diff --git a/contrib/coturn/files/coturn b/contrib/coturn/files/coturn new file mode 100644 index 0000000000..43814044a2 --- /dev/null +++ b/contrib/coturn/files/coturn @@ -0,0 +1,6 @@ +# coturn system service + +type = process +command = /usr/bin/turnserver +logfile = /var/log/coturn.log +run-as = _coturn diff --git a/contrib/coturn/files/sysusers.conf b/contrib/coturn/files/sysusers.conf new file mode 100644 index 0000000000..d41ac05097 --- /dev/null +++ b/contrib/coturn/files/sysusers.conf @@ -0,0 +1,3 @@ +# create coturn user + +u _coturn - "Coturn user" /var/empty diff --git a/contrib/coturn/files/tmpfiles.conf b/contrib/coturn/files/tmpfiles.conf new file mode 100644 index 0000000000..d5ee557501 --- /dev/null +++ b/contrib/coturn/files/tmpfiles.conf @@ -0,0 +1,3 @@ +# Create coturn state directories + +d /var/lib/coturn 0755 _coturn _coturn - diff --git a/contrib/coturn/template.py b/contrib/coturn/template.py new file mode 100644 index 0000000000..ed99f3d3af --- /dev/null +++ b/contrib/coturn/template.py @@ -0,0 +1,44 @@ +pkgname = "coturn" +pkgver = "4.6.2" +pkgrel = 0 +build_style = "gnu_configure" +configure_args = ["--turndbdir=/var/lib/coturn"] +configure_gen = [] +make_cmd = "gmake" +make_dir = "." +make_check_target = "test" +hostmakedepends = ["gmake", "pkgconf"] +makedepends = [ + "hiredis-devel", + "libevent-devel", + "linux-headers", + "openssl-devel", + "sqlite-devel", +] +pkgdesc = "VoIP media traffic NAT traversal server and gateway" +maintainer = "ttyyls " +license = "BSD-3-Clause" +url = "https://github.com/coturn/coturn" +source = f"{url}/archive/refs/tags/{pkgver}.tar.gz" +sha256 = "13f2a38b66cffb73d86b5ed24acba4e1371d738d758a6039e3a18f0c84c176ad" +hardening = ["vis", "cfi"] + + +def post_install(self): + self.install_license("LICENSE") + self.install_service(self.files_path / "coturn") + self.install_file( + self.files_path / "sysusers.conf", + "usr/lib/sysusers.d", + name="coturn.conf", + ) + self.install_file( + self.files_path / "tmpfiles.conf", + "usr/lib/tmpfiles.d", + name="coturn.conf", + ) + + +@subpackage("coturn-devel") +def _devel(self): + return self.default_devel() diff --git a/contrib/coturn/update.py b/contrib/coturn/update.py new file mode 100644 index 0000000000..b40e0b11bd --- /dev/null +++ b/contrib/coturn/update.py @@ -0,0 +1,2 @@ +url = "https://api.github.com/repos/coturn/coturn/git/refs/tags" +pattern = r"refs/tags/([\d.]+)"