PageRenderTime 16ms CodeModel.GetById 9ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/packages/linux-drivers/aver_h826d/unpack

http://github.com/OpenELEC/OpenELEC.tv
Shell | 52 lines | 22 code | 8 blank | 22 comment | 7 complexity | aebbd6cde75c1640726d09b444d64b37 MD5 | raw file
 1#!/bin/sh
 2
 3################################################################################
 4#      This file is part of OpenELEC - http://www.openelec.tv
 5#      Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv)
 6#
 7#  This Program is free software; you can redistribute it and/or modify
 8#  it under the terms of the GNU General Public License as published by
 9#  the Free Software Foundation; either version 2, or (at your option)
10#  any later version.
11#
12#  This Program is distributed in the hope that it will be useful,
13#  but WITHOUT ANY WARRANTY; without even the implied warranty of
14#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15#  GNU General Public License for more details.
16#
17#  You should have received a copy of the GNU General Public License
18#  along with OpenELEC.tv; see the file COPYING.  If not, write to
19#  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20#  http://www.gnu.org/copyleft/gpl.html
21################################################################################
22
23. config/options $1
24
25ZIP_PKG="`echo $PKG_URL | sed 's%.*/\(.*\)$%\1%'`"
26
27mkdir -p $BUILD/${PKG_NAME}-${PKG_VERSION}
28
29unzip $SOURCES/$1/$ZIP_PKG -d $BUILD/${PKG_NAME}-${PKG_VERSION} >/dev/null 2>&1
30
31tail -n +115 $BUILD/${PKG_NAME}-${PKG_VERSION}/H826D_Installer_*/AVERMEDIA-Linux-*-H826D-0.10-beta.sh | bzip2 -d | tar xf - -C $BUILD/${PKG_NAME}-${PKG_VERSION}
32
33# this code is copied from scripts/unpack
34PKG_BUILD=`ls -d $BUILD/${PKG_NAME}[-_.]${PKG_VERSION}`
35for i in $PKG_DIR/patches-manual/$PKG_NAME-$PKG_VERSION*.patch ; do
36  if [ -f "$i" ]; then
37    PATCH=`basename $i`
38    PT=`echo $PATCH | sed 's/.*\.\(.*\)$/\1/'`
39    if [ "$PT" != "patch" -a "$PT" != "$TARGET_ARCH" ]; then
40      printf "%${INDENT}c SKIP PATCH:   $i\n" >&$SILENT_OUT
41      continue;
42    else
43      printf "%${INDENT}c APPLY PATCH:   $i\n" >&$SILENT_OUT
44      cat $i | patch -p1 -d `echo "$PKG_BUILD" | cut -f1 -d\ ` -p1 >&$VERBOSE_OUT
45    fi
46  fi
47done
48
49# prebuild objects were hex edited for kernel 3.1
50[ "$TARGET_ARCH" = "x86_64" ] && KVSTR=x64
51[ "$TARGET_ARCH" = "i386" ] && KVSTR=4GREG
52cp -rf $PKG_DIR/kdep_2.6.30/OBJ-$KVSTR/* $BUILD/${PKG_NAME}-${PKG_VERSION}/installer/src