#!/bin/sh
#
# install.sh v0.1
#
# Install script which reads files from the plist and copies them to the appropriate
# location and makes directories for them if necessary

/bin/mkdir -p /usr/local/www/data/ismail

# Install the required files
for file in `cat pkg-plist | grep -v @ | grep ISMAILDIR | sed 's,%%[A-Z]*%%,,g'`; do
        dir=`echo "${file}" | sed 's,/[^/]*$,/,g'`
       if [ -d /mnt/gmirror/ports/www/ismail/work/ismail/${dir} ]; then
                /bin/mkdir -p /usr/local/www/data/ismail/${dir}
       fi
       install  -o root -g wheel -m 555  /mnt/gmirror/ports/www/ismail/work/ismail/${file} /usr/local/www/data/ismail/${file}
done
