# HG changeset patch # User Paul Boddie # Date 1441115982 -7200 # Node ID 42c0ac3eb89c8c0ab828d422e368fb076ddcd855 # Parent 93ad1f9ce395916aef99c61800f7b28166c03137 Install the config module into a subdirectory of /etc, linking to it from the library installation directory. diff -r 93ad1f9ce395 -r 42c0ac3eb89c tools/install.sh --- a/tools/install.sh Mon Aug 31 23:29:43 2015 +0200 +++ b/tools/install.sh Tue Sep 01 15:59:42 2015 +0200 @@ -5,6 +5,7 @@ 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 +CONFIG_DIR=/etc/imip-agent if [ ! -e "$INSTALL_DIR" ]; then mkdir -p "$INSTALL_DIR" @@ -20,14 +21,33 @@ fi fi -if [ -e "$INSTALL_DIR/imiptools/config.py" ]; then - if [ ! -e "$INSTALL_DIR/imiptools/config.py.backup" ]; then - mv "$INSTALL_DIR/imiptools/config.py" "$INSTALL_DIR/imiptools/config.py.backup" +# Remove any symbolic link to the config module. + +if [ -h "$INSTALL_DIR/imiptools/config.py" ]; then + rm "$INSTALL_DIR/imiptools/config.py" +fi + +# Copy modules into the installation directory. + +cp imiptools/*.py "$INSTALL_DIR/imiptools/" +cp imiptools/handlers/*.py "$INSTALL_DIR/imiptools/handlers/" + +# Install the config module in a more appropriate location. + +if [ ! -e "$CONFIG_DIR" ]; then + mkdir -p "$CONFIG_DIR" +fi + +if [ -e "$CONFIG_DIR/config.py" ]; then + if [ ! -e "$CONFIG_DIR/config.py.backup" ]; then + mv "$CONFIG_DIR/config.py" "$CONFIG_DIR/config.py.backup" fi fi -cp imiptools/*.py "$INSTALL_DIR/imiptools/" -cp imiptools/handlers/*.py "$INSTALL_DIR/imiptools/handlers/" +# Replace the config module with a symbolic link. + +mv "$INSTALL_DIR/imiptools/config.py" "$CONFIG_DIR/" +ln -s "$CONFIG_DIR/config.py" "$INSTALL_DIR/imiptools/config.py" # Tools