From 02d0d25013b533b17071eb5875dc660135b1bd53 Mon Sep 17 00:00:00 2001
From: Matthias Schwarzott <zzam@gentoo.org>
Date: Sat, 4 Mar 2006 17:51:16 +0000
Subject: imported ebuild from gentoo.de Package-Manager: portage-2.1_pre5-r3

---
 media-plugins/vdr-remote/files/confd               | 43 ++++++++++
 .../vdr-remote/files/digest-vdr-remote-0.3.6       |  3 +
 media-plugins/vdr-remote/files/rc-addon.sh         | 99 ++++++++++++++++++++++
 3 files changed, 145 insertions(+)
 create mode 100644 media-plugins/vdr-remote/files/confd
 create mode 100644 media-plugins/vdr-remote/files/digest-vdr-remote-0.3.6
 create mode 100644 media-plugins/vdr-remote/files/rc-addon.sh

(limited to 'media-plugins/vdr-remote/files')

diff --git a/media-plugins/vdr-remote/files/confd b/media-plugins/vdr-remote/files/confd
new file mode 100644
index 000000000000..d34513c6d230
--- /dev/null
+++ b/media-plugins/vdr-remote/files/confd
@@ -0,0 +1,43 @@
+# /etc/conf.d/vdr.remote:
+
+# Config-file for vdr plugin remote
+
+#
+# Read keypresses from linux-kernel input-devices
+# for example IR-Input on DVB-cards
+#   allowed values: no, autodetect or list of devices /dev/input/eventX (X=0,1,...)
+#   default: autodetect
+#
+#REMOTE_PLUGIN_INPUT_DEVICE="no"
+#
+
+#
+# Connect to lirc-daemon on this socket
+#   allowed values: list of sockets, example: /dev/lircd
+#   default: do not use any lirc-daemon from inside this plugin
+#
+#REMOTE_PLUGIN_LIRC=""
+
+#
+# Listen on these tcp-ports for connections which get OSD and
+# can send keypresses to vdr
+#   allowed values: List of portnumbers (>1024)
+#   default: do not open any tcp-port
+#
+#REMOTE_PLUGIN_TCP_PORTS=""
+
+#
+# Listen on these tty-device for keypresses, do not show osd there
+#   allowed values: List of tty-device names (/dev/ttyX)
+#   default: do not open any tty-devices
+#
+#REMOTE_PLUGIN_TTY_ONLY_INPUT=""
+
+#
+# Listen on these tty-device for keypresses and show the
+# osd there
+#   allowed values: List of tty-device names (/dev/ttyX)
+#   default: do not open any tty-devices
+#
+#REMOTE_PLUGIN_TTY_WITH_OSD=""
+
diff --git a/media-plugins/vdr-remote/files/digest-vdr-remote-0.3.6 b/media-plugins/vdr-remote/files/digest-vdr-remote-0.3.6
new file mode 100644
index 000000000000..736fe7708175
--- /dev/null
+++ b/media-plugins/vdr-remote/files/digest-vdr-remote-0.3.6
@@ -0,0 +1,3 @@
+MD5 3c3b6059a94434a00f9abf100d66565f vdr-remote-0.3.6.tgz 23804
+RMD160 dc2a9bc28c1c845b5cfc2538417235e3afbe24f7 vdr-remote-0.3.6.tgz 23804
+SHA256 ae05203f2092722cba4c45714b280e7e6f6ed6dfd498aecc56ed5d5c846f9cfd vdr-remote-0.3.6.tgz 23804
diff --git a/media-plugins/vdr-remote/files/rc-addon.sh b/media-plugins/vdr-remote/files/rc-addon.sh
new file mode 100644
index 000000000000..3457788f4f9e
--- /dev/null
+++ b/media-plugins/vdr-remote/files/rc-addon.sh
@@ -0,0 +1,99 @@
+#
+# rc-addon-script for plugin remote
+#
+
+check_device() {
+	local handlers="${1}"
+	local name="${2}"
+	local eventdev=""
+	[[ "${handlers}" == "" ]] && return
+
+	for handler in ${handlers}; do
+		case ${handler} in
+		event*)
+			eventdev=${handler}
+			;;
+		esac
+	done
+	if [[ "${eventdev}" == "" ]]; then
+		[[ "${evdev_warning_showed}" != "1" ]] \
+		&& echo "you need to load module evdev for autodetect input-devices to work"
+		evdev_warning_showed=1
+		return
+	fi
+	if [[ (${name/dvb/} != ${name}) || (${name/DVB/} == ${name}) ]]; then
+		return
+	fi
+	
+	einfo_level1 "Autodetect Input Device ${eventdev} (Name: ${name})"
+	REMOTE_PLUGIN_INPUT_DEVICE="${REMOTE_PLUGIN_INPUT_DEVICE} /dev/input/${eventdev}"
+	return
+}
+
+autodetect_input_devices() {
+	[[ -e /proc/bus/input/devices ]] || return
+	exec 3</proc/bus/input/devices
+	while read -u 3 line; do
+		case ${line} in
+		I:*)	check_device "${device}" "${name}" 
+			device=""
+			;;
+		H:*)	device=${line#H: Handlers=}
+			;;
+		N:*)	name=${line#N: Name=\"}
+			name=${name%\"}
+			;;
+		esac
+	done
+	check_device "${device}" "${name}"
+	exec 3<&-
+}
+
+plugin_pre_vdr_start() {
+	if [[ ${REMOTE_PLUGIN_INPUT_DEVICE:-autodetect} == "autodetect" ]]; then
+		REMOTE_PLUGIN_INPUT_DEVICE=""
+		autodetect_input_devices
+	fi
+	if [[ -n ${REMOTE_PLUGIN_INPUT_DEVICE} && "${REMOTE_PLUGIN_INPUT_DEVICE}" != "no" ]]; then
+		chown vdr:vdr /proc/av7110_ir
+		for dev in ${REMOTE_PLUGIN_INPUT_DEVICE}; do
+			[[ -e ${dev} ]] || continue
+			chown vdr:vdr ${dev}
+			add_plugin_param "--input=${dev}"
+		done
+	fi
+
+	if [[ -n ${REMOTE_PLUGIN_LIRC} ]]; then
+		for dev in ${REMOTE_PLUGIN_LIRC}; do
+			[[ -e ${dev} ]] || continue
+			add_plugin_param "--lirc=${dev}"
+		done
+	fi
+
+	if [[ -n ${REMOTE_PLUGIN_TCP_PORTS} ]]; then
+		for tcpport in ${REMOTE_PLUGIN_TCP_PORTS}; do
+			add_plugin_param "--port=tcp:${tcpport}"
+		done
+	fi
+
+	if [[ -n ${REMOTE_PLUGIN_TTY_ONLY_INPUT} ]]; then
+		for tty in ${REMOTE_PLUGIN_TTY_ONLY_INPUT}; do
+			[[ -e ${tty} ]] || continue
+			chown vdr:vdr ${tty}
+			add_plugin_param "--tty=${tty}"
+		done
+	fi
+
+	if [[ -n ${REMOTE_PLUGIN_TTY_WITH_OSD} ]]; then
+		for tty in ${REMOTE_PLUGIN_TTY_WITH_OSD}; do
+			[[ -e ${tty} ]] || continue
+			chown vdr:vdr ${tty}
+			add_plugin_param "--TTY=${tty}"
+		done
+	fi
+}
+
+# for compatibility
+if [[ ${SCRIPT_API:-1} -lt 2 ]]; then
+	plugin_pre_vdr_start
+fi
-- 
cgit v1.2.3-65-gdbad