Download raw body.
update: turnserver/coturn
On Thu, 2024-12-12 at 16:06 +0000, Stuart Henderson wrote:
> On 2024/12/12 15:40, Martijn van Duren wrote:
> > There appear to be 2 branches of releases, the main 6.4.3 release, and
> > the -r<n> releases which are annotated as for docker. While the release
> > notes give the impression that there are only docker related changes, a
> > got diff on the tags shows that there are also code changes included in
> > there. For this reason it seemed best to lucas and me to follow the
> > latter.
>
> Doesn't seem to be the case for 4.6.3, but looking at older releases
> I see what you mean. What a nuisance.
>
> > +V = 4.6.3-r0
> > +DISTFILES = ${V}.tar.gz
> > +DISTNAME = coturn-docker-${V}
> > +PKGNAME = turnserver-${V:S/-/./}
> ...
> > PORTROACH = site:https://github.com/coturn/coturn/releases/
> > -SITES = https://coturn.net/turnserver/v${V}/
> > +SITES = https://github.com/coturn/coturn/archive/refs/tags/docker/
>
> Please use GH_* for github autogenerated tarballs, it takes care
> of renaming the downloaded files a bit better than the default,
>
> > +SHA256 (4.6.3-r0.tar.gz) = yIFrwM9YQT5Y6r8EDtTCHp8kHKk6cEVja1Dow0BsTrk=
> > +SIZE (4.6.3-r0.tar.gz) = 535329
>
> ...this isn't really suitable for use in distfiles.
>
> Also, while things will work with the way you're setting PKGNAME
> for -r0 to -r9, it will break at -r10 (which they have used before)
> and then you'd need to start using EPOCH (use pkg_check-versions to
> check the sort order).
>
> / in the tag name adds a slight complication but it's not too
> hard to deal with.
>
> Makefile diff below will fix that.
Copied over your suggestion
>
> (I didn't try building, the diff in your email got mangled somewhere
> and I didn't fancy hand-applying the changes to patches/).
>
Apparently evolution decided to apply quoted printable to it... Need to
figure out how to fix that at a later time (suggestions welcome). For
now I've simply attached the diff.
tb@ pointed out offlist that the libressl version number stuff can go.
I already did that for ns_ioalib_engine_impl.c, but for 4.6.2 (which I
was working on originally) the mainrelay.c bits were still needed.
martijn@
Index: Makefile
===================================================================
RCS file: /cvs/ports/telephony/coturn/Makefile,v
retrieving revision 1.18
diff -u -p -r1.18 Makefile
--- Makefile 30 Aug 2024 19:16:43 -0000 1.18
+++ Makefile 12 Dec 2024 16:38:45 -0000
@@ -1,21 +1,22 @@
COMMENT = coturn STUN/TURN server
-V = 4.5.2
-DISTNAME = turnserver-${V}
-REVISION = 5
+V = 4.6.3-r0
+GH_ACCOUNT = coturn
+GH_PROJECT = coturn
+GH_TAGNAME = docker/${V}
+DISTNAME = turnserver-${V:S/-r/pl/}
+WRKDIST = ${WRKDIR}/coturn-docker-${V}
-CATEGORIES = telephony
+COMPILER = base-clang ports-gcc
+COMPILER_LANGS = c
-HOMEPAGE = https://github.com/coturn/coturn
+CATEGORIES = telephony
# BSD
PERMIT_PACKAGE = Yes
WANTLIB += c crypto event_core event_extra event_openssl event_pthreads
WANTLIB += hiredis intl mariadb pq pthread sqlite3 ssl m z
-
-PORTROACH = site:https://github.com/coturn/coturn/releases/
-SITES = https://coturn.net/turnserver/v${V}/
LIB_DEPENDS = databases/mariadb \
databases/postgresql \
Index: distinfo
===================================================================
RCS file: /cvs/ports/telephony/coturn/distinfo,v
retrieving revision 1.5
diff -u -p -r1.5 distinfo
--- distinfo 30 Apr 2021 07:52:33 -0000 1.5
+++ distinfo 12 Dec 2024 16:38:45 -0000
@@ -1,2 +1,2 @@
-SHA256 (turnserver-4.5.2.tar.gz) = HL74jNSrDeDU1wEfTn6vOaNEtIXponLzBV61PdMDtuE=
-SIZE (turnserver-4.5.2.tar.gz) = 444865
+SHA256 (turnserver-4.6.3pl0.tar.gz) = yIFrwM9YQT5Y6r8EDtTCHp8kHKk6cEVja1Dow0BsTrk=
+SIZE (turnserver-4.6.3pl0.tar.gz) = 535329
Index: patches/patch-src_apps_common_apputils_c
===================================================================
RCS file: patches/patch-src_apps_common_apputils_c
diff -N patches/patch-src_apps_common_apputils_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_apps_common_apputils_c 12 Dec 2024 16:38:45 -0000
@@ -0,0 +1,12 @@
+Index: src/apps/common/apputils.c
+--- src/apps/common/apputils.c.orig
++++ src/apps/common/apputils.c
+@@ -1179,7 +1179,7 @@ char *find_config_file(const char *config_file) {
+ /////////////////// SYS SETTINGS ///////////////////////
+
+ void ignore_sigpipe(void) {
+-#if defined(__linux__) || defined(__APPLE__)
++#if defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__)
+ /* Ignore SIGPIPE from TCP sockets */
+ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
+ perror("Cannot set SIGPIPE handler");
Index: patches/patch-src_apps_relay_mainrelay_c
===================================================================
RCS file: /cvs/ports/telephony/coturn/patches/patch-src_apps_relay_mainrelay_c,v
retrieving revision 1.2
diff -u -p -r1.2 patch-src_apps_relay_mainrelay_c
--- patches/patch-src_apps_relay_mainrelay_c 11 Mar 2022 19:58:30 -0000 1.2
+++ patches/patch-src_apps_relay_mainrelay_c 12 Dec 2024 16:38:45 -0000
@@ -1,33 +1,14 @@
-Use accessors instead of reaching into DH to fix build with opaque DH
-in LibreSSL 3.5
+Don't create a default pidfile
Index: src/apps/relay/mainrelay.c
--- src/apps/relay/mainrelay.c.orig
+++ src/apps/relay/mainrelay.c
-@@ -2710,7 +2710,7 @@ static DH *get_dh566(void) {
+@@ -126,7 +126,7 @@ turn_params_t turn_params = {
- if ((dh = DH_new()) == NULL )
- return (NULL );
--#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
- dh->p = BN_bin2bn(dh566_p, sizeof(dh566_p), NULL );
- dh->g = BN_bin2bn(dh566_g, sizeof(dh566_g), NULL );
- if ((dh->p == NULL )|| (dh->g == NULL)){ DH_free(dh); return(NULL);}
-@@ -2748,7 +2748,7 @@ static DH *get_dh1066(void) {
+ 0, /* do_not_use_config_file */
- if ((dh = DH_new()) == NULL )
- return (NULL );
--#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
- dh->p = BN_bin2bn(dh1066_p, sizeof(dh1066_p), NULL );
- dh->g = BN_bin2bn(dh1066_g, sizeof(dh1066_g), NULL );
- if ((dh->p == NULL )|| (dh->g == NULL)){ DH_free(dh); return(NULL);}
-@@ -2799,7 +2799,7 @@ static DH *get_dh2066(void) {
+- "/var/run/turnserver.pid", /* pidfile */
++ "", /* pidfile */
+ "", /* acme_redirect */
- if ((dh = DH_new()) == NULL )
- return (NULL );
--#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
- dh->p = BN_bin2bn(dh2066_p, sizeof(dh2066_p), NULL );
- dh->g = BN_bin2bn(dh2066_g, sizeof(dh2066_g), NULL );
- if ((dh->p == NULL )|| (dh->g == NULL)){ DH_free(dh); return(NULL);}
+ //////////////// Listener server /////////////////
Index: patches/patch-src_apps_relay_ns_ioalib_engine_impl_c
===================================================================
RCS file: patches/patch-src_apps_relay_ns_ioalib_engine_impl_c
diff -N patches/patch-src_apps_relay_ns_ioalib_engine_impl_c
--- patches/patch-src_apps_relay_ns_ioalib_engine_impl_c 11 Mar 2022 19:58:30 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-Do not leak rbio and use SSL_set0_rbio()
-
-Index: src/apps/relay/ns_ioalib_engine_impl.c
---- src/apps/relay/ns_ioalib_engine_impl.c.orig
-+++ src/apps/relay/ns_ioalib_engine_impl.c
-@@ -1833,7 +1833,7 @@ int ssl_read(evutil_socket_t fd, SSL* ssl, ioa_network
- BIO* rbio = BIO_new_mem_buf(buffer, old_buffer_len);
- BIO_set_mem_eof_return(rbio, -1);
-
--#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined LIBRESSL_VERSION_NUMBER
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L
- ssl->rbio = rbio;
- #else
- SSL_set0_rbio(ssl,rbio);
-@@ -1928,7 +1928,7 @@ int ssl_read(evutil_socket_t fd, SSL* ssl, ioa_network
- if(ret>0) {
- ioa_network_buffer_add_offset_size(nbh, (uint16_t)buf_size, 0, (size_t)ret);
- }
--#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined LIBRESSL_VERSION_NUMBER
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L
- ssl->rbio = NULL;
- BIO_free(rbio);
- #else
Index: pkg/turnserver.rc
===================================================================
RCS file: /cvs/ports/telephony/coturn/pkg/turnserver.rc,v
retrieving revision 1.4
diff -u -p -r1.4 turnserver.rc
--- pkg/turnserver.rc 13 Mar 2023 11:12:38 -0000 1.4
+++ pkg/turnserver.rc 12 Dec 2024 16:38:45 -0000
@@ -1,15 +1,10 @@
#!/bin/ksh
daemon="${TRUEPREFIX}/bin/turnserver --daemon"
-daemon_flags="--pidfile=/var/run/turnserver/turnserver.pid"
daemon_user="_turnserver"
. /etc/rc.d/rc.subr
rc_reload=NO
-
-rc_pre() {
- install -d -o ${daemon_user} /var/run/turnserver
-}
rc_cmd $1
update: turnserver/coturn