From f6516d0cc5f24d4ef20b89c13bf3093932f53a58 Mon Sep 17 00:00:00 2001 From: Yuri Victorovich Date: Tue, 4 Aug 2020 18:23:06 +0000 Subject: [PATCH] net/coturn: Add the rc script Submitted by: Zeus Panchenko --- net/coturn/Makefile | 7 +++++++ net/coturn/files/turnserver-service.in | 29 ++++++++++++++++++++++++++ net/coturn/pkg-plist | 3 ++- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 net/coturn/files/turnserver-service.in diff --git a/net/coturn/Makefile b/net/coturn/Makefile index 29793261c43e..e82af5845fe4 100644 --- a/net/coturn/Makefile +++ b/net/coturn/Makefile @@ -2,6 +2,7 @@ PORTNAME= coturn DISTVERSION= 4.5.1.3 +PORTREVISION= 1 CATEGORIES= net MAINTAINER= yuri@FreeBSD.org @@ -20,6 +21,8 @@ SHEBANG_FILES= examples/scripts/oauth.sh examples/scripts/restapi/shared_secret_ GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-static --enable-shared --turndbdir=/var/db/${PORTNAME} +SUB_FILES= turnserver-service + DOCSDIR= ${PREFIX}/share/doc/turnserver EXAMPLESDIR= ${PREFIX}/share/examples/turnserver @@ -28,4 +31,8 @@ OPTIONS_DEFINE= DOCS EXAMPLES PORTDOCS= * PORTEXAMPLES= * +post-install: + ${INSTALL_SCRIPT} ${WRKDIR}/turnserver-service ${STAGEDIR}${PREFIX}/etc/rc.d/turnserver + ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/* + .include diff --git a/net/coturn/files/turnserver-service.in b/net/coturn/files/turnserver-service.in new file mode 100644 index 000000000000..10ae6a3f82ff --- /dev/null +++ b/net/coturn/files/turnserver-service.in @@ -0,0 +1,29 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# +# PROVIDE: turnserver +# REQUIRE: DAEMON +# BEFORE: mail +# KEYWORD: shutdown +# + +. /etc/rc.subr + +name="turnserver" +rcvar="${name}_enable" +command="%%PREFIX%%/bin/${name}" +pidfile="/var/run/prosody/${name}.pid" +required_files="%%PREFIX%%/etc/${name}.conf" + +load_rc_config ${name} + +: ${turnserver_enable="NO"} +: ${turnserver_flags="-o"} +: ${turnserver_configfile:=%%PREFIX%%/etc/$name.conf} + +command_args="-c ${turnserver_configfile} ${turnserver_flags}" + +run_rc_command "$1" diff --git a/net/coturn/pkg-plist b/net/coturn/pkg-plist index 2fca35054614..52566ed12679 100644 --- a/net/coturn/pkg-plist +++ b/net/coturn/pkg-plist @@ -5,7 +5,8 @@ bin/turnutils_oauth bin/turnutils_peer bin/turnutils_stunclient bin/turnutils_uclient -etc/turnserver.conf.default +etc/rc.d/turnserver +@sample etc/turnserver.conf.default etc/turnserver.conf include/turn/client/TurnMsgLib.h include/turn/client/ns_turn_ioaddr.h include/turn/client/ns_turn_msg.h