upgrade.sh
author Pascal Volk <neverseen@users.sourceforge.net>
Wed, 11 Jun 2008 05:07:07 +0000
changeset 38 c44ea4526546
child 39 8dcf739fc97e
permissions -rwxr-xr-x
* 'VirtualMailManager/Alias.py' - replaced all »« with '' * 'VirtualMailManager/Account.py' - replaced all »« with '' - added Account.setPassword() * 'VirtualMailManager/VirtualMailManager.py' - replaced all »« with '' - added VirtualMailManager._readpass() - check if domain/account exists before prompting for password (VirtualMailManager.user_add(), VirtualMailManager.user_password()) * 'vmm' - removed _readpass() * 'UPGRADE' * 'upgrade.sh' - added to repository again * 'po/vmm.pot' * 'po/de.po' - updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
38
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     1
#!/bin/sh
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     2
# $Id$
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     3
#
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     4
# Upgrade script for the Virtual Mail Manager
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     5
# run: ./install.sh
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     6
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     7
LANG=C
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     8
PATH=/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     9
PREFIX=/usr/local
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    10
PF_CONFDIR=$(postconf -h config_directory)
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    11
PF_GID=$(id -g $(postconf -h mail_owner))
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    12
LOCALE_DIR=${PREFIX}/share/locale
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    13
DOC_DIR=${PREFIX}/share/doc/vmm
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    14
MANDIR=${PREFIX}/share/man
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    15
DOCS="ChangeLog COPYING INSTALL README"
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    16
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    17
INSTALL_OPTS="-g 0 -o 0 -p"
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    18
INSTALL_OPTS_CF="-b -m 0640 -g ${PF_GID} -o 0 -p"
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    19
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    20
if [ $(id -u) -ne 0 ]; then
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    21
    echo "Run this script as root."
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    22
    exit 1
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    23
fi
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    24
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    25
python setup.py install --prefix ${PREFIX}
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    26
python setup.py clean --all >/dev/null
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    27
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    28
install -m 0700 ${INSTALL_OPTS} vmm ${PREFIX}/sbin
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    29
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    30
[ -d ${LOCALE_DIR} ] || mkdir -m 0755 -p ${LOCALE_DIR}
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    31
cd po
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    32
for po in $(ls -1 *.po); do
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    33
    lang=$(basename ${po} .po)
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    34
    ddir=${LOCALE_DIR}/${lang}/LC_MESSAGES
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    35
    [ -d ${ddir}  ] || mkdir -m 0755 -p ${ddir}
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    36
    msgfmt -o ${LOCALE_DIR}/${lang}/LC_MESSAGES/vmm.mo ${po}
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    37
done
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    38
cd - >/dev/null
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    39
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    40
cd man
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    41
[ -d ${MANDIR}/man1 ] || mkdir -m 0755 -p ${MANDIR}/man1
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    42
install -m 0644 ${INSTALL_OPTS} man1/vmm.1 ${MANDIR}/man1
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    43
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    44
[ -d ${MANDIR}/man5 ] || mkdir -m 0755 -p ${MANDIR}/man5
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    45
install -m 0644 ${INSTALL_OPTS} man5/vmm.cfg.5 ${MANDIR}/man5
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    46
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    47
for l in $(find . -maxdepth 1 -mindepth 1 -type d \! -name man\? \! -name .svn)
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    48
do
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    49
    for s in man1 man5; do
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    50
        [ -d ${MANDIR}/${l}/${s} ] || mkdir -m 0755 -p ${MANDIR}/${l}/${s}
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    51
    done
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    52
    if [ -f ${l}/man1/vmm.1 ]; then
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    53
        install -m 0644 ${INSTALL_OPTS} ${l}/man1/vmm.1 ${MANDIR}/${l}/man1
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    54
    fi
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    55
    if [ -f ${l}/man5/vmm.cfg.5 ]; then
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    56
        install -m 0644 ${INSTALL_OPTS} ${l}/man5/vmm.cfg.5 ${MANDIR}/${l}/man5
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    57
    fi
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    58
done
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    59
cd - >/dev/null
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    60
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    61
[ -d ${DOC_DIR} ] || mkdir -m 0755 -p ${DOC_DIR}
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    62
for DOC in ${DOCS}; do
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    63
    install -m 0644 ${INSTALL_OPTS} ${DOC} ${DOC_DIR}
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    64
done
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    65
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    66
[ -d ${DOC_DIR}/examples ] || mkdir -m 0755 -p ${DOC_DIR}/examples
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    67
install -m 0644 ${INSTALL_OPTS} pgsql-*.cf ${DOC_DIR}/examples
c44ea4526546 * 'VirtualMailManager/Alias.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    68
install -m 0644 ${INSTALL_OPTS} vmm.cfg ${DOC_DIR}/examples