1 #!/bin/sh 2 3 # Agents and modules. 4 5 AGENTS="imip_person.py imip_person_outgoing.py imip_resource.py" 6 MODULES="markup.py imip_store.py vCalendar.py vContent.py vRecurrence.py" 7 INSTALL_DIR=/var/lib/imip-agent 8 CONFIG_DIR=/etc/imip-agent 9 10 if [ ! -e "$INSTALL_DIR" ]; then 11 mkdir -p "$INSTALL_DIR" 12 fi 13 14 cp $AGENTS "$INSTALL_DIR" 15 cp $MODULES "$INSTALL_DIR" 16 17 if [ ! -e "$INSTALL_DIR/imiptools" ]; then 18 mkdir "$INSTALL_DIR/imiptools" 19 if [ ! -e "$INSTALL_DIR/imiptools" ]; then 20 mkdir "$INSTALL_DIR/imiptools/handlers" 21 fi 22 fi 23 24 # Remove any symbolic link to the config module. 25 26 if [ -h "$INSTALL_DIR/imiptools/config.py" ]; then 27 rm "$INSTALL_DIR/imiptools/config.py" 28 fi 29 30 # Copy modules into the installation directory. 31 32 cp imiptools/*.py "$INSTALL_DIR/imiptools/" 33 cp imiptools/handlers/*.py "$INSTALL_DIR/imiptools/handlers/" 34 35 # Install the config module in a more appropriate location. 36 37 if [ ! -e "$CONFIG_DIR" ]; then 38 mkdir -p "$CONFIG_DIR" 39 fi 40 41 if [ -e "$CONFIG_DIR/config.py" ]; then 42 if [ ! -e "$CONFIG_DIR/config.py.backup" ]; then 43 mv "$CONFIG_DIR/config.py" "$CONFIG_DIR/config.py.backup" 44 fi 45 fi 46 47 # Replace the config module with a symbolic link. 48 49 mv "$INSTALL_DIR/imiptools/config.py" "$CONFIG_DIR/" 50 ln -s "$CONFIG_DIR/config.py" "$INSTALL_DIR/imiptools/config.py" 51 52 # Tools 53 54 TOOLS="fix.sh init.sh init_user.sh make_freebusy.py" 55 56 if [ ! -e "$INSTALL_DIR/tools" ]; then 57 mkdir -p "$INSTALL_DIR/tools" 58 fi 59 60 for TOOL in $TOOLS; do 61 cp "tools/$TOOL" "$INSTALL_DIR/tools/" 62 done 63 64 # Web manager interface. 65 66 WEB_INSTALL_DIR=/var/www/imip-agent 67 68 if [ ! -e "$WEB_INSTALL_DIR" ]; then 69 mkdir -p "$WEB_INSTALL_DIR" 70 fi 71 72 cp imip_manager.py "$WEB_INSTALL_DIR" 73 cp htdocs/styles.css "$WEB_INSTALL_DIR" 74 75 if [ ! -e "$WEB_INSTALL_DIR/imipweb" ]; then 76 mkdir "$WEB_INSTALL_DIR/imipweb" 77 fi 78 79 cp imipweb/*.py "$WEB_INSTALL_DIR/imipweb/"