From 945bf2d4b6dfa2f848c9ec0562ca1cc880552790 Mon Sep 17 00:00:00 2001 From: tron Date: Mon, 3 Nov 2008 17:04:51 +0000 Subject: Improvements for the "mediatomb" package: 1.) Create a user and group "mediatomb" for running the server to restrict the files which can be accessed. 2.) Add a startup script to start the server automatically. Bump package revision because of these fixes. Changes approved by Alistair Crooks. --- multimedia/mediatomb/INSTALL | 14 ++++++++++++++ multimedia/mediatomb/Makefile | 18 ++++++++++++++++-- multimedia/mediatomb/PLIST | 3 ++- multimedia/mediatomb/files/mediatomb.sh | 25 +++++++++++++++++++++++++ 4 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 multimedia/mediatomb/INSTALL create mode 100644 multimedia/mediatomb/files/mediatomb.sh (limited to 'multimedia') diff --git a/multimedia/mediatomb/INSTALL b/multimedia/mediatomb/INSTALL new file mode 100644 index 00000000000..92abe9d4466 --- /dev/null +++ b/multimedia/mediatomb/INSTALL @@ -0,0 +1,14 @@ +#!@SH@ +# +# $NetBSD: INSTALL,v 1.1 2008/11/03 17:04:51 tron Exp $ + +PKG_HOME="@PKG_HOME@" +MEDIATOMB_USER="@MEDIATOMB_USER@" +MEDIATOMB_GROUP="@MEDIATOMB_GROUP@" + +case "${STAGE}" in +PRE-INSTALL) + ${MKDIR} -m 0750 ${PKG_HOME} + ${CHOWN} ${MEDIATOMB_USER}:${MEDIATOMB_GROUP} ${PKG_HOME} + ;; +esac diff --git a/multimedia/mediatomb/Makefile b/multimedia/mediatomb/Makefile index e311c14b0fe..2765153b343 100644 --- a/multimedia/mediatomb/Makefile +++ b/multimedia/mediatomb/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.4 2008/09/08 15:14:21 ahoka Exp $ +# $NetBSD: Makefile,v 1.5 2008/11/03 17:04:51 tron Exp $ DISTNAME= mediatomb-0.11.0 -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= multimedia MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=mediatomb/} @@ -14,6 +14,20 @@ GNU_CONFIGURE= yes USE_LANGUAGES+= c c++ USE_TOOLS+= pkg-config +RCD_SCRIPTS= mediatomb + +.include "../../mk/bsd.prefs.mk" + +PKG_GROUPS= ${MEDIATOMB_GROUP} +PKG_USERS= ${MEDIATOMB_USER}:${MEDIATOMB_GROUP} + +PKG_GECOS.${MEDIATOMB_USER}= MediaTomb Server +PKG_HOME.${MEDIATOMB_USER}= ${VARBASE}/mediatomb + +FILES_SUBST+= PKG_HOME=${PKG_HOME.${MEDIATOMB_USER}:Q} +FILES_SUBST+= MEDIATOMB_GROUP=${MEDIATOMB_GROUP:Q} +FILES_SUBST+= MEDIATOMB_USER=${MEDIATOMB_USER:Q} + PREFER.bind= pkgsrc # we need the package for the lwres lib .include "options.mk" diff --git a/multimedia/mediatomb/PLIST b/multimedia/mediatomb/PLIST index 441af1d0d99..025deb85b97 100644 --- a/multimedia/mediatomb/PLIST +++ b/multimedia/mediatomb/PLIST @@ -1,6 +1,7 @@ -@comment $NetBSD: PLIST,v 1.1.1.1 2008/04/09 20:36:38 agc Exp $ +@comment $NetBSD: PLIST,v 1.2 2008/11/03 17:04:51 tron Exp $ bin/mediatomb man/man1/mediatomb.1 +share/examples/rc.d/mediatomb share/mediatomb/js/common.js share/mediatomb/js/import.js share/mediatomb/js/playlists.js diff --git a/multimedia/mediatomb/files/mediatomb.sh b/multimedia/mediatomb/files/mediatomb.sh new file mode 100644 index 00000000000..596179ab930 --- /dev/null +++ b/multimedia/mediatomb/files/mediatomb.sh @@ -0,0 +1,25 @@ +#!@RCD_SCRIPTS_SHELL@ +# +# $NetBSD: mediatomb.sh,v 1.1 2008/11/03 17:04:51 tron Exp $ +# + +# PROVIDE: mediatomb +# REQUIRE: DAEMON + +. /etc/rc.subr + +name="mediatomb" +rcvar=$name +command="@PREFIX@/bin/mediatomb" +logfile="@VARBASE@/log/${name}.log" +pidfile="@PKG_HOME@/${name}.pid" +command_args="-d -u @MEDIATOMB_USER@ -g @MEDIATOMB_USER@ -m @PKG_HOME@ -P ${pidfile} -l ${logfile} -f ." +extra_commands="reload" + +if [ -f /etc/rc.subr ]; then + load_rc_config $name + run_rc_command "$1" +else + echo -n "${name}" + ${command} ${mediatomb_flags} ${command_args} +fi -- cgit v1.2.3