-#!/bin/sh
+#!/bin/bash
-FROM=$1
-VERSION=$2
+if [ ! -d ".git" -o `dirname $0` != "./source4/script" ]; then
+ echo "Run this script from the top-level directory in the"
+ echo "repository as: ./source4/script/mkrelease.sh"
+ exit 1
+fi
-svn export $FROM samba-$VERSION
+./buildtools/bin/waf dist
+TGZFILE="`echo *.tar.gz`"
+gunzip $TGZFILE
+TARFILE="`echo *.tar`"
-( cd samba-$VERSION || exit 1
- (cd source && ./autogen.sh ) || exit 1
- rm -rf webapps/qooxdoo-*-sdk/frontend/framework/.cache || exit 1
-) || exit 1
-
-tar -zcf samba-$VERSION.tar.gz samba-$VERSION
+echo "Now run: "
+echo "gpg --detach-sign --armor $TARFILE"
+echo "gzip $TARFILE"
+echo "And then upload "
+echo "$TARFILE.gz $TARFILE.asc"
+echo "to pub/samba/samba4/ on samba.org"