#!/bin/sh
#
# $Id: release 115 2003-04-23 16:26:44Z blais $
#
# Release script.  This will build the distributions and upload them automatically.
#

TOPDIR=$(basename $PWD)
if [ "$TOPDIR" != "curator" ]; then
    echo "Error: you must run this from the root directory." 1>&2
    exit 1
fi

set -x

DSTHOST=vor.iro.umontreal.ca
DSTDIR=pub/curator/dist

# Check that our agent has the necessary keys.
if ! ssh-add -l >/dev/null ; then 
    ssh-add
fi

rm -rf dist build

python setup.py sdist
python setup.py bdist_rpm
ssh $DSTHOST mkdir -p $DSTDIR
scp dist/* $DSTHOST:$DSTDIR
ssh $DSTHOST chmod 755 $DSTDIR $DSTDIR/*

rm -rf dist build
