summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--multimedia/tvheadend/Makefile9
-rw-r--r--multimedia/tvheadend/files/tvheadend.in43
-rw-r--r--multimedia/tvheadend/pkg-message7
3 files changed, 58 insertions, 1 deletions
diff --git a/multimedia/tvheadend/Makefile b/multimedia/tvheadend/Makefile
index 81c9e1c669c7..54a39d7860b3 100644
--- a/multimedia/tvheadend/Makefile
+++ b/multimedia/tvheadend/Makefile
@@ -3,6 +3,7 @@
PORTNAME= tvheadend
PORTVERSION= 3.4.0.20130726.3
+PORTREVISION= 1
CATEGORIES= multimedia
MASTER_SITES= http://people.freebsd.org/~decke/distfiles/
DISTFILES= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX} dvb-scan-tables-20130714.tar.gz
@@ -28,6 +29,14 @@ USE_PYTHON= yes
GNU_CONFIGURE= yes
MAKE_JOBS_UNSAFE= yes
MAN1= ${PORTNAME}.1
+USE_RC_SUBR= ${PORTNAME}
+
+TVHUSER?= webcamd
+TVHGROUP?= webcamd
+USERS= ${TVHUSER}
+GROUPS= ${TVHGROUP}
+SUB_LIST+= TVHUSER="${TVHUSER}" \
+ TVHGROUP="${TVHGROUP}"
OPTIONS_DEFINE= AVAHI
diff --git a/multimedia/tvheadend/files/tvheadend.in b/multimedia/tvheadend/files/tvheadend.in
new file mode 100644
index 000000000000..402cfea04e1a
--- /dev/null
+++ b/multimedia/tvheadend/files/tvheadend.in
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: tvheadend
+# REQUIRE: DAEMON webcamd
+# KEYWORD: shutdown
+#
+# Add the following line to /etc/rc.conf[.local] to enable tvheadend
+#
+# tvheadend_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable tvheadend.
+# tvheadend_user (str): User account to run with.
+# tvheadend_group (str): Group to run with.
+# tvheadend_flags (str): Custom flags for tvheadend.
+
+. /etc/rc.subr
+
+: ${tvheadend_enable="NO"}
+: ${tvheadend_user="%%TVHUSER%%"}
+: ${tvheadend_group="%%TVHGROUP%%"}
+
+name=tvheadend
+rcvar=tvheadend_enable
+pidfile="/var/run/${name}.pid"
+confdir="%%PREFIX%%/etc/tvheadend"
+command="%%PREFIX%%/bin/tvheadend"
+command_args="-f -p ${pidfile} -u ${tvheadend_user} -g ${tvheadend_group} -c ${confdir}"
+start_precmd="${name}_prestart"
+
+tvheadend_prestart()
+{
+ if [ ! -f "${pidfile}" ]; then
+ /usr/bin/install -o ${tvheadend_user} -g ${tvheadend_group} -m 644 /dev/null ${pidfile}
+ fi
+ if [ ! -d "${confdir}" ]; then
+ /usr/bin/install -o ${tvheadend_user} -g ${tvheadend_group} -m 755 -d ${confdir}
+ fi
+}
+
+load_rc_config $name
+
+run_rc_command "$1"
diff --git a/multimedia/tvheadend/pkg-message b/multimedia/tvheadend/pkg-message
index a6859e0b8985..51ca93379572 100644
--- a/multimedia/tvheadend/pkg-message
+++ b/multimedia/tvheadend/pkg-message
@@ -7,7 +7,12 @@ kill kenny or spill your beer so don't expect too much.
Known issues:
- no libav support
- no libdvbcsa support
-- no rc.d script
+
+For the first start in your /etc/rc.conf:
+ tvheadend_enable="YES"
+ tvheadend_flags="-C"
+
+The second line can be removed after the first start.
Patches, feedback and help are always welcome!