diff options
author | Gabor Kovesdan <gabor@FreeBSD.org> | 2013-06-02 09:39:19 +0000 |
---|---|---|
committer | Gabor Kovesdan <gabor@FreeBSD.org> | 2013-06-02 09:39:19 +0000 |
commit | b2064df69f02efa0b36dd103621a3fecc91fb12b (patch) | |
tree | 2a368f9dcc291a6bbc1454600a916fc354fcb28a | |
parent | cae4551aa5d55bb35efe18177577226cdcd83688 (diff) | |
download | ports-b2064df69f02efa0b36dd103621a3fecc91fb12b.tar.gz ports-b2064df69f02efa0b36dd103621a3fecc91fb12b.zip |
This a BSD-licensed version of the RFC5766 TURN Server implementation,
with IPv6 and DTLS extensions.
WWW: http://code.google.com/p/rfc5766-turn-server/
Submitted by: Oleg Moskalenko <mom040267@gmail.com> (via private mail)
Notes
Notes:
svn path=/head/; revision=319644
-rw-r--r-- | net/Makefile | 1 | ||||
-rw-r--r-- | net/turnserver/Makefile | 138 | ||||
-rw-r--r-- | net/turnserver/distinfo | 2 | ||||
-rw-r--r-- | net/turnserver/files/pkg-message.in | 40 | ||||
-rw-r--r-- | net/turnserver/files/turnserver.in | 30 | ||||
-rw-r--r-- | net/turnserver/pkg-descr | 4 | ||||
-rw-r--r-- | net/turnserver/pkg-plist | 69 |
7 files changed, 284 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile index 73b4fcbd5ab6..b315d3dc7c7e 100644 --- a/net/Makefile +++ b/net/Makefile @@ -1191,6 +1191,7 @@ SUBDIR += ttbudget SUBDIR += ttlscan SUBDIR += tucan + SUBDIR += turnserver SUBDIR += twinkle SUBDIR += twitux SUBDIR += u6rd diff --git a/net/turnserver/Makefile b/net/turnserver/Makefile new file mode 100644 index 000000000000..c861cf8f6cea --- /dev/null +++ b/net/turnserver/Makefile @@ -0,0 +1,138 @@ +# $FreeBSD$ + +PORTNAME= turnserver +PORTVERSION= 1.8.5.3 +CATEGORIES= net +MASTER_SITES= http://rfc5766-turn-server.googlecode.com/files/ +PKGNAMEPREFIX= + +MAINTAINER= mom040267@gmail.com +COMMENT= STUN/TURN Server; IPv6, DTLS support; RFCs 5389, 5766, 6062, 6156 + +LICENSE= BSD + +LIB_DEPENDS= ssl:${PORTSDIR}/security/openssl \ + event-2:${PORTSDIR}/devel/libevent2 + +SUB_FILES= pkg-message + +MAN1= turnserver.1 turnadmin.1 turnutils.1 turnutils_peer.1 turnutils_rfc5769check.1 turnutils_stunclient.1 turnutils_uclient.1 +MANCOMPRESSED= no + +USE_OPENSSL= YES + +USE_RC_SUBR= turnserver + +HAS_CONFIGURE= YES + +OPTIONS_DEFINE= MYSQL PGSQL REDIS + +MYSQL_DESC= MySQL support for users database +PGSQL_DESC= PostgreSQL support for users database +REDIS_DESC= Redis support for user database and for status and statistics reporting + +OPTIONS_DEFAULT= MYSQL PGSQL REDIS + +.include <bsd.port.options.mk> + +PORTDOCS= +PORTREADMEDOCS= README.turnserver README.turnadmin README.turnutils INSTALL + +_BIN_UTILS= peer stunclient rfc5769check uclient + +_ETC_EXAMPLES= turnserver.conf turnuserdb.conf turn_client_cert.pem \ + turn_client_pkey.pem turn_server_cert.pem turn_server_pkey.pem +_SCRIPT_EXAMPLES= peer.sh rfc5769.sh \ +basic/relay.sh basic/tcp_client_c2c_tcp_relay.sh basic/udp_c2c_client.sh \ +basic/udp_client.sh basic/tcp_client.sh \ +loadbalance/master_relay.sh loadbalance/slave_relay_1.sh loadbalance/slave_relay_2.sh \ +loadbalance/udp_c2c.sh loadbalance/tcp_c2c_tcp_relay.sh \ +longtermsecure/secure_dtls_client.sh longtermsecure/secure_relay.sh \ +longtermsecure/secure_tcp_client_c2c_tcp_relay.sh longtermsecure/secure_tcp_client.sh \ +longtermsecure/secure_tls_client_c2c_tcp_relay.sh longtermsecure/secure_tls_client.sh \ +longtermsecure/secure_udp_c2c.sh longtermsecure/secure_udp_client.sh \ +longtermsecuredb/secure_relay_with_db_psql.sh longtermsecuredb/secure_relay_with_db_mysql.sh \ +longtermsecuredb/secure_relay_with_db_redis.sh \ +restapi/secure_relay_secret.sh restapi/secure_relay_secret_with_db_mysql.sh \ +restapi/secure_relay_secret.sh restapi/secure_relay_secret_with_db_redis.sh \ +restapi/secure_udp_client_with_secret.sh \ +restapi/shared_secret_maintainer.pl \ +shorttermsecure/secure_tcp_client_c2c_tcp_relay_short_term.sh shorttermsecure/secure_udp_client_short_term.sh shorttermsecure/secure_relay_short_term_mech.sh + +CONFIGURE_ENV+= PTHREAD_LIBS=-pthread + +.if ${PORT_OPTIONS:MPGSQL} +USE_PGSQL= yes +LIB_DEPENDS+= pq:${PORTSDIR}/databases/postgresql90-client +.else +CONFIGURE_ENV+= TURN_NO_PQ=1 +.endif + +.if ${PORT_OPTIONS:MMYSQL} +USE_MYSQL= yes +LIB_DEPENDS+= mysqlclient:${PORTSDIR}/databases/mysql55-client +.else +CONFIGURE_ENV+= TURN_NO_MYSQL=1 +.endif + +.if ${PORT_OPTIONS:MREDIS} +LIB_DEPENDS+= hiredis:${PORTSDIR}/databases/hiredis/ +.else +CONFIGURE_ENV+= TURN_NO_HIREDIS=1 +.endif + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/bin/turnserver ${PREFIX}/bin/turnserver + ${INSTALL_PROGRAM} ${WRKSRC}/bin/turnadmin ${PREFIX}/bin/turnadmin +.for f in ${_BIN_UTILS} + ${INSTALL_PROGRAM} ${WRKSRC}/bin/turnutils_${f} ${PREFIX}/bin/ +.endfor +.for f in ${MAN1} + ${INSTALL_MAN} ${WRKSRC}/man/man1/${f} ${PREFIX}/man/man1/${f} +.endfor + ${MKDIR} ${DATADIR}/ + ${INSTALL_DATA} ${WRKSRC}/turndb/schema.sql ${DATADIR}/schema.sql + ${INSTALL_DATA} ${WRKSRC}/turndb/schema.userdb.redis ${DATADIR}/schema.userdb.redis + ${INSTALL_DATA} ${WRKSRC}/turndb/schema.stats.redis ${DATADIR}/schema.stats.redis + ${INSTALL_DATA} ${WRKSRC}/lib/libturnclient.a ${PREFIX}/lib/libturnclient.a + ${INSTALL_DATA} ${WRKSRC}/examples/etc/turnserver.conf ${PREFIX}/etc/turnserver.conf.default + ${INSTALL_DATA} ${WRKSRC}/examples/etc/turnuserdb.conf ${PREFIX}/etc/turnuserdb.conf.default + ${MKDIR} ${PREFIX}/include/turn + (cd ${WRKSRC}/include/turn/ && ${COPYTREE_SHARE} client ${PREFIX}/include/turn/) + (cd ${WRKSRC}/include/turn/ && ${COPYTREE_SHARE} ns_turn_defs.h ${PREFIX}/include/turn/) +.if ${PORT_OPTIONS:MEXAMPLES} + ${MKDIR} ${EXAMPLESDIR}/scripts + ${MKDIR} ${EXAMPLESDIR}/scripts/basic + ${MKDIR} ${EXAMPLESDIR}/scripts/loadbalance + ${MKDIR} ${EXAMPLESDIR}/scripts/longtermsecure + ${MKDIR} ${EXAMPLESDIR}/scripts/longtermsecuredb + ${MKDIR} ${EXAMPLESDIR}/scripts/restapi + ${MKDIR} ${EXAMPLESDIR}/scripts/shorttermsecure + ${MKDIR} ${EXAMPLESDIR}/etc + ${INSTALL_MAN} ${WRKSRC}/examples/scripts/readme.txt ${EXAMPLESDIR}/scripts +.for f in ${_ETC_EXAMPLES} + ${INSTALL_DATA} ${WRKSRC}/examples/etc/${f} ${EXAMPLESDIR}/etc/ +.endfor +.for f in ${_SCRIPT_EXAMPLES} + ${INSTALL_SCRIPT} ${WRKSRC}/examples/scripts/${f} ${EXAMPLESDIR}/scripts/${f} +.endfor +.endif +.if ${PORT_OPTIONS:MDOCS} + ${MKDIR} ${DOCSDIR} +.for f in ${PORTDOCS} + (cd ${WRKSRC}/docs/ && ${COPYTREE_SHARE} ${f} ${DOCSDIR}) +.endfor +.for f in ${PORTREADMEDOCS} + ${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR} +.endfor + ${INSTALL_DATA} ${PKGMESSAGE} ${DOCSDIR}/postinstall.txt + ${INSTALL_DATA} ${WRKSRC}/turndb/schema.sql ${DOCSDIR}/schema.sql + ${INSTALL_DATA} ${WRKSRC}/turndb/schema.userdb.redis ${DOCSDIR}/schema.userdb.redis + ${INSTALL_DATA} ${WRKSRC}/turndb/schema.stats.redis ${DOCSDIR}/schema.stats.redis +PORTDOCS+= postinstall.txt ${PORTREADMEDOCS} schema.sql schema.userdb.redis schema.stats.redis +.endif + +post-install: + ${CAT} ${PKGMESSAGE} + +.include <bsd.port.mk> diff --git a/net/turnserver/distinfo b/net/turnserver/distinfo new file mode 100644 index 000000000000..11ef2390be3c --- /dev/null +++ b/net/turnserver/distinfo @@ -0,0 +1,2 @@ +SHA256 (turnserver-1.8.5.3.tar.gz) = c4a2481ed17d1f59ce58fe2dca1850d54527778b39d966186e681fedaf864872 +SIZE (turnserver-1.8.5.3.tar.gz) = 204682 diff --git a/net/turnserver/files/pkg-message.in b/net/turnserver/files/pkg-message.in new file mode 100644 index 000000000000..cf4abfaf4a01 --- /dev/null +++ b/net/turnserver/files/pkg-message.in @@ -0,0 +1,40 @@ +================================================================== + +1) You can start and stop the turnserver manually. But, if you want +to enable turnserver as an automatically started system service, +you have to: + + a) Create and edit /etc/turnserver.conf file. + Use %%PREFIX%%/etc/turnserver.conf.default as an example. + + b) For user accounts settings, if using the turnserver + with authentication: create and edit /etc/turnuserdb.conf + file, or set up PostgreSQL or MySQL or Redis database for user accounts. + Use %%PREFIX%%/etc/turnuserdb.conf.default as example for flat file DB, + or use %%DATADIR%%/schema.sql as database schema, + or use %%DATADIR%%/schema*redis as Redis + database description. + + d) add line turnserver_enable="YES" to /etc/rc.conf. + + e) If you are using a non-default PREFIX (other than /usr/local), + then edit /usr/local/etc/rc.d/turnserver file, according to + your system settings. + + f) Restart the system or run the command: + $ %%PREFIX%%/etc/rc.d/turnserver start + +2) If you do not want the turnserver to be a system service, + then you can start/stop it "manually", using the "turnserver" + executable with appropriate options (see the documentation). + +3) To create database schema, use schema in file %%DATADIR%%/schema.sql. + +4) For additional information, run: + + $ man turnserver + $ man turnadmin + $ man turnutils + +================================================================== + diff --git a/net/turnserver/files/turnserver.in b/net/turnserver/files/turnserver.in new file mode 100644 index 000000000000..369e1f72d15b --- /dev/null +++ b/net/turnserver/files/turnserver.in @@ -0,0 +1,30 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: turnserver +# REQUIRE: LOGIN +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# turnserver_enable (bool): Set to NO by default. +# Set it to YES to enable doormand. +# turnserver_config (path): Set to %%PREFIX%%/etc/turnserver.conf +# by default. + +. /etc/rc.subr + +: ${turnserver_enable:="NO"} +: ${turnserver_config="%%PREFIX%%/etc/turnserver.conf"} + +name="turnserver" +rcvar="`set_rcvar`" + +load_rc_config $name + +command="%%PREFIX%%/bin/${name}" +command_args="--daemon -c ${turnserver_config}" + +run_rc_command "$1" diff --git a/net/turnserver/pkg-descr b/net/turnserver/pkg-descr new file mode 100644 index 000000000000..39057f9cc78a --- /dev/null +++ b/net/turnserver/pkg-descr @@ -0,0 +1,4 @@ +This a BSD-licensed version of the RFC5766 TURN Server implementation, +with IPv6 and DTLS extensions. + +WWW: http://code.google.com/p/rfc5766-turn-server/ diff --git a/net/turnserver/pkg-plist b/net/turnserver/pkg-plist new file mode 100644 index 000000000000..7b572a0b6252 --- /dev/null +++ b/net/turnserver/pkg-plist @@ -0,0 +1,69 @@ +bin/turnserver +bin/turnadmin +bin/turnutils_peer +bin/turnutils_rfc5769check +bin/turnutils_stunclient +bin/turnutils_uclient +lib/libturnclient.a +etc/turnserver.conf.default +etc/turnuserdb.conf.default +%%DATADIR%%/schema.sql +%%DATADIR%%/schema.userdb.redis +%%DATADIR%%/schema.stats.redis +@dirrmtry %%DATADIR%% +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/etc/turnserver.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/etc/turnuserdb.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/etc/turn_client_cert.pem +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/etc/turn_client_pkey.pem +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/etc/turn_server_cert.pem +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/etc/turn_server_pkey.pem +%%PORTEXAMPLES%%@dirrmtry %%EXAMPLESDIR%%/etc +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/readme.txt +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/peer.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/rfc5769.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/basic/relay.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/basic/tcp_client_c2c_tcp_relay.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/basic/udp_c2c_client.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/basic/udp_client.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/basic/tcp_client.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/loadbalance/master_relay.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/loadbalance/slave_relay_1.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/loadbalance/slave_relay_2.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/loadbalance/udp_c2c.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/loadbalance/tcp_c2c_tcp_relay.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/longtermsecure/secure_dtls_client.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/longtermsecure/secure_relay.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/longtermsecure/secure_tcp_client_c2c_tcp_relay.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/longtermsecure/secure_tcp_client.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/longtermsecure/secure_tls_client_c2c_tcp_relay.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/longtermsecure/secure_tls_client.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/longtermsecure/secure_udp_c2c.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/longtermsecure/secure_udp_client.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/longtermsecuredb/secure_relay_with_db_psql.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/longtermsecuredb/secure_relay_with_db_mysql.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/longtermsecuredb/secure_relay_with_db_redis.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/restapi/secure_relay_secret.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/restapi/secure_relay_secret_with_db_mysql.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/restapi/secure_relay_secret_with_db_redis.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/restapi/secure_udp_client_with_secret.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/restapi/shared_secret_maintainer.pl +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/shorttermsecure/secure_tcp_client_c2c_tcp_relay_short_term.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/shorttermsecure/secure_udp_client_short_term.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/scripts/shorttermsecure/secure_relay_short_term_mech.sh +%%PORTEXAMPLES%%@dirrmtry %%EXAMPLESDIR%%/scripts/basic +%%PORTEXAMPLES%%@dirrmtry %%EXAMPLESDIR%%/scripts/loadbalance +%%PORTEXAMPLES%%@dirrmtry %%EXAMPLESDIR%%/scripts/longtermsecure +%%PORTEXAMPLES%%@dirrmtry %%EXAMPLESDIR%%/scripts/longtermsecuredb +%%PORTEXAMPLES%%@dirrmtry %%EXAMPLESDIR%%/scripts/restapi +%%PORTEXAMPLES%%@dirrmtry %%EXAMPLESDIR%%/scripts/shorttermsecure +%%PORTEXAMPLES%%@dirrmtry %%EXAMPLESDIR%%/scripts +%%PORTEXAMPLES%%@dirrmtry %%EXAMPLESDIR%% +include/turn/ns_turn_defs.h +include/turn/client/TurnMsgLib.h +include/turn/client/ns_turn_ioaddr.h +include/turn/client/ns_turn_msg.h +include/turn/client/ns_turn_msg_addr.h +include/turn/client/ns_turn_msg_defs.h +@dirrmtry include/turn/client/ +@dirrmtry include/turn +@stopdaemon turnserver |