diff --git a/audio/mumble-server/Makefile b/audio/mumble-server/Makefile new file mode 100644 --- /dev/null +++ b/audio/mumble-server/Makefile @@ -0,0 +1,85 @@ +PORTNAME= murmur +PORTVERSION= 1.3.4 +CATEGORIES= audio net + +MAINTAINER= vvd@FreeBSD.org +COMMENT= Server component of Mumble +WWW= https://www.mumble.info/ + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${LOCALBASE}/include/boost/function.hpp:devel/boost-libs +LIB_DEPENDS= libabsl_base.so:devel/abseil \ + libprotobuf.so:devel/protobuf + +USES= compiler:c++11-lang qmake pkgconfig python:build qt:5 ssl +BROKEN_SSL= openssl openssl31 +BROKEN_SSL_REASON= Requires OpenSSL 3.0.0 deprecated CRYPTO_MEM_CHECK_ON +USE_CXXSTD= c++11 +USE_QT= buildtools:build core network sql xml + +USE_GITHUB= YES +GH_ACCOUNT= mumble-voip +GH_PROJECT= mumble + +CONFIG= no-client +QMAKE_ARGS= "CONFIG+=${CONFIG}" +QMAKE_ENV+= "MUMBLE_PYTHON=${PYTHON_CMD}" + +USE_RC_SUBR= murmur +SUB_LIST+= USERS="${USERS}" GROUPS="${GROUPS}" + +OPTIONS_DEFINE= BONJOUR DBUS DOCS ICE +OPTIONS_DEFAULT= BONJOUR MYSQL SQLITE +OPTIONS_MULTI= SQL +OPTIONS_MULTI_SQL= MYSQL SQLITE + +BONJOUR_DESC= Bonjour Support +BONJOUR_VARS_OFF= CONFIG+=no-bonjour +BONJOUR_LIB_DEPENDS= libdns_sd.so:net/mDNSResponder + +DBUS_VARS_OFF= CONFIG+=no-dbus +DBUS_USE= QT=dbus + +ICE_DESC= Ice Support +ICE_VARS_OFF= CONFIG+=no-ice +ICE_LIB_DEPENDS= libIce.so:devel/ice + +MYSQL_VARS_OFF= CONFIG+=no-sql-mysql +MYSQL_USE= QT=sql-mysql + +SQLITE_VARS_OFF= CONFIG+=no-sqlite3_run +SQLITE_USE= QT=sql-sqlite3:run + +USERS= murmur +GROUPS= murmur + +.include +# PCH is broken on GCC +.if ${CHOSEN_COMPILER_TYPE} == gcc +CONFIG+= no-pch +.endif + +post-patch: + @${REINPLACE_CMD} -e 's|--no-add-needed|--no-copy-dt-needed-entries|' ${WRKSRC}/qmake/compiler.pri + @${ECHO_CMD} 'QMAKE_LFLAGS += -fstack-protector' >> ${WRKSRC}/src/murmur/murmur.pro + +pre-install: + ${SED} -i '' -e 's|database=.*|database=/var/db/murmur/murmur.sqlite|' ${WRKSRC}/scripts/murmur.ini + ${SED} -i '' -e 's|#pidfile=.*|pidfile=/var/run/murmur/murmur.pid|' ${WRKSRC}/scripts/murmur.ini + ${SED} -i '' -e 's|#logfile=.*|logfile=/var/log/murmur/murmur.log|' ${WRKSRC}/scripts/murmur.ini + ${SED} -i '' -e 's|#host=.*|host=0.0.0.0|' ${WRKSRC}/scripts/murmur.ini + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/release/murmurd ${STAGEDIR}${PREFIX}/sbin + ${INSTALL_DATA} ${WRKSRC}/scripts/murmur.ini ${STAGEDIR}${PREFIX}/etc/murmur.ini.sample + ${CP} ${WRKSRC}/man/murmurd.1 ${STAGEDIR}${PREFIX}/share/man/man1 + +do-install-DOCS-on: + @${MKDIR} ${STAGEDIR}${DOCSDIR} +.for f in CHANGES INSTALL README README.Linux + ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR} +.endfor + +.include diff --git a/audio/mumble-server/distinfo b/audio/mumble-server/distinfo new file mode 100644 --- /dev/null +++ b/audio/mumble-server/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1705575971 +SHA256 (mumble-voip-mumble-1.3.4_GH0.tar.gz) = a692840423ddbd00ecca1ce174e4279c753acf58278579f603e56b644eae6f8e +SIZE (mumble-voip-mumble-1.3.4_GH0.tar.gz) = 4896282 diff --git a/audio/mumble-server/files/mumble_server.in b/audio/mumble-server/files/mumble_server.in new file mode 100644 --- /dev/null +++ b/audio/mumble-server/files/mumble_server.in @@ -0,0 +1,41 @@ +#!/bin/sh + +# PROVIDE: murmur +# REQUIRE: DAEMON +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# murmur_enable (bool): Set to NO by default. +# Set it to YES to enable murmur. +# murmur_flags (str): Set to "" by default. +# Extra flags passed to start command. +# + +. /etc/rc.subr + +name=murmur +rcvar=murmur_enable +load_rc_config $name + +# Set some defaults +: ${murmur_enable:=NO} +: ${murmur_user=%%USERS%%} + +command="%%PREFIX%%/sbin/murmurd" +command_args="-ini %%PREFIX%%/etc/murmur.ini" +pidfile=/var/run/murmur/murmur.pid +start_precmd=murmur_prestart +extra_commands="reload" +sig_reload="USR1" + +murmur_prestart() { + for i in /var/log/murmur /var/run/murmur /var/db/murmur; do + if [ ! -d ${i} ]; then + install -d -o %%USERS%% -g %%GROUPS%% ${i} + fi + done +} + +run_rc_command "$1" diff --git a/audio/mumble-server/files/patch-initialize-SSL b/audio/mumble-server/files/patch-initialize-SSL new file mode 100644 --- /dev/null +++ b/audio/mumble-server/files/patch-initialize-SSL @@ -0,0 +1,34 @@ +Description: the SSL library must be initialized, otherwise mumble and + mumble-server both fail to find the available ciphers after a rebuild + with openssl_1.0.2d-3. The two calls used are based on: + https://wiki.openssl.org/index.php/SSL/TLS_Client#Initialization +Author: Colomban Wendling + Christohper Knadle +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804363 +Bug-Mumble: https://github.com/mumble-voip/mumble/issues/1876 +Last-Updated: 2015-11-10 + +--- src/mumble/main.cpp.orig 2019-08-30 01:01:56 UTC ++++ src/mumble/main.cpp +@@ -132,6 +132,9 @@ int main(int argc, char **argv) { + + os_init(); + ++ SSL_library_init(); ++ SSL_load_error_strings(); ++ + bool bAllowMultiple = false; + bool suppressIdentity = false; + bool customJackClientName = false; +--- src/murmur/main.cpp.orig 2019-08-30 01:01:56 UTC ++++ src/murmur/main.cpp +@@ -205,6 +205,9 @@ int main(int argc, char **argv) { + QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); + #endif + ++ SSL_library_init(); ++ SSL_load_error_strings(); ++ + #ifdef Q_OS_WIN + // By default, windbus expects the path to dbus-daemon to be in PATH, and the path + // should contain bin\\, and the path to the config is hardcoded as ..\etc diff --git a/audio/mumble-server/files/patch-scripts_murmur.ini b/audio/mumble-server/files/patch-scripts_murmur.ini new file mode 100644 --- /dev/null +++ b/audio/mumble-server/files/patch-scripts_murmur.ini @@ -0,0 +1,18 @@ +--- scripts/murmur.ini.orig 2020-09-04 21:33:39 UTC ++++ scripts/murmur.ini +@@ -93,13 +93,13 @@ icesecretwrite= + ; logs to the file 'murmur.log'. If you leave this field blank + ; on Unix-like systems, Murmur will force itself into foreground + ; mode which logs to the console. +-;logfile=murmur.log ++logfile=/var/log/murmur/murmur.log + + ; If set, Murmur will write its process ID to this file + ; when running in daemon mode (when the -fg flag is not + ; specified on the command line). Only available on + ; Unix-like systems. +-;pidfile= ++pidfile=/var/run/murmur/murmur.pid + + ; The below will be used as defaults for new configured servers. + ; If you're just running one server (the default), it's easier to diff --git a/audio/mumble-server/files/patch-src_SelfSignedCertificate.cpp b/audio/mumble-server/files/patch-src_SelfSignedCertificate.cpp new file mode 100644 --- /dev/null +++ b/audio/mumble-server/files/patch-src_SelfSignedCertificate.cpp @@ -0,0 +1,15 @@ +--- src/SelfSignedCertificate.cpp.orig 2023-06-11 17:43:07 UTC ++++ src/SelfSignedCertificate.cpp +@@ -45,10 +45,12 @@ bool SelfSignedCertificate::generate(CertificateType c + QString commonName; + bool isServerCert = certificateType == CertificateTypeServerCertificate; + ++#ifdef CRYPTO_MEM_CHECK_ON + if (CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON) == -1) { + ok = false; + goto out; + } ++#endif + + x509 = X509_new(); + if (x509 == NULL) { diff --git a/audio/mumble-server/pkg-descr b/audio/mumble-server/pkg-descr new file mode 100644 --- /dev/null +++ b/audio/mumble-server/pkg-descr @@ -0,0 +1,2 @@ +Murmur is the server component of Mumble, a low-latency, high quality +VoIP application. diff --git a/audio/mumble-server/pkg-plist b/audio/mumble-server/pkg-plist new file mode 100644 --- /dev/null +++ b/audio/mumble-server/pkg-plist @@ -0,0 +1,7 @@ +@sample etc/murmur.ini.sample +share/man/man1/murmurd.1.gz +sbin/murmurd +%%PORTDOCS%%%%DOCSDIR%%/CHANGES +%%PORTDOCS%%%%DOCSDIR%%/INSTALL +%%PORTDOCS%%%%DOCSDIR%%/README +%%PORTDOCS%%%%DOCSDIR%%/README.Linux