summaryrefslogtreecommitdiff
path: root/multimedia/mediatomb
diff options
context:
space:
mode:
authortron <tron>2008-11-03 17:04:51 +0000
committertron <tron>2008-11-03 17:04:51 +0000
commit945bf2d4b6dfa2f848c9ec0562ca1cc880552790 (patch)
tree593ecfdf23debe39ca4ef702f198d5d740308fa9 /multimedia/mediatomb
parente619d78e454605c67e518aae6dd37c0cfbd4fad7 (diff)
downloadpkgsrc-945bf2d4b6dfa2f848c9ec0562ca1cc880552790.tar.gz
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 (limited to 'multimedia/mediatomb')
-rw-r--r--multimedia/mediatomb/INSTALL14
-rw-r--r--multimedia/mediatomb/Makefile18
-rw-r--r--multimedia/mediatomb/PLIST3
-rw-r--r--multimedia/mediatomb/files/mediatomb.sh25
4 files changed, 57 insertions, 3 deletions
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