#!/bin/sh

echo "getting sources..."
  svn co https://libjpeg-turbo.svn.sourceforge.net/svnroot/libjpeg-turbo/trunk libjpeg-turbo-latest

echo "getting version..."
  cd libjpeg-turbo-latest
    SVN_REV=`LANG=C svn info 2>/dev/null | grep Revision: | sed -e 's/.*\: //'`
    echo $SVN_REV
  cd ..

echo "copying sources..."
  rm -rf libjpeg-turbo-$SVN_REV
  cp -R libjpeg-turbo-latest libjpeg-turbo-$SVN_REV

echo "cleaning sources..."
  find libjpeg-turbo-$SVN_REV -name .svn -exec rm -rf {} ";"

echo "packing sources..."
  tar cvjf libjpeg-turbo-$SVN_REV.tar.bz2 libjpeg-turbo-$SVN_REV

echo "remove temporary sourcedir..."
  rm -rf libjpeg-turbo-$SVN_REV
