pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/multimedia/mediatomb Improvements for the "mediatomb" ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9714f915dcba
branches:  trunk
changeset: 549470:9714f915dcba
user:      tron <tron%pkgsrc.org@localhost>
date:      Mon Nov 03 17:04:51 2008 +0000

description:
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.

diffstat:

 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(-)

diffs (93 lines):

diff -r 237a6d064a22 -r 9714f915dcba multimedia/mediatomb/INSTALL
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/mediatomb/INSTALL      Mon Nov 03 17:04:51 2008 +0000
@@ -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 -r 237a6d064a22 -r 9714f915dcba multimedia/mediatomb/Makefile
--- a/multimedia/mediatomb/Makefile     Mon Nov 03 14:18:42 2008 +0000
+++ b/multimedia/mediatomb/Makefile     Mon Nov 03 17:04:51 2008 +0000
@@ -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 @@
 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 -r 237a6d064a22 -r 9714f915dcba multimedia/mediatomb/PLIST
--- a/multimedia/mediatomb/PLIST        Mon Nov 03 14:18:42 2008 +0000
+++ b/multimedia/mediatomb/PLIST        Mon Nov 03 17:04:51 2008 +0000
@@ -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 -r 237a6d064a22 -r 9714f915dcba multimedia/mediatomb/files/mediatomb.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/mediatomb/files/mediatomb.sh   Mon Nov 03 17:04:51 2008 +0000
@@ -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



Home | Main Index | Thread Index | Old Index