From 4e09da7452a67cb186a14a2f8967cdeb4518940e Mon Sep 17 00:00:00 2001 From: Tee KOBAYASHI Date: Tue, 1 Feb 2022 01:53:44 +0900 Subject: [PATCH] new package: mumble-server --- x11-packages/mumble-server/build.sh | 36 +++++++++++++++++ .../scripts-murmur-user-wrapper.patch | 40 +++++++++++++++++++ .../src-murmur-UnixMurmur.cpp.patch | 17 ++++++++ 3 files changed, 93 insertions(+) create mode 100644 x11-packages/mumble-server/build.sh create mode 100644 x11-packages/mumble-server/scripts-murmur-user-wrapper.patch create mode 100644 x11-packages/mumble-server/src-murmur-UnixMurmur.cpp.patch diff --git a/x11-packages/mumble-server/build.sh b/x11-packages/mumble-server/build.sh new file mode 100644 index 000000000..a35c01102 --- /dev/null +++ b/x11-packages/mumble-server/build.sh @@ -0,0 +1,36 @@ +TERMUX_PKG_HOMEPAGE=https://www.mumble.info/ +TERMUX_PKG_DESCRIPTION="Server module for Mumble, an open source voice-chat software" +TERMUX_PKG_LICENSE="BSD 3-Clause" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION=1.4.230 +TERMUX_PKG_SRCURL=https://github.com/mumble-voip/mumble.git +TERMUX_PKG_DEPENDS="libcap, libdns-sd, libprotobuf, openssl, qt5-qtbase" +TERMUX_PKG_BUILD_DEPENDS="boost, qt5-qtbase-cross-tools" +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-Dclient=OFF +-Dice=OFF +-Doverlay=OFF +-Dwarnings-as-errors=OFF +" + +termux_step_pre_configure() { + termux_setup_protobuf + + LDFLAGS+=" -lcap" +} + +termux_step_post_configure() { + if [ "$TERMUX_CMAKE_BUILD" == "Ninja" ]; then + sed -i s:${TERMUX_PREFIX//./\\.}'/bin/protoc[0-9.-]*:'$(which protoc):g \ + build.ninja + fi +} + +termux_step_post_make_install() { + ln -sfT mumble-server $TERMUX_PREFIX/bin/murmurd + cd $TERMUX_PKG_SRCDIR/scripts + install -Dm600 -t $TERMUX_PREFIX/etc/dbus-1/system.d murmur.conf + install -Dm600 -t $TERMUX_PREFIX/etc murmur.ini + install -Dm700 -t $TERMUX_PREFIX/bin murmur-user-wrapper + install -Dm600 -t $TERMUX_PREFIX/share/doc/mumble-server/examples murmur.ini +} diff --git a/x11-packages/mumble-server/scripts-murmur-user-wrapper.patch b/x11-packages/mumble-server/scripts-murmur-user-wrapper.patch new file mode 100644 index 000000000..2e0326e01 --- /dev/null +++ b/x11-packages/mumble-server/scripts-murmur-user-wrapper.patch @@ -0,0 +1,40 @@ +--- a/scripts/murmur-user-wrapper ++++ b/scripts/murmur-user-wrapper +@@ -6,7 +6,7 @@ + # Mumble source tree or at . + + DIR=$HOME/murmur +-SYSDIR=/usr/share/doc/mumble-server/examples ++SYSDIR=@TERMUX_PREFIX@/share/doc/mumble-server/examples + + if [ $UID == 0 ] || [ $EUID == 0 ]; then + echo "You should never run this script as root. If you want a system-wide install, see " +@@ -44,7 +44,7 @@ + DBUSFILE=$DIR/.dbus.sh + + if [ $DO_KILL == 1 ]; then +- if pkill -U $UID -u $EUID -o -x -f "/usr/sbin/murmurd -ini $DIR/murmur.ini"; then ++ if pkill -U $UID -u $EUID -o -x -f "@TERMUX_PREFIX@/bin/murmurd -ini $DIR/murmur.ini"; then + echo "Termination signal sent" + else + echo "Murmur process not found; not terminated" +@@ -82,11 +82,11 @@ + + if [ "X$SETPW" != "X" ]; then + echo "Setting superuser password to \"$SETPW\"" +- /usr/sbin/murmurd -ini $DIR/murmur.ini -supw $SETPW ++ @TERMUX_PREFIX@/bin/murmurd -ini $DIR/murmur.ini -supw $SETPW + exit 0 + fi + +-PID=$(pgrep -U $UID -u $EUID -o -x -f "/usr/sbin/murmurd -ini $DIR/murmur.ini") ++PID=$(pgrep -U $UID -u $EUID -o -x -f "@TERMUX_PREFIX@/bin/murmurd -ini $DIR/murmur.ini") + + if [ $DO_STATUS == 1 ]; then + if [ "X$PID" != "X" ]; then +@@ -117,4 +117,4 @@ + fi + + echo "Starting Murmur" +-exec /usr/sbin/murmurd -ini $DIR/murmur.ini ++exec @TERMUX_PREFIX@/bin/murmurd -ini $DIR/murmur.ini diff --git a/x11-packages/mumble-server/src-murmur-UnixMurmur.cpp.patch b/x11-packages/mumble-server/src-murmur-UnixMurmur.cpp.patch new file mode 100644 index 000000000..8e2bc0c3a --- /dev/null +++ b/x11-packages/mumble-server/src-murmur-UnixMurmur.cpp.patch @@ -0,0 +1,17 @@ +--- a/src/murmur/UnixMurmur.cpp ++++ b/src/murmur/UnixMurmur.cpp +@@ -380,10 +380,10 @@ + + QStringList inipaths; + +- inipaths << QLatin1String("/usr/local/etc/mumble-server.ini"); +- inipaths << QLatin1String("/usr/local/etc/murmur.ini"); +- inipaths << QLatin1String("/etc/mumble-server.ini"); +- inipaths << QLatin1String("/etc/murmur.ini"); ++ inipaths << QLatin1String("@TERMUX_PREFIX@/local/etc/mumble-server.ini"); ++ inipaths << QLatin1String("@TERMUX_PREFIX@/local/etc/murmur.ini"); ++ inipaths << QLatin1String("@TERMUX_PREFIX@/etc/mumble-server.ini"); ++ inipaths << QLatin1String("@TERMUX_PREFIX@/etc/murmur.ini"); + + foreach (const QString &f, inipaths) { + QFileInfo fi(f);