#!/bin/sh

echo "getting sources..."
  svn checkout svn://svn.projects.openmoko.org/svnroot/siglaunchd/trunk siglaunchd-latest

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

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

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

echo "packing sources..."
  tar cvjf siglaunchd-$SVN_REV.tar.bz2 siglaunchd-$SVN_REV

echo "remove temporary sourcedir..."
  rm -rf siglaunchd-$SVN_REV

