summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Väth <martin@mvath.de>2015-10-11 11:26:48 +0200
committerMartin Väth <martin@mvath.de>2015-10-11 11:32:18 +0200
commit109d6b4f673a249aea4deeb0cdb5b54a21592410 (patch)
treeec3589a50dac5be54ef6248d1e0ff3a9fd3b41b4 /media-tv/sundtek-tv
downloadmv-109d6b4f673a249aea4deeb0cdb5b54a21592410.tar.gz
mv-109d6b4f673a249aea4deeb0cdb5b54a21592410.tar.bz2
mv-109d6b4f673a249aea4deeb0cdb5b54a21592410.zip
Clear history for egencache --repo=mv --update-changelogs
Diffstat (limited to 'media-tv/sundtek-tv')
-rw-r--r--media-tv/sundtek-tv/Manifest1
-rw-r--r--media-tv/sundtek-tv/files/_mediaclient202
-rw-r--r--media-tv/sundtek-tv/files/mediaclient.video31
-rw-r--r--media-tv/sundtek-tv/files/sundtek-local.service11
-rw-r--r--media-tv/sundtek-tv/files/sundtek.initd17
-rw-r--r--media-tv/sundtek-tv/metadata.xml21
-rw-r--r--media-tv/sundtek-tv/sundtek-tv-151002.142741.ebuild188
7 files changed, 471 insertions, 0 deletions
diff --git a/media-tv/sundtek-tv/Manifest b/media-tv/sundtek-tv/Manifest
new file mode 100644
index 00000000..7ef6c46e
--- /dev/null
+++ b/media-tv/sundtek-tv/Manifest
@@ -0,0 +1 @@
+DIST sundtek_installer_151002.142741.sh 28592676 SHA256 16441a0c5e0ab02a5b66c992370f49f13a2cb24d591ffa3834c53204bf1ec507 SHA512 044786e76d48123cfc0c111bb17513cef5d68003052b588d02650323d5a2a9f782332080a4399391969356021eb102ac26372cdfbd44e475c447ebb273acaf51 WHIRLPOOL e00eece7d100e88b08855960a6d27e74fc72dd38f2a82df1bfefa61c1e84789a9611666b4e9bd646662522a53bd137cf3bdc0eb5dd91e4dd3082cc3624f2e243
diff --git a/media-tv/sundtek-tv/files/_mediaclient b/media-tv/sundtek-tv/files/_mediaclient
new file mode 100644
index 00000000..3d0ed826
--- /dev/null
+++ b/media-tv/sundtek-tv/files/_mediaclient
@@ -0,0 +1,202 @@
+#compdef mediaclient mediaclient.video mediaclient.radio mediaclient.dvb
+local curcontext="$curcontext" state state_descr line
+typeset -A opt_args
+local service_opts
+service_opts=(
+'--help[help]'
+{'(--enumdevices)-e','(-e)--enumdevices'}'[show up devices]'
+{'(--mode)-m+','(-m)--mode='}'[MODE (device mode)]:device mode:(DVBT DVBT2 DVBC DVBS DVBS2 ATSC ATV RADIO)'
+{'(--tuner)-t+','(-t)--tuner'}'[ID (tuner id)]:tuner id:->tunerid'
+{'(--setdtvmode)-D+','(-D)--setdtvmode='}'[MODE (dtv mode)]:dtv mode:(DVBT DVBC ATSC)'
+{'(--listatvstd)-L','(-L)--listatvstd'}'[list analog TV standards]'
+'--crc=[MODE (crc check for PSI on/off)]:check active:(on off)'
+{'(--vmode)-v+','(-v)--vmode='}'[MODE (set analog TV mode)]:tv mode:(PAL-BG PAL-DK PAL-I PAL-M NTSC-M Secam-L Secam-LC Secam-K Secam-B Secam-G Secam-H)'
+'--setvcr=[DEVICE (lock device)]:video device:(/dev/video*)'
+{'(--inputs)-i','(-i)--inputs'}'[list analog TV inputs]'
+{'(--size)-s+','(-s)--size='}'[DIM (set scalar size)]:dimension:(720x576)'
+{'(--Input)-I+','(-I)--Input='}'[INPUT (set TV input)]:input:(Television Composite S-Video)'
+{'(--frequency)-f+','(-f)--frequency='}'[HZ (frequency)]:frequency:()'
+'--rawfreq[HZ (raw DVB-S/S2 frequency)]:frequency:()'
+{'(--listarea)-a','(-a)--listarea'}'[list Area]'
+{'(--setarea)-A+','(-A)--setarea='}'[AREA (set Area)]:Area:()'
+{'(--Modulation)-M+','(-M)--Modulation='}'[MODULATION (for DVB-C)]:Modulation:(Q16 Q32 Q64 Q128 Q256)'
+{'(--Symbolrate)-S+','(-S)--Symbolrate='}'[HZ (Symbolrate for DVB-C)]:Symbolrate:()'
+{'(--voltage)-V+','(-V)--voltage='}'[VOLTAGE (DVB-S/S2 Polarisation)]:voltage:->voltage'
+'--band=[BAND (set band)]:band:(C-BAND UNIVERSAL)'
+{'(--fec)-E','(-E)--fec'}'[forward error connection]'
+{'(--polarisation)-p+','(-p)--polarisation='}'[DIRECTION (polarisation)]:polarisation:->polarisation'
+{'(--bandwidth)-b+','(-b)--bandwidth='}'[MHZ (set bandwidth for DVB-T)]:bandwidth:(6 7 8)'
+{'(--rds)-r','(-r)--rds'}'[get RDS information]'
+{'(--properties)-C','(-C)--properties'}'[list device properties]'
+'--loglevel=[LOGLEVEL (set log verbosity)]:loglevel:(off min max)'
+'--signalreporting=[MODE (set signal mode)]:signal reporting:->signalreporting'
+'--readsignal=[N (read signalstrength N times)]:signalstrength:()'
+'--powerlevel=[N (read powerlevel N times)]:powerlevel:()'
+'--powerlevel=[N (read powerlevel N times)]:powerlevel:()'
+'--lockstatus[check dvb/atsc channel lock]'
+'--enable5v=[5V output for DVB-C/T/T2]:enable 5V output:(on off)'
+'--wssdecoder=[DEVICE (VBI for wss)]:VBI device:(dev/vbi*)'
+'--dumpvbi=[DEVICE (dump VBI for wss)]:VBI device:(dev/vbi*)'
+'--wsscallback=[SCRIPT (Aspect ratio change wss)]:aspect ratio script:_files'
+'--stopwdd[stop background wss server]'
+'--cc-list[list closed caption]'
+'--cc-flush[clear closed caption settings]'
+'--cc-enable[CAP (enable closed caption)]:closed caption:(CC1 CC2 T1 T2)'
+'--cc-disable[CAP (disable closed caption)]:closed caption:(CC1 CC2 T1 T2)'
+{'(--pidfilter)-P+','(-P)--pidfilter='}'[MODE (DVB pidfilter on/off)]:pidfilter:(on off)'
+{'(--addpid)-H+','(-H)--addpid='}'[PIDS (add DVB pids)]:pids:("0x10" 16 "0x10,16")'
+{'(--removepid)-x+','(-x)--removepid='}'[PIDS (remove DVB pids)]:pids:("0x10" 16 "0x10,16")'
+{'(--listpids)-w','(-w)--listpids'}'[list filtered DVB pids]'
+{'(--flushpids)-F+','(-F)--flushpids='}'[flush DVB pidtable]'
+'--softpidfilter=[MODE (software DVB PID filter)]:pidfilter mode:(on off passthrough)'
+{'(--internalaudio)-c+','(-c)--internalaudio='}'[MODE (internal audio)]:internal audio:->internalaudio'
+'--audiothreshold=[N (audio threshold N ms)]:audio threshold:(0 2000)'
+'--loudness=[N (loudness)]:loudness:(0 15)'
+'--volume=[N (volume)]:volume:(0 255)'
+'--treble=[N (treble)]:treble:(0 255)'
+'--audiomode=[MODE (mono/stereo)]:audio mode:(mono stereo)'
+{'(--mute)-g+','(-g)--mute='}'[MODE (FM mute)]:FM mute mode:(on off)'
+'--diseqc-support=[MODE (diseqc)]:diseqc mode:(on off)'
+'--diseqc=[COMMAND (diseqc)]:diseqc command:(E0 10 38 F0)'
+'--list-diseqc[list diseqc dish configuration]'
+'--set-diseqc=[CONFIG (set diseqc dish)]:diseqc dish configuration:(S19.2E)'
+'--setmini=[SEC_MINI_A/B (set burst tone)]:burst tone:(A B)'
+{'(--listrc)-l','(-l)--listrc'}'[list rc protocols]'
+{'(--setrc)-s+','(-s)--setrc='}'[PROTOCOL (set rc)]:protocol:()'
+'--enablerc=[DEVICE (enable rc polling)]:rc device:(/dev/mediainput*)'
+'--disablerc=[DEVICE (disable rc polling)]:rc device:(/dev/mediainput*)'
+'--pollrc[poll raw rc]'
+'--dumprcmap[dump rc map]'
+'--setrcmap=[MAP (set rc MAP)]:rc map:_files'
+'--updaterc=[update rc layout]:rc layout:->rclayout'
+'--transfermode=[MODE (usb transfer mode)]:transfer mode:(bulk iso)'
+'--nullpackets=[MODE (usb null packets)]:pass null packets:->nullpackets'
+'--bulkpackets=[N (usb bulk transfer)]:bulk transfer number:()'
+'--ts-settle-timemout=[N (usb timeout in ms)]:timeout:(0 4000)'
+'--disable-dvb=[ADAPTER (disable dvb)]:dvb adapter:(/dev/dvb/adapter*)'
+'--enable-dvb=[ADAPTER (enable dvb)]:dvb adapter:(/dev/dvb/adapter*)'
+'--setver=[API (set DVB API)]:DVB API:(5.0)'
+'--vfilter=[MODE (analog deinterlacer)]:deinterlacer:(on off)'
+'--vfilterid=[ID (analog deinterlacer type)]:deinterlacer id:->deinterlacerid'
+'--lc[list connected clients]'
+'--lc=[PID (disconnect client)]:pid:()'
+'--shutdown[shutdown multimediastack]'
+'--start=[N (start multimediastack in N sec)]:seconds:(1)'
+'--systemdcheck[start via systemd]'
+'--wait-for-devices[start when devices are ready]'
+'--enablenetwork=[MODE (network listening)]:network mode:(on off)'
+'--mount=[ADAPTER (create virtual)]:virtual adapter:->createmount'
+'--unmount=[ADAPTER (delete virtual)]:virtual adapter:(1)'
+'--lrc=[RC (list remote clients)]:rc clients:(1 192.168.1.2:0)'
+'--tvdummy[add tv-dummydevice]'
+'--remove=[N (delete dummy adapter)]:dummy adapter:(1)'
+'--scan-network[scan for IPTV devices]'
+'--nettransfermode=[MODE (set transfer mode)]:transfer mode:(tcp udp)'
+'--nti=[N (increase maximum packet)]:maximum packet:(0 10000)'
+'--netrecoverymode=[MODE (netrecoverymode)]:net recover mode:(on off)'
+'--enabledreambox=[DEVICE (connect vtuner)]:vtuner device:(/dev/dvb/adapter*/frontend*)'
+'--disabledreambox=[DEVICE (disconnect vtuner)]:vtuner device:(/dev/dvb/adapter*/frontend*)'
+'--nimbus[display dreambox nimbus]'
+'--avoffset=[N (dreambox AV offset in ms)]:AV PTS offset:()'
+'--audiooffset=[N (dreambox audio offset in ms)]:Audio PTS offset:()'
+'--videooffset=[N (dreambox video offset in ms)]:Video PTS offset:()'
+'--portforward=[N (debugging)]:port:()'
+'--pipecount=[N (read stdin)]:seconds:(1)'
+'--cat=[FILE (read FILE)]:file:_files'
+'--strings=[FILE (strings FILE)]:file:_files'
+'--lsusb=[DEVICE (print usb ids)]:usb device:(/dev/bus/usb)'
+'--reset=[DEVICE (reset usb device)]:usb device:(/dev/bus/usb/*)'
+'--tsscan=[DEVICE (scan channel)]:transponder:(/dev/dvb/adapter*/dvr*)'
+'--nitscan=[DEVICE (scan NIT)]:transponder:(/dev/dvb/adapter*/dvr*)'
+'--blindscan=[DEVICE (blindscan)]:transponder:(nim_socket /dev/dvb/adapter*/dvr*)'
+'--timeout=[N (nitscan timeout in ms)]:timeout:()'
+'--zf=[N (ZF/IF universal frequesncy)]:frequency:()'
+'--frontendinfo=[DEVICE (get DVB API)]:dvb device:(/dev/dvb/adapter*/frontend*)'
+'--createadapter[create dvb loopback]'
+#'--remove=[N (remove dvb loopback)]:loopback device:()'
+)
+case $service in
+(*mediaclient)
+ service_opts+=(
+{'(--device)-d+','(-d)--device='}'[DEVICE (video device)]:video device:(/dev/dvb/adapter*/frontend* /dev/radio* /dev/video*)'
+);
+esac
+_arguments -C -s -S -A '-*' : $service_opts
+local ret=$?
+case $state in
+(tunerid)
+ local tunerids
+ tunerids=(
+ '0:FM receiver'
+ '1:FM transmitter'
+ )
+ _describe -t tunerid 'tuner id' tunerids
+ ret=$?;;
+(voltage)
+ local voltages
+ voltages=(
+ 'H:18V'
+ 'V:13V'
+ 'OFF:0V'
+ )
+ _describe -t voltage 'voltage' voltages
+ ret=$?;;
+(polarisation)
+ local polarisations
+ polarisations=(
+ 'H:horizontal'
+ 'V:vertical'
+ )
+ _describe -t polarisation 'polarisation' polarisations
+ ret=$?;;
+(signalreporting)
+ local signalreport
+ signalreport=(
+ '0:videodecoder (fast, default)'
+ '1:demodulator (slow, detailed)'
+ )
+ _describe -t signalreporting 'signal reporting' signalreport
+ ret=$?;;
+(internalaudio)
+ local internalaudios
+ internalaudios=(
+ 'auto:on if tvtime gets started'
+ 'internal:use internal bridge'
+ 'external:require external application'
+ 'audioonly:only initialize audio transfer'
+ )
+ _describe -t internalaudio 'internal audio' internalaudios
+ ret=$?;;
+(rclayout)
+ local rclayouts
+ rclayouts=(
+ '0:internal keymap for flat remote control'
+ '1:internal keymap for black VCR remote control'
+ )
+ _describe -t rclayout 'rc layout' rclayouts
+ ret=$?;;
+(nullpackets)
+ local nullpackets
+ nullpackets=(
+ 'on'
+ 'off:default'
+ )
+ _describe -t nullpackets 'pass null packets' nullpackets
+ ret=$?;;
+(deinterlacerid)
+ local deinterlacerids
+ deinterlacerids=(
+ '0:default'
+ )
+ _describe -t deinterlacerid 'deinterlacer id' deinterlacerids
+ ret=$?;;
+(createmount)
+ local virtualadapters
+ virtualadapters=(
+ '0:local device'
+ '192.168.1.2:0:remote device'
+ )
+ _describe -t virtualadapter 'virtual adapter' virtualadapters
+ ret=$?;;
+esac
+return ret
diff --git a/media-tv/sundtek-tv/files/mediaclient.video b/media-tv/sundtek-tv/files/mediaclient.video
new file mode 100644
index 00000000..2382c21a
--- /dev/null
+++ b/media-tv/sundtek-tv/files/mediaclient.video
@@ -0,0 +1,31 @@
+#!/bin/sh
+Echo() {
+ printf '%s\n' "${*}"
+}
+Die() {
+ Echo "${0##*/}: ${*}" >&2
+ exit 1
+}
+EchoExec() {
+ Echo "# ${*}"
+ exec "${@}"
+ Die "failed to exec ${1}"
+}
+mediaclient=`PATH="${PATH}${PATH:+:}/bin:/opt/bin" command -v mediaclient` \
+ && [ -n "${mediaclient}" ] || Die 'cannot find mediaclient executable'
+case ${0} in
+*video*)
+ regexp='video[0-9]*'
+ text='video';;
+*radio)
+ regexp='radio[0-9]*'
+ text='radio';;
+*)
+ regexp='dvb\/adapter[0-9]*\/frontend[0-9]*'
+ text='adapter';;
+esac
+regexp='\/dev\/'${regexp}
+sedx='/'${regexp}'/{s/^.*\('${regexp}'\).*$/\1/p;q}'
+device=`"${mediaclient}" -e | sed -n -e "${sedx}"`
+[ -n "${device}" ] || Die "${mediaclient} -e returned no ${text} device"
+EchoExec "${mediaclient}" -d "${device}" "${@}"
diff --git a/media-tv/sundtek-tv/files/sundtek-local.service b/media-tv/sundtek-tv/files/sundtek-local.service
new file mode 100644
index 00000000..c2e298fc
--- /dev/null
+++ b/media-tv/sundtek-tv/files/sundtek-local.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Sundtek MediaTV Local Settings
+After=sundtek.service
+Wants=sundtek.service
+
+[Service]
+Type=oneshot
+ExecStart=/bin/sleep 60 ; /usr/bin/mediaclient.video -c external
+
+[Install]
+WantedBy=multi-user.target
diff --git a/media-tv/sundtek-tv/files/sundtek.initd b/media-tv/sundtek-tv/files/sundtek.initd
new file mode 100644
index 00000000..315da43e
--- /dev/null
+++ b/media-tv/sundtek-tv/files/sundtek.initd
@@ -0,0 +1,17 @@
+#!/sbin/openrc-run
+
+description="sundtek TV mediaclient"
+#command=/opt/bin/mediasrv
+#command_args="-d --pluginpath /opt/bin"
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ /opt/bin/mediaclient --start=4
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ /opt/bin/mediaclient --shutdown
+ eend $?
+}
diff --git a/media-tv/sundtek-tv/metadata.xml b/media-tv/sundtek-tv/metadata.xml
new file mode 100644
index 00000000..3a906d81
--- /dev/null
+++ b/media-tv/sundtek-tv/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>martin@mvath.de</email>
+ <name>Martin Väth</name>
+ </maintainer>
+ <upstream>
+ <maintainer>
+ <email>martin@mvath.de</email>
+ <name>Martin Väth</name>
+ </maintainer>
+ <bugs-to>mailto:martin@mvath.de</bugs-to>
+ <remote-id type="github">vaeth/video-mv</remote-id>
+ </upstream>
+ <use>
+ <flag name="pax_kernel">Mark package which is necessary if you use a PAX kernel</flag>
+ <flag name="ld-preload-file">Install /etc/ld.so.preload</flag>
+ <flag name="ld-preload-env">Install LD_PRELOAD in /etc/env.d/50sundtek-tv</flag>
+ </use>
+</pkgmetadata>
diff --git a/media-tv/sundtek-tv/sundtek-tv-151002.142741.ebuild b/media-tv/sundtek-tv/sundtek-tv-151002.142741.ebuild
new file mode 100644
index 00000000..2025ee3f
--- /dev/null
+++ b/media-tv/sundtek-tv/sundtek-tv-151002.142741.ebuild
@@ -0,0 +1,188 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils linux-info pax-utils readme.gentoo systemd unpacker
+
+# The following variable is only for testing purposes. Leave it to "false"
+keep_original=false
+
+DESCRIPTION="Sundtek MediaTV Pro III Drivers"
+HOMEPAGE="http://support.sundtek.com/index.php/topic,2.0.html"
+# Current version number can be found in http://sundtek.de/media/latest.phtml
+SRC_URI="http://www.sundtek.de/media/sundtek_installer_${PV}.sh"
+
+RESTRICT="mirror strip"
+LICENSE="sundtek"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="ld-preload-env +ld-preload-file pax_kernel"
+RDEPEND="!<sys-apps/openrc-0.13"
+DEPEND="pax_kernel? ( || ( sys-apps/elfix sys-apps/paxctl ) )"
+
+DISABLE_AUTOFORMATTING="true"
+DOC_CONTENTS="To initialize sundtek drivers during booting call
+ rc-update add sundtek default # for openrc
+ systemctl enable sundtek-local.service # for systemd
+You will probably need to adapt sundtek-local.service to your defaults
+"
+
+QA_PREBUILT="opt/bin/* opt/bin/*/* usr/$(get_libdir)/* usr/share/doc/*/*/*"
+
+src_unpack() {
+ local subdir a
+ a="${S}/archives"
+ mkdir -- "${S}" # "|| die" no necessary: test happens in cd
+ mkdir -- "${a}"
+ cd -- "${a}" || die "cannot cd to ${a}"
+ bash -- "${DISTDIR}/${A}" -e || die "extracting failed"
+ cd -- "${S}" || die
+ if use amd64
+ then subdir=64bit
+ elif use x86
+ then subdir=32bit
+ else die "This ebuild does not support the architecture.
+Download from Sundtek directly, write your own ebuild, or send me patches."
+ fi
+ unpacker "${a}/${subdir}/installer.tar.gz" || die
+ rm -rf -- "${a}" || die "cannot remove ${a}"
+ cp -- \
+ "${FILESDIR}"/sundtek.initd \
+ "${FILESDIR}"/sundtek-local.service \
+ "${FILESDIR}"/_mediaclient \
+ "${FILESDIR}"/mediaclient.video \
+ "${S}" || die
+}
+
+my_movlibdir() {
+ local i
+ for i in bin/*
+ do if test -d "${i}"
+ then mv "${i}" "${2}" || die
+ fi
+ done
+}
+
+src_prepare() {
+ local mybinprefix mylibdir myinclude myinclsundtek mysystemd \
+ myudev mypkgconfig mylirc myusr
+ if ${keep_original}
+ then mylibdir="opt/lib"
+ myinclude="opt/include"
+ myusr=
+ else mylibdir="usr/$(get_libdir)"
+ myinclude="usr/include"
+ myusr="usr"
+ fi
+ mybinprefix="opt"
+ mypkgconfig="usr/share/pkgconfig"
+ myinclsundtek="${myinclude}/sundtek"
+ myudev="lib/udev"
+ mylirc="etc/lirc"
+ umask 022
+ if use pax_kernel
+ then pax-mark em opt/bin/mediasrv
+ pax-mark e opt/bin/mediaclient
+ fi
+ mv opt 1 || die
+ mkdir -p ${myusr} "${mybinprefix}" lib "${mypkgconfig}" "${mylirc}" \
+ 1/lib/pm-utils || die
+ mv 1/bin "${mybinprefix}" || die
+ ${keep_original} || mv 1/lib/pm 1/lib/pm-utils/sleep.d || die
+ mv 1/lib "${mylibdir}" || die
+ mv 1/include "${myinclude}" || die
+ sed -e "s#/opt/lib#${EPREFIX}/${mylibdir}#" \
+ -e "s#/opt/include#${EPREFIX}/${myinclsundtek}#" \
+ -e "s#prefix=/opt#prefix=${EPREFIX}/${mybinprefix}#" \
+ 1/doc/libmedia.pc >"${mypkgconfig}/libmedia.pc" || die
+ sed -i -e "s#/opt#${EPREFIX}/${mybinprefix}#" \
+ etc/udev/rules.d/*.rules 1/doc/*.service sundtek.initd || die
+ sed -i -e "s/^\([^#]\)/#\1/" \
+ etc/udev/rules.d/80-mediasrv-eeti.rules || die
+ mv etc/udev/rules.d/80-mediasrv.rules etc/hal . || die
+ mv etc/udev "${myudev}" || die
+ mv 1/doc/hardware.conf 1/doc/sundtek.conf "${mylirc}" || die
+ rm 1/doc/lirc_install.sh 1/doc/libmedia.pc || die
+ mv 1/doc/*.service "${S}" || die
+ mkdir "${S}/doc" && mkdir "${S}/doc/bin" || die
+ mv 1/doc/README 1/doc/*.conf "${S}/doc" || die
+ mv 1/doc/*.cgi "${S}/doc/bin" || die
+ rmdir 1/doc || die "${S}/1/doc contains files not known to the ebuild"
+ rmdir 1 || die "${S}/1 contains files not known to the ebuild"
+ my_movlibdir "${mylibdir}"
+ mkdir etc/revdep-rebuild || die
+ echo "SEARCH_DIRS_MASK=\"${EPREFIX}/${mybinprefix}/bin/audio/libpulse.so\"" \
+ >etc/revdep-rebuild/50-sundtek-tv
+ if use ld-preload-file
+ then echo "/${mylibdir}/libmediaclient.so" >etc/ld.so.preload
+ fi
+ if use ld-preload-env
+ then mkdir etc/env.d
+ echo "LD_PRELOAD=\"/${mylibdir}/libmediaclient.so\"" >etc/env.d/50sundtek-tv
+ fi
+ DOC_CONTENTS="${DOC_CONTENTS}
+You have to put /${mylibdir}/libmediaclient.so into /etc/ld.so.preload
+or to export LD_PRELOAD=\"/${mylibdir}/libmediaclient.so\"
+before you start a multimedia applications like mplayer or mpv which should
+be able to access the sundtek device.
+
+This happens with USE=ld-preload-file or with ld-preload-env (in the global
+environment), respectively.
+
+However, such a global setting in some cases this gives warnings when
+32-bit applications are used.
+
+Thus, it might be a good idea to do it only locally by writing
+corresponding wrapper scripts for those multimedia applications you
+want to use with sundtek-tv.
+"
+ ln -sfn mediaclient.video mediaclient.audio
+ ln -sfn mediaclient.video mediaclient.dvb
+ epatch_user
+}
+
+src_install() {
+ insinto /
+ local i
+ for i in etc lib64 lib32 lib usr opt
+ do test -d "${i}" && mv -- "${i}" "${ED}"
+ done
+ for i in "${ED}"/usr/bin "${ED}"/usr/$(get_libdir) "${ED}"/opt
+ do test -d "${i}" && chmod -R 755 "${i}"
+ done
+ if ! ${keep_original}
+ then newinitd sundtek.initd sundtek
+ systemd_dounit *.service
+ dodoc doc/README doc/*.conf
+ mv -- doc/bin "${ED}/usr/share/doc/${PF}" || die
+ docompress -x "/usr/share/doc/${PF}/bin"
+ fi
+ dobin mediaclient.video
+ insinto /usr/bin
+ doins mediaclient.dvb mediaclient.audio
+ insinto /usr/share/zsh/site-functions
+ doins _mediaclient
+ readme.gentoo_create_doc
+}
+
+pkg_pretend() {
+ local CONFIG_CHECK="~INPUT_UINPUT"
+ check_extra_config
+}
+
+pkg_postinst() {
+ einfo "Adding root to the audio group"
+ usermod -aG audio root || {
+ ewarn "Could not add root to the audio group."
+ ewarn "You should do this manually if you have problems with sound"
+ }
+ false chmod 6111 "${EPREFIX}/opt/bin/mediasrv" || \
+ elog "You might need to chmod 6111 ${EPREFIX}/opt/bin/mediasrv"
+ if ! use ld-preload-file
+ then if use ld-preload-env
+ then elog "You might have to call env-update and source /etc/profile"
+ else elog "You need to set LD_PRELOAD locally, see /usr/share/doc/${PF}/README.gentoo*"
+ fi
+ fi
+}