#!/bin/sh

. config/options

require_glibc $1

get_meta $1

ATI_PKG="ati-driver-installer-10-7-x86.x86_64.run"
[ -d $PKG_BUILD_DIR ] && rm -rf $PKG_BUILD_DIR

sh $SOURCES/$1/$ATI_PKG --extract $PKG_BUILD_DIR

if [ -d "$PACKAGES/$1/patches.ati/" ]; then
  for i in $PACKAGES/$1/patches.ati/*.diff*; do
    echo "## Applying patch: $i"
    cat $i | patch -d `echo $BUILD/$1* | cut -f1 -d\ ` -p1 >&$VERBOSE_OUT
  done
fi
