summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Reimer2015-06-08 11:10:31 +0200
committerChristopher Reimer2015-06-08 11:10:31 +0200
commitf196911797c77794bd5037ec5f533b297e2e14f1 (patch)
tree8fdb7a11f712fba42f0d93777dd61487d06bb806
downloadaur-f196911797c77794bd5037ec5f533b297e2e14f1.tar.gz
Sync from VDR4Arch (https://github.com/VDR4Arch/vdr4arch/commit/3bf8a4492e3b973a559fd2c53855b231e25c7e74)
-rw-r--r--.SRCINFO72
-rw-r--r--00-vdr.conf106
-rw-r--r--50-dvbsddevice.conf3
-rw-r--r--50-hello.conf6
-rw-r--r--50-pictures.conf3
-rw-r--r--50-rcu.conf3
-rw-r--r--60-create-dvb-device-units.rules1
-rw-r--r--PKGBUILD110
-rw-r--r--gen-sddropin19
-rw-r--r--shutdown-wrapper.c27
-rwxr-xr-xshutdown.sh25
-rw-r--r--vdr.install42
-rw-r--r--vdr.service14
-rw-r--r--vdr.sysuser8
14 files changed, 439 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..0ec96348ab54
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,72 @@
+pkgbase = vdr
+ pkgdesc = 'open' digital satellite receiver and timer controlled video disk recorder
+ pkgver = 2.2.0
+ pkgrel = 1
+ url = http://tvdr.de/
+ install = vdr.install
+ arch = x86_64
+ arch = i686
+ arch = arm
+ arch = armv6h
+ arch = armv7h
+ license = GPL2
+ makedepends = systemd
+ depends = libcap
+ depends = libjpeg-turbo
+ depends = libsystemd
+ depends = perl
+ depends = ttf-font
+ optdepends = lirc-utils: remote control support
+ optdepends = ncurses: skincurses plugin
+ optdepends = xlogin: To start X11
+ provides = vdr-api=2.2.0
+ conflicts = runvdr-extreme
+ replaces = runvdr-extreme
+ backup = etc/vdr/conf.avail/50-dvbsddevice.conf
+ backup = etc/vdr/conf.avail/50-dvbhddevice.conf
+ backup = etc/vdr/conf.avail/50-epgtableid0.conf
+ backup = etc/vdr/conf.avail/50-hello.conf
+ backup = etc/vdr/conf.avail/50-osddemo.conf
+ backup = etc/vdr/conf.avail/50-pictures.conf
+ backup = etc/vdr/conf.avail/50-rcu.conf
+ backup = etc/vdr/conf.avail/50-skincurses.conf
+ backup = etc/vdr/conf.avail/50-status.conf
+ backup = etc/vdr/conf.avail/50-svdrpdemo.conf
+ backup = etc/vdr/conf.avail/50-svccli.conf
+ backup = etc/vdr/conf.avail/50-svcsvr.conf
+ backup = etc/vdr/conf.d/00-vdr.conf
+ backup = var/lib/vdr/channels.conf
+ backup = var/lib/vdr/diseqc.conf
+ backup = var/lib/vdr/keymacros.conf
+ backup = var/lib/vdr/scr.conf
+ backup = var/lib/vdr/sources.conf
+ backup = var/lib/vdr/svdrphosts.conf
+ source = ftp://ftp.tvdr.de/vdr/vdr-2.2.0.tar.bz2
+ source = MainMenuHooks-v1_0_2.diff::http://www.vdr-portal.de/index.php?page=Attachment&attachmentID=30330
+ source = 00-vdr.conf
+ source = 50-dvbsddevice.conf
+ source = 50-hello.conf
+ source = 50-pictures.conf
+ source = 50-rcu.conf
+ source = 60-create-dvb-device-units.rules
+ source = gen-sddropin
+ source = shutdown.sh
+ source = shutdown-wrapper.c
+ source = vdr.service
+ source = vdr.sysuser
+ md5sums = 8853f64c0fc3d41ffd3b4bfc6f0a14b7
+ md5sums = 301c9b9766ed5182b07f1debc79abc21
+ md5sums = de3dcdea1a4282211c6dac370019548b
+ md5sums = 9cb821ebb6a25e603f9c32bafabde362
+ md5sums = fc450f75037b8712673db4969a1dd758
+ md5sums = f00583e3f5507b0ff935b4d5919e7df2
+ md5sums = 1d637e4f97adc66ef84615897116f29a
+ md5sums = 23d6e1ca0a36cfdbd35d3b1a61f0a105
+ md5sums = 3565ca5ad9be5c75f66478f0796b120d
+ md5sums = dd20f932b846b5f50ac455b65e9432ad
+ md5sums = 7cad811b4ac5ee6c0b5496d006f1e0ee
+ md5sums = 1b81ba1063c3da92efd94b6251cdf65a
+ md5sums = 59ce04d1d01bf92bf6cfc0b74223191c
+
+pkgname = vdr
+
diff --git a/00-vdr.conf b/00-vdr.conf
new file mode 100644
index 000000000000..80a25245f0a8
--- /dev/null
+++ b/00-vdr.conf
@@ -0,0 +1,106 @@
+[vdr]
+#--audio=cmd
+# Send Dolby Digital audio to stdin of command cmd.
+
+#--cachedir=dir
+# Save cache files in dir (default is /var/cache/vdr).
+
+--chartab=ISO-8859-15
+# set the character table to use for strings in the
+# DVB data stream that don't begin with a character
+# table indicator, but don't use the standard default
+# character table (for instance ISO-8859-9)
+
+#--config=dir
+# Read config files from directory dir (default is /var/lib/vdr).
+
+#--daemon
+# Run in daemon mode (implies --no-kbd).
+
+#--device=num
+# Use only the given DVB device (num = 0, 1, 2...). There may be several -D options (by default all
+# DVB devices will be used).
+
+#--dirnames=path[,name[,enc]]
+# Set the maximum directory path length to path (default is the maximum value allowed on the sys‐
+# tem). If name is also given, it defines the maximum directory name length (default is the maximum
+# value allowed on the system). The optional enc can be 0 or 1, and controls whether special char‐
+# acters in directory names are encoded as hex values (default: 0). If path or name are left empty
+# (as in ",,1" to only set enc), the defaults apply. The length of the video directory name and
+# that of the actual recording directory is subtracted from path, to make sure the directory path
+# will never become too long.
+
+#--epgfile=file
+# Write the EPG data into the given file (default is epg.data in the cache directory). Use -E- to
+# disable this. If file is a directory, the file epg.data will be created in that directory.
+
+#--filesize=size
+# Limit video files to size bytes (default is 2000M). This option is only useful in conjunction
+# with --edit, and must precede that option to have an effect. size is an integer number and may be
+# followed by one of the letters K, M, G or T to abbreviate Kilo-, Mega-, Giga- or Terabyte, respec‐
+# tively. The given value is silently limited to the program's internal minimum and maximum values.
+
+--grab=/tmp
+# Write images from the SVDRP command GRAB into the given directory dir. dir must be the full path
+# name of an existing directory, without any "..", double '/' or symlinks. By default, or if -g- is
+# given, grabbing images to disk is disabled.
+
+#--instance=instance
+# Use instance as the id of this VDR instance (default is 0). In an environment where several
+# instances of VDR use the same video directory, this parameter can be set to a positive integer
+# value that's unique for each instance, so that they won't interfere with each other in case they
+# record exactly the same broadcast. The number given here will be part of the directory name in
+# which the recordings will be stored.
+
+--log=2
+# Set logging to level. 0 = no logging, 1 = errors only, 2 = errors and info, 3 = errors, info and
+# debug. The default logging level is 3. If logging should be done to LOG_LOCALn instead of
+# LOG_USER, add '.n' to LEVEL, as in 3.7 (n=0..7).
+
+#--lib=dir
+# Search for plugins in directory dir (default is /usr/lib/vdr/plugins). There can be several -L options
+# with different dir values. Each of them will apply to the -P options following it.
+
+#--lirc[=path]
+# Use a LIRC remote control device. If path is omitted, vdr uses /var/run/lirc/lircd.
+
+#--localedir=dir
+# Search for locale files in dir (default is /usr/share/locale).
+
+#--mute
+# Mute audio of the primary DVB device at startup.
+
+#--no-kbd
+# Don't use the keyboard as an input device.
+
+#--port=port
+# Use port for SVDRP. A value of 0 turns off SVDRP. The default SVDRP port is 6419. You need to
+# edit the file svdrphosts.conf in order to enable access to the SVDRP port.
+#
+
+#--record=cmd
+# Call cmd before and after a recording. See the file INSTALL for more information.
+
+#--resdir=dir
+# Read resource files from dir (default is /usr/share/vdr).
+
+--shutdown=/usr/lib/vdr/bin/shutdown-wrapper
+# Call cmd to shutdown the computer. See the file INSTALL for more information.
+
+#--terminal=tty
+# Set the controlling terminal.
+
+#--user=user
+# Run as user user in case vdr was started as user 'root'. Starting vdr as 'root' is necessary if
+# the system time shall be set from the transponder data, but for security reasons vdr can switch to
+# a lesser privileged user id during normal operation. The default is 'vdr'
+
+#--userdump
+# Allow coredumps if -u is given (only for debugging).
+
+#--video=dir
+# Use dir as video directory. The default is /srv/vdr/video.
+
+--watchdog=90
+# Activate the watchdog timer with a timeout of sec seconds. A value of 0 (default) disables the
+# watchdog.
diff --git a/50-dvbsddevice.conf b/50-dvbsddevice.conf
new file mode 100644
index 000000000000..77d8122eec3c
--- /dev/null
+++ b/50-dvbsddevice.conf
@@ -0,0 +1,3 @@
+[dvbsddevice]
+#--outputonly
+# do not receive, just use as output device
diff --git a/50-hello.conf b/50-hello.conf
new file mode 100644
index 000000000000..e9bd493c751d
--- /dev/null
+++ b/50-hello.conf
@@ -0,0 +1,6 @@
+[hello]
+#--aaa=ABC
+# do something nice with ABC
+
+#--bbb
+# activate 'plan B' \ No newline at end of file
diff --git a/50-pictures.conf b/50-pictures.conf
new file mode 100644
index 000000000000..33b4e14f76b8
--- /dev/null
+++ b/50-pictures.conf
@@ -0,0 +1,3 @@
+[pictures]
+#--dir=DIR
+# set the picture directory to DIR
diff --git a/50-rcu.conf b/50-rcu.conf
new file mode 100644
index 000000000000..ec3f2395e3d1
--- /dev/null
+++ b/50-rcu.conf
@@ -0,0 +1,3 @@
+[rcu]
+#--device=DEV
+# set the device to use (default is /dev/ttyS1) \ No newline at end of file
diff --git a/60-create-dvb-device-units.rules b/60-create-dvb-device-units.rules
new file mode 100644
index 000000000000..29101f634ff0
--- /dev/null
+++ b/60-create-dvb-device-units.rules
@@ -0,0 +1 @@
+SUBSYSTEM=="dvb", TAG+="systemd"
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..2ce1e97f8af2
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,110 @@
+# This PKGBUILD is part of the VDR4Arch project [https://github.com/vdr4arch]
+
+# Maintainer: Christopher Reimer <mail+vdr4arch[at]c-reimer[dot]de>
+pkgname=vdr
+pkgver=2.2.0
+pkgrel=1
+pkgdesc="'open' digital satellite receiver and timer controlled video disk recorder"
+url="http://tvdr.de/"
+arch=('x86_64' 'i686' 'arm' 'armv6h' 'armv7h')
+license=('GPL2')
+depends=('libcap' 'libjpeg-turbo' 'libsystemd' 'perl' 'ttf-font')
+makedepends=('systemd') #libsystemd should be enough but the pkg-config file is missing in the libsystemd package
+optdepends=('lirc-utils: remote control support'
+ 'ncurses: skincurses plugin'
+ 'xlogin: To start X11')
+replaces=('runvdr-extreme')
+conflicts=('runvdr-extreme')
+provides=("vdr-api=2.2.0")
+install='vdr.install'
+source=("ftp://ftp.tvdr.de/vdr/${pkgname}-${pkgver}.tar.bz2"
+ 'MainMenuHooks-v1_0_2.diff::http://www.vdr-portal.de/index.php?page=Attachment&attachmentID=30330'
+ '00-vdr.conf' '50-dvbsddevice.conf' '50-hello.conf' '50-pictures.conf' '50-rcu.conf'
+ '60-create-dvb-device-units.rules'
+ 'gen-sddropin'
+ 'shutdown.sh'
+ 'shutdown-wrapper.c'
+ 'vdr.service'
+ 'vdr.sysuser')
+backup=("etc/vdr/conf.avail/"50-dvb{s,h}ddevice.conf
+ "etc/vdr/conf.avail/"50-{epgtableid0,hello,osddemo,pictures,rcu,skincurses,status,svdrpdemo}.conf
+ "etc/vdr/conf.avail/"50-svc{cli,svr}.conf
+ 'etc/vdr/conf.d/00-vdr.conf'
+ 'var/lib/vdr/channels.conf'
+ 'var/lib/vdr/diseqc.conf'
+ 'var/lib/vdr/keymacros.conf'
+ 'var/lib/vdr/scr.conf'
+ 'var/lib/vdr/sources.conf'
+ 'var/lib/vdr/svdrphosts.conf')
+md5sums=('8853f64c0fc3d41ffd3b4bfc6f0a14b7'
+ '301c9b9766ed5182b07f1debc79abc21'
+ 'de3dcdea1a4282211c6dac370019548b'
+ '9cb821ebb6a25e603f9c32bafabde362'
+ 'fc450f75037b8712673db4969a1dd758'
+ 'f00583e3f5507b0ff935b4d5919e7df2'
+ '1d637e4f97adc66ef84615897116f29a'
+ '23d6e1ca0a36cfdbd35d3b1a61f0a105'
+ '3565ca5ad9be5c75f66478f0796b120d'
+ 'dd20f932b846b5f50ac455b65e9432ad'
+ '7cad811b4ac5ee6c0b5496d006f1e0ee'
+ '1b81ba1063c3da92efd94b6251cdf65a'
+ '59ce04d1d01bf92bf6cfc0b74223191c')
+
+prepare() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ echo 'CFLAGS += -O3' > Make.config
+ echo 'CXXFLAGS += -O3' >> Make.config
+ echo 'PREFIX = /usr' >> Make.config
+ echo 'LIBDIR = /usr/lib/vdr/plugins' >> Make.config
+ echo 'VDR_USER = vdr' >> Make.config
+ echo 'SDNOTIFY = 1' >> Make.config
+ echo 'LIRC_DEVICE = /run/lirc/lircd' >> Make.config
+
+ sed -i 's/NULL, 0, true/NULL, 0, OpenSubMenus/g' "$srcdir/MainMenuHooks-v1_0_2.diff"
+ patch -p1 -i "$srcdir/MainMenuHooks-v1_0_2.diff"
+
+ sed -i '/define DEPRECATED_VIDEOSYSTEM/d' device.h
+ sed -i '/define DEPRECATED_VDR_CHARSET_OVERRIDE/d' vdr.c
+}
+
+build() {
+ gcc -o shutdown-wrapper shutdown-wrapper.c
+
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make
+}
+
+package() {
+ for i in dvbsddevice hello pictures rcu; do
+ install -Dm644 50-$i.conf "$pkgdir/etc/vdr/conf.avail/50-$i.conf"
+ done
+
+ install -Dm644 00-vdr.conf "$pkgdir/etc/vdr/conf.d/00-vdr.conf"
+ install -Dm644 60-create-dvb-device-units.rules "$pkgdir/usr/lib/udev/rules.d/60-create-dvb-device-units.rules"
+ install -Dm644 vdr.service "$pkgdir/usr/lib/systemd/system/vdr.service"
+
+ install -Dm754 shutdown-wrapper "$pkgdir/usr/lib/vdr/bin/shutdown-wrapper"
+ chgrp 666 "$pkgdir/usr/lib/vdr/bin/shutdown-wrapper"
+ chmod u+s "$pkgdir/usr/lib/vdr/bin/shutdown-wrapper"
+
+ install -Dm755 gen-sddropin "$pkgdir/usr/bin/vdr-gensddropin"
+ install -Dm755 shutdown.sh "$pkgdir/usr/lib/vdr/bin/shutdown.sh"
+
+ #Install sysuser config
+ install -Dm644 ${srcdir}/$pkgname.sysuser "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
+
+ for i in dvbhddevice epgtableid0 osddemo skincurses status svc{cli,svr} svdrpdemo; do
+ echo "[$i]" > "$pkgdir/etc/vdr/conf.avail/50-$i.conf"
+ done
+
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ mkdir -p "$pkgdir/var/lib/vdr"
+ make DESTDIR="${pkgdir}" install
+
+ mkdir -p "$pkgdir/usr/share/vdr/shutdown-hooks"
+
+ chown -R 666:666 "$pkgdir/srv/vdr"
+ chown -R 666:666 "$pkgdir/var/cache/vdr"
+ chown -R 666:666 "$pkgdir/var/lib/vdr"
+}
diff --git a/gen-sddropin b/gen-sddropin
new file mode 100644
index 000000000000..b3ee8c8de8b1
--- /dev/null
+++ b/gen-sddropin
@@ -0,0 +1,19 @@
+#!/usr/bin/bash
+FILE=/etc/systemd/system/vdr.service.d/wait-for-devices.conf
+
+if [ -d /dev/dvb/adapter0 ]; then
+ mkdir -p $(dirname $FILE)
+ echo "Replace or create the file $FILE"
+ echo "with the following"
+ echo
+ echo '[Unit]'
+
+ cd /dev
+ for dev in dvb/adapter*/*; do
+ stringpart=$(tr / - <<< $dev)
+ echo "Wants=dev-$stringpart.device"
+ echo "After=dev-$stringpart.device"
+ done
+else
+ echo "No DVB devices detected. No systemd rule needed"
+fi \ No newline at end of file
diff --git a/shutdown-wrapper.c b/shutdown-wrapper.c
new file mode 100644
index 000000000000..6708fa2f418c
--- /dev/null
+++ b/shutdown-wrapper.c
@@ -0,0 +1,27 @@
+//
+// Simple shutdown-wrapper with focus on security
+//
+// Version: 1.0 Thu Jul 9 16:28:42 CEST 2009
+//
+// Author: Manuel Reimer <manuel.reimer@gmx.de>
+//
+
+#define REAL_PATH "/usr/lib/vdr/bin/shutdown.sh"
+
+#include <unistd.h>
+
+int main(int argc, char *argv[]){
+ // We pass a secure environment to the called script.
+ char *const envParms[4] = {
+ "PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin",
+ "HOME=/root",
+ "TERM=linux",
+ NULL
+ };
+ // Drop whatever working directory the caller set for us and go HOME
+ chdir("/root");
+ // Get root and execute shutdown.sh
+ setuid(0);
+ execve(REAL_PATH, argv, envParms);
+ return 0;
+}
diff --git a/shutdown.sh b/shutdown.sh
new file mode 100755
index 000000000000..08c2aaa6499b
--- /dev/null
+++ b/shutdown.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+#Run through shutdown-hooks
+for file in /usr/lib/vdr/shutdown-hooks/*; do
+ if [ -x $file ]; then
+ MESSAGE=$($file)
+ if [ $? != '0' ]; then
+ MESSAGE=$(echo "$MESSAGE" | sed -rn '0,/ABORT_MESSAGE/s/^ABORT_MESSAGE="?([^"]+).*/\1/p')
+ svdrpsend MESG "$MESSAGE"
+ exit 1
+ fi
+ fi
+done
+
+#Sync back system time to hardware time (Maybe VDR has changed it)
+hwclock --systohc --utc
+
+#Unset previous timer
+echo '0' > /sys/class/rtc/rtc0/wakealarm
+
+#Set new timer 5mins before recording starts
+echo $(($1 - 300 )) > /sys/class/rtc/rtc0/wakealarm
+
+#Initiate shutdown
+systemctl poweroff
diff --git a/vdr.install b/vdr.install
new file mode 100644
index 000000000000..553539b766a1
--- /dev/null
+++ b/vdr.install
@@ -0,0 +1,42 @@
+_common() {
+ if diff /etc/skel/.xinitrc /home/vdr/.xinitrc > /dev/null 2>&1 ||
+ [ ! -e /home/vdr/.xinitrc ]; then
+
+ cat <<'EOF' > /home/vdr/.xinitrc
+#!/bin/sh
+#
+# ~/.xinitrc
+#
+# Executed by startx (run your window manager from here)
+
+if [ -d /etc/X11/xinit/xinitrc.d ]; then
+ for f in /etc/X11/xinit/xinitrc.d/*; do
+ [ -x "$f" ] && . "$f"
+ done
+ unset f
+fi
+
+# exec gnome-session
+# exec startkde
+# exec startxfce4
+# ...or the Window Manager of your choice
+kill -STOP "$$" # Comment this when using a window manager
+EOF
+ fi
+}
+
+post_install() {
+ #Add vdr user
+ systemd-sysusers
+
+ # systemd-sysusers doesn't create our homedirectory...
+ mkdir -m 0711 -p /home/vdr
+ chown vdr:vdr /home/vdr
+
+ _common
+}
+
+post_upgrade() {
+ echo "Remember!! VDR has to run after all DVB devices are initialized"
+ echo "To generate a template rule for systemd run 'vdr-gensddropin"
+} \ No newline at end of file
diff --git a/vdr.service b/vdr.service
new file mode 100644
index 000000000000..dc46fee63905
--- /dev/null
+++ b/vdr.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Video Disk Recorder
+After=oscam.service
+After=sundtek.service
+After=xlogin@vdr.service
+
+[Service]
+Type=notify
+ExecStart=/usr/bin/vdr
+Restart=on-failure
+RestartPreventExitStatus=2
+
+[Install]
+WantedBy=multi-user.target
diff --git a/vdr.sysuser b/vdr.sysuser
new file mode 100644
index 000000000000..3aedb7ef4553
--- /dev/null
+++ b/vdr.sysuser
@@ -0,0 +1,8 @@
+u vdr 666 vdr /home/vdr
+m vdr audio
+m vdr lp
+m vdr optical
+m vdr storage
+m vdr video
+m vdr power
+m vdr uucp