summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--media-tv/sundtek-tv/files/sundtek.initd16
-rw-r--r--media-tv/sundtek-tv/sundtek-tv-151010.162411-r1.ebuild (renamed from media-tv/sundtek-tv/sundtek-tv-151010.162411.ebuild)2
2 files changed, 16 insertions, 2 deletions
diff --git a/media-tv/sundtek-tv/files/sundtek.initd b/media-tv/sundtek-tv/files/sundtek.initd
index 315da43e..fb374f43 100644
--- a/media-tv/sundtek-tv/files/sundtek.initd
+++ b/media-tv/sundtek-tv/files/sundtek.initd
@@ -4,14 +4,26 @@ description="sundtek TV mediaclient"
#command=/opt/bin/mediasrv
#command_args="-d --pluginpath /opt/bin"
+set_preload() {
+ yesno ${preload:-NO} || return 0
+ LD_PRELOAD=${preload_lib:-/usr/lib}/libmediaclient.so${LD_PRELOAD:+ }${LD_PRELOAD-}
+ export LD_PRELOAD
+}
+
start() {
ebegin "Starting ${SVCNAME}"
- /opt/bin/mediaclient --start=4
+ (
+ set_preload
+ /opt/bin/mediaclient --start=4
+ )
eend $?
}
stop() {
ebegin "Stopping ${SVCNAME}"
- /opt/bin/mediaclient --shutdown
+ (
+ set_preload
+ timeout -k "${killtime:-15}" "${termtime:-15}" /opt/bin/mediaclient --shutdown
+ )
eend $?
}
diff --git a/media-tv/sundtek-tv/sundtek-tv-151010.162411.ebuild b/media-tv/sundtek-tv/sundtek-tv-151010.162411-r1.ebuild
index 2025ee3f..26d24798 100644
--- a/media-tv/sundtek-tv/sundtek-tv-151010.162411.ebuild
+++ b/media-tv/sundtek-tv/sundtek-tv-151010.162411-r1.ebuild
@@ -116,7 +116,9 @@ src_prepare() {
>etc/revdep-rebuild/50-sundtek-tv
if use ld-preload-file
then echo "/${mylibdir}/libmediaclient.so" >etc/ld.so.preload
+ else sed -i -e 's/preload:-NO/preload:-YES/' sundtek.initd
fi
+ sed -i -e "s'preload_lib:-/usr/lib'preload_lib:-/${mylibdir}'" sundtek.initd
if use ld-preload-env
then mkdir etc/env.d
echo "LD_PRELOAD=\"/${mylibdir}/libmediaclient.so\"" >etc/env.d/50sundtek-tv