#!/bin/sh

AGENTS="imip_person.py imip_person_outgoing.py imip_resource.py"
MODULES="markup.py imip_store.py vCalendar.py vContent.py vRecurrence.py"
INSTALL_DIR=/var/lib/imip-agent
WEB_INSTALL_DIR=/var/www/imip-agent

if [ ! -e "$INSTALL_DIR" ]; then
    mkdir -p "$INSTALL_DIR"
fi

cp $AGENTS "$INSTALL_DIR"
cp $MODULES "$INSTALL_DIR"
mkdir "$INSTALL_DIR"/imiptools
mkdir "$INSTALL_DIR"/imiptools/handlers
cp imiptools/*.py "$INSTALL_DIR"/imiptools/
cp imiptools/handlers/*.py "$INSTALL_DIR"/imiptools/handlers/

if [ ! -e "$WEB_INSTALL_DIR" ]; then
    mkdir -p "$WEB_INSTALL_DIR"
fi

cp imip_manager.py "$WEB_INSTALL_DIR"
