#!/bin/sh -e
# HiveMind - Cross-platform collaborative mind map editor
# HiveMind deployment script for Nokia N900
# Copyright (C) 2011 Ilya Paramonov

# Build
cd `dirname $0`
make version
make

# Remove old HiveMind directory and create the new one
ssh n900 'rm -rf hivemind ; mkdir hivemind'

# Clear the project from old binaries
make clean-binaries

# Copy HiveMind files
INSTALLATION_LIST=`grep ^INSTALLATION_LIST= Makefile | cut -d = -f 2`
scp -r $INSTALLATION_LIST hivemind.py Makefile n900:hivemind

# Finally, start HiveMind
echo cd hivemind \; python2.5 ./hivemind.py | ssh n900
