Blob Blame History Raw
#!/bin/bash

set -e

tmp=$(mktemp -d)

trap cleanup EXIT
cleanup() {
    set +e
    [ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp"
}

unset CDPATH
pwd=$(pwd)
svn=$(date +%Y%m%d)svn
name=hydrogen
version=0.9.4-beta3

cd "$tmp"
svn co http://svn.assembla.com/svn/hydrogen/tags/$version $name
revision=$(svnversion $name)

# We remove the .svn directories from the tarball to save space and we
# actually don't need them, except this one place where scons calls
# /usr/bin/svnversion to look up the version of these directories.
# We hack the build script so that it doesn't call /usr/bin/svnversion .
# This saves us a BR and ~2MB otherwise unneeded diskspace:
find ./$name -type d -name .svn -print0 | xargs -0r rm -rf
sed -i "s|\(revision():\)|\1\n\treturn \"$revision\"|" $name/Sconstruct

tar jcf "$pwd"/$name-$version-"$revision"svn.tar.bz2 $name 
echo "Wrote: " $name-$version-"$revision"svn.tar.bz2
cd - >/dev/null