From 05e8725e135452dcea2a364ec53338ca10a35089 Mon Sep 17 00:00:00 2001 From: Martin Wilke Date: Sun, 26 Jun 2011 07:17:01 +0000 Subject: [PATCH] uMurmur is a minimalistic Mumble server primarily targeted to run on routers with an open OS like OpenWRT. The server part of Mumble is called Murmur, hence the name uMurmur. WWW: http://http://code.google.com/p/umurmur/ PR: ports/154995 Submitted by: Ayumi Mitsui --- audio/Makefile | 1 + audio/umurmur/Makefile | 44 ++++++++++++++++++++++++++++++ audio/umurmur/distinfo | 2 ++ audio/umurmur/files/patch-Makefile | 15 ++++++++++ audio/umurmur/files/patch-conf.c | 39 ++++++++++++++++++++++++++ audio/umurmur/files/umurmur.in | 36 ++++++++++++++++++++++++ audio/umurmur/pkg-deinstall | 21 ++++++++++++++ audio/umurmur/pkg-descr | 5 ++++ audio/umurmur/pkg-install | 38 ++++++++++++++++++++++++++ audio/umurmur/pkg-plist | 7 +++++ 10 files changed, 208 insertions(+) create mode 100644 audio/umurmur/Makefile create mode 100644 audio/umurmur/distinfo create mode 100644 audio/umurmur/files/patch-Makefile create mode 100644 audio/umurmur/files/patch-conf.c create mode 100644 audio/umurmur/files/umurmur.in create mode 100644 audio/umurmur/pkg-deinstall create mode 100644 audio/umurmur/pkg-descr create mode 100644 audio/umurmur/pkg-install create mode 100644 audio/umurmur/pkg-plist diff --git a/audio/Makefile b/audio/Makefile index 8ea939643146..7e342edf8374 100644 --- a/audio/Makefile +++ b/audio/Makefile @@ -778,6 +778,7 @@ SUBDIR += ufmcontrol-i18n SUBDIR += umix SUBDIR += umodplayer + SUBDIR += umurmur SUBDIR += vagalume SUBDIR += vat SUBDIR += ventrilo-server diff --git a/audio/umurmur/Makefile b/audio/umurmur/Makefile new file mode 100644 index 000000000000..bd3635f99a87 --- /dev/null +++ b/audio/umurmur/Makefile @@ -0,0 +1,44 @@ +# New ports collection makefile for: umurmur +# Date created: 2011-02-24 +# Whom: Ayumi Mitsui +# +# $FreeBSD$ +# + +PORTNAME= umurmur +PORTVERSION= 0.2.6 +CATEGORIES= audio net +MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE} + +MAINTAINER= ayu@commun.jp +COMMENT= Minimalistic Murmur (Mumble server) + +LIB_DEPENDS= config.9:${PORTSDIR}/devel/libconfig + +USE_GMAKE= yes +USE_OPENSSL= yes + +USE_RC_SUBR= umurmur + +MAKE_ENV+= TARGET_ARCH= + +.include + +do-build: + @(cd ${WRKSRC}/src; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} all) + +pre-su-install: + @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL + +pre-install: + @${SED} -i '' -e 's|"/etc/|"${PREFIX}/etc/|' ${WRKSRC}/umurmur.conf.example + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/src/umurmurd ${PREFIX}/sbin + @${MKDIR} ${PREFIX}/etc/umurmur + @${INSTALL_DATA} ${WRKSRC}/umurmur.conf.example ${PREFIX}/etc/umurmur/umurmur.conf.sample + @if [ ! -f ${PREFIX}/etc/umurmur/umurmur.conf ]; then \ + ${CP} -p ${PREFIX}/etc/umurmur/umurmur.conf.sample ${PREFIX}/etc/umurmur/umurmur.conf; \ + fi + +.include diff --git a/audio/umurmur/distinfo b/audio/umurmur/distinfo new file mode 100644 index 000000000000..4bbd70692493 --- /dev/null +++ b/audio/umurmur/distinfo @@ -0,0 +1,2 @@ +SHA256 (umurmur-0.2.6.tar.gz) = b1f237191ea1db7890be86bc3ebe562570901d8bd58bc53d9ecee0a3f4be38cb +SIZE (umurmur-0.2.6.tar.gz) = 86014 diff --git a/audio/umurmur/files/patch-Makefile b/audio/umurmur/files/patch-Makefile new file mode 100644 index 000000000000..4e4b179314f8 --- /dev/null +++ b/audio/umurmur/files/patch-Makefile @@ -0,0 +1,15 @@ +--- src/Makefile.orig 2011-02-24 13:06:56.000000000 +0900 ++++ src/Makefile 2011-02-24 13:07:54.000000000 +0900 +@@ -25,9 +25,10 @@ + # OpenSSL - usually installed at a standard place + # EXTRA_CFLAGS:= + # EXTRA_LDFLAGS:=-lcrypto -lssl ++EXTRA_LDFLAGS:=-lcrypto -lssl + +-CFLAGS:=$(CFLAGS) -I. -Wall $(EXTRA_CFLAGS) +-LDFLAGS:=$(EXTRA_LDFLAGS) $(LDFLAGS) -lconfig ++CFLAGS:=$(CFLAGS) -I. -I/usr/local/include -Wall $(EXTRA_CFLAGS) ++LDFLAGS:=$(EXTRA_LDFLAGS) $(LDFLAGS) -L/usr/local/lib -lconfig + + umurmurd:google/protobuf-c/libprotobuf_c.a $(OBJS) + $(CC) $(LDFLAGS) $(OBJS) $(SSL_LIB) google/protobuf-c/libprotobuf_c.a -o umurmurd diff --git a/audio/umurmur/files/patch-conf.c b/audio/umurmur/files/patch-conf.c new file mode 100644 index 000000000000..a1ec098a543f --- /dev/null +++ b/audio/umurmur/files/patch-conf.c @@ -0,0 +1,39 @@ +--- src/conf.c.orig 2011-02-24 13:16:42.000000000 +0900 ++++ src/conf.c 2011-02-24 13:17:50.000000000 +0900 +@@ -40,7 +40,7 @@ + + static config_t configuration; + +-#define DEFAULT_CONFIG "/etc/umurmur.conf" ++#define DEFAULT_CONFIG "/usr/local/etc/umurmur/umurmur.conf" + #define DEFAULT_WELCOME "Welcome to uMurmur!" + #define DEFAULT_MAX_CLIENTS 10 + #define DEFAULT_MAX_BANDWIDTH 48000 +@@ -73,23 +73,23 @@ + case CERTIFICATE: + setting = config_lookup(&configuration, "certificate"); + if (!setting) +- return "/etc/umurmur/certificate.crt"; ++ return "/usr/local/etc/umurmur/certificate.crt"; + else { + if ((strsetting = config_setting_get_string(setting)) != NULL) + return strsetting; + else +- return "/etc/umurmur/certificate.crt"; ++ return "/usr/local/etc/umurmur/certificate.crt"; + } + break; + case KEY: + setting = config_lookup(&configuration, "private_key"); + if (!setting) +- return "/etc/umurmur/private_key.key"; ++ return "/usr/local/etc/umurmur/private_key.key"; + else { + if ((strsetting = config_setting_get_string(setting)) != NULL) + return strsetting; + else +- return "/etc/umurmur/private_key.key"; ++ return "/usr/local/etc/umurmur/private_key.key"; + } + break; + case PASSPHRASE: diff --git a/audio/umurmur/files/umurmur.in b/audio/umurmur/files/umurmur.in new file mode 100644 index 000000000000..3a19eadc08cd --- /dev/null +++ b/audio/umurmur/files/umurmur.in @@ -0,0 +1,36 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: umurmur +# REQUIRE: DAEMON +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# umurmur_enable (bool): Set to NO by default. +# Set it to YES to enable umurmur. +# umurmur_flags (str): Set to "" by default. +# Extra flags passed to start command. +# + +. /etc/rc.subr + +# Set some defaults +: ${umurmur_enable="NO"} +: ${umurmur_user="umurmur"} +: ${umurmur_flags=""} + +name=umurmur +rcvar=${name}_enable + +# pidfile +pidfile="/var/run/umurmur/umurmur.pid" + +command="%%PREFIX%%/sbin/umurmurd" +command_args="-p ${pidfile}" + +load_rc_config $name + +run_rc_command "$1" diff --git a/audio/umurmur/pkg-deinstall b/audio/umurmur/pkg-deinstall new file mode 100644 index 000000000000..74eaab2745de --- /dev/null +++ b/audio/umurmur/pkg-deinstall @@ -0,0 +1,21 @@ +#!/bin/sh +# $FreeBSD$ + +PATH=/bin:/usr/sbin +USER=umurmur +GROUP=umurmur +RUNDIR=/var/run/umurmur + +case $2 in + POST-DEINSTALL) + if pw group show ${GROUP} 2>&1 > /dev/null; then + echo "You should manually remove the \"${GROUP}\" group." + fi + + if pw user show ${USER} 2>&1 > /dev/null; then + echo "You should manually remove the \"${USER}\" user." + fi + + rm -Rf ${RUNDIR} + ;; +esac diff --git a/audio/umurmur/pkg-descr b/audio/umurmur/pkg-descr new file mode 100644 index 000000000000..ce318e46bbbe --- /dev/null +++ b/audio/umurmur/pkg-descr @@ -0,0 +1,5 @@ +uMurmur is a minimalistic Mumble server primarily targeted to run on +routers with an open OS like OpenWRT. +The server part of Mumble is called Murmur, hence the name uMurmur. + +WWW: http://http://code.google.com/p/umurmur/ diff --git a/audio/umurmur/pkg-install b/audio/umurmur/pkg-install new file mode 100644 index 000000000000..a7bc37b8d378 --- /dev/null +++ b/audio/umurmur/pkg-install @@ -0,0 +1,38 @@ +#!/bin/sh +# $FreeBSD$ + +PATH=/bin:/usr/sbin +USER=umurmur +GROUP=umurmur +HOME=/nonexistent +RUNDIR=/var/run/umurmur + +case $2 in + PRE-INSTALL) + if pw group show ${GROUP} 2> /dev/null; then + else + if pw groupadd ${GROUP}; then + echo "Added group \"${GROUP}\"." + else + echo "Adding group \"${GROUP}\" failed..." + exit 1 + fi + fi + + if pw user show ${USER} 2> /dev/null; then + else + if pw useradd ${USER} -g ${GROUP} -h - \ + -d ${HOME} -c "uMurmur" + then + echo "Added user \"${USER}\"." + else + echo "Adding user \"${USER}\" failed..." + exit 1 + fi + fi + + mkdir -m 750 ${RUNDIR} 2> /dev/null + chown -R ${USER}:${GROUP} ${RUNDIR} + + ;; +esac diff --git a/audio/umurmur/pkg-plist b/audio/umurmur/pkg-plist new file mode 100644 index 000000000000..af7c7744f0ee --- /dev/null +++ b/audio/umurmur/pkg-plist @@ -0,0 +1,7 @@ +@comment $FreeBSD$ +@stopdaemon umurmur +@unexec if cmp -s %D/etc/umurmur/umurmur.conf.sample %D/etc/umurmur/umurmur.conf; then rm -f %D/etc/umurmur/umurmur.conf; fi +etc/umurmur/umurmur.conf.sample +@exec if [ ! -f %D/etc/umurmur/umurmur.conf ] ; then cp -p %D/%F %B/umurmur/umurmur.conf; fi +sbin/umurmurd +@dirrmtry etc/umurmur