#!/bin/bash

VERSION=$1

rm -rf intel-media-driver-*.tar.?z

echo "Downloading intel-media-driver-$VERSION..."

wget "https://github.com/intel/media-driver/archive/intel-media-$VERSION/media-driver-intel-media-$VERSION.tar.gz"

tar xf media-driver-intel-media-$VERSION.tar.gz

mv media-driver-intel-media-$VERSION intel-media-driver-$VERSION

tar cf intel-media-driver-$VERSION.tar intel-media-driver-$VERSION
plzip -9 intel-media-driver-$VERSION.tar

rm -rf intel-media-driver-$VERSION media-driver-intel-media-$VERSION.tar.?z
