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