7235f4f
#!/bin/bash
7235f4f
7235f4f
set -e
7235f4f
7235f4f
tmp=$(mktemp -d)
7235f4f
7235f4f
trap cleanup EXIT
7235f4f
cleanup() {
7235f4f
    set +e
7235f4f
    [ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp"
7235f4f
}
7235f4f
7235f4f
unset CDPATH
7235f4f
pwd=$(pwd)
7235f4f
svn=$(date +%Y%m%d)svn
7235f4f
name=hydrogen
7235f4f
version=0.9.4-beta3
7235f4f
7235f4f
cd "$tmp"
7235f4f
svn co http://svn.assembla.com/svn/hydrogen/tags/$version $name
7235f4f
revision=$(svnversion $name)
7235f4f
7235f4f
# We remove the .svn directories from the tarball to save space and we
7235f4f
# actually don't need them, except this one place where scons calls
7235f4f
# /usr/bin/svnversion to look up the version of these directories.
7235f4f
# We hack the build script so that it doesn't call /usr/bin/svnversion .
7235f4f
# This saves us a BR and ~2MB otherwise unneeded diskspace:
7235f4f
find ./$name -type d -name .svn -print0 | xargs -0r rm -rf
7235f4f
sed -i "s|\(revision():\)|\1\n\treturn \"$revision\"|" $name/Sconstruct
7235f4f
7235f4f
tar jcf "$pwd"/$name-$version-"$revision"svn.tar.bz2 $name 
7235f4f
echo "Wrote: " $name-$version-"$revision"svn.tar.bz2
7235f4f
cd - >/dev/null