Files
LibreELEC.tv/packages/3rdparty/driver/sundtek/unpack
2012-03-21 19:49:38 +01:00

78 lines
2.9 KiB
Bash
Executable File

#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
. config/options $1
mkdir -p $BUILD/${PKG_NAME}_${PKG_VERSION}
(
cd $BUILD/${PKG_NAME}_${PKG_VERSION}
CHAR=`echo $SOURCES | awk '{ch=substr($0, 0, 1); printf("%c", ch); }'`
if [ ${CHAR} = "/" ]; then
SRC_INSTALLER_ROOT=""
else
SRC_INSTALLER_ROOT="$ROOT/"
fi
sh ${SRC_INSTALLER_ROOT}$SOURCES/$1/${PKG_NAME}_${PKG_VERSION}.sh -e >/dev/null 2>&1
rm chk* installer.tar.gz
rm -r 32bit23 arm* dreambox mips* openwrtmipsr2 ppc*
)
[ "$TARGET_ARCH" = "i386" ] && ARCH_DIR=32bit
[ "$TARGET_ARCH" = "x86_64" ] && ARCH_DIR=64bit
SUNDTEK_ROOT=$BUILD/${PKG_NAME}_${PKG_VERSION}/rootsys
mkdir -p $SUNDTEK_ROOT
tar xzf $BUILD/${PKG_NAME}_${PKG_VERSION}/$ARCH_DIR/installer.tar.gz -C $SUNDTEK_ROOT
# fix permissions (on mediasrv binary)
chmod 755 $SUNDTEK_ROOT/opt/bin/*
# binary search & replace (strings must be same length!)
# mediasrv
# /etc/sunI»dtek.conf
# /etc/sundtek.conf
# libdrv_em28xx.so
# /etc/sundtek.conf
# mediaclient
# /etc/sundtek_diseqc.conf
#perl -pi -e 's|\x2F\x65\x74\x63\x2F\x73\x75\x6E\x49\xBB\x64\x74\x65\x6B\x2E\x63\x6F\x6E\x66|\x2F\x74\x6D\x70\x2F\x73\x75\x6E\x49\xBB\x64\x74\x65\x6B\x2E\x63\x6F\x6E\x66|g' $SUNDTEK_ROOT/opt/bin/mediasrv
#perl -pi -e 's|/etc/sundtek.conf|/tmp/sundtek.conf|g' $SUNDTEK_ROOT/opt/bin/mediasrv
#perl -pi -e 's|/etc/sundtek.conf|/tmp/sundtek.conf|g' $SUNDTEK_ROOT/opt/bin/dvb/libdrv_em28xx.so
#perl -pi -e 's|/etc/sundtek_diseqc.conf|/tmp/sundtek_diseqc.conf|g' $SUNDTEK_ROOT/opt/bin/mediaclient
perl -pi -e 's|/etc|/tmp|g' $SUNDTEK_ROOT/opt/bin/mediasrv
perl -pi -e 's|/etc|/tmp|g' $SUNDTEK_ROOT/opt/bin/dvb/libdrv_em28xx.so
perl -pi -e 's|/etc|/tmp|g' $SUNDTEK_ROOT/opt/bin/mediaclient
if [ "$PKG_VERSION" = "installer_development" ]; then
wget -q -t 3 -T 3 -O $SUNDTEK_ROOT/sundtek_version.html http://support.sundtek.com/index.php/topic,708.0.html
else
cat >$SUNDTEK_ROOT/sundtek_version.html << MYDATA
<html><body>${PKG_NAME}_${PKG_VERSION}.sh</body></html>
MYDATA
fi