install.sh
author Pascal Volk <neverseen@users.sourceforge.net>
Thu, 01 May 2008 19:27:06 +0000
changeset 28 87da30d30fde
parent 27 8c5f1eba0ea6
child 31 b7a7e566833c
permissions -rwxr-xr-x
* 'VirtualMailManager/VirtualMailManager.py' - Create base directory with correct access mode and gid, if it does not exist yet.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     1
#!/bin/bash
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     2
# $Id$
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     3
#
4
f3c30b7421b9 * 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 0
diff changeset
     4
# Installation script for the Virtual Mail Manager
0
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     5
# run: ./install.sh
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     6
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     7
LANG=C
4
f3c30b7421b9 * 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 0
diff changeset
     8
PATH=/bin:/usr/sbin:/usr/bin
0
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     9
INSTALL_OPTS="-g 0 -o 0 -p -v"
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    10
PREFIX=/usr/local
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    11
PF_CONFDIR=$(postconf -h config_directory)
27
8c5f1eba0ea6 * 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 24
diff changeset
    12
PF_GID=$(id -g postfix)
4
f3c30b7421b9 * 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 0
diff changeset
    13
DOC_DIR=${PREFIX}/share/doc/vmm
23
d5ad5432e9eb * 'vmm.1'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 14
diff changeset
    14
MAN1DIR=${PREFIX}/share/man/man1
d5ad5432e9eb * 'vmm.1'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 14
diff changeset
    15
MAN5DIR=${PREFIX}/share/man/man5
4
f3c30b7421b9 * 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 0
diff changeset
    16
DOCS="ChangeLog COPYING INSTALL README"
0
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    17
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    18
if [ $(id -u) -ne 0 ]; then
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    19
    echo "Run this script as root."
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    20
    exit 1
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    21
fi
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    22
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    23
python setup.py install --prefix ${PREFIX}
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    24
python setup.py clean --all >/dev/null
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    25
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    26
install -b -m 0600 ${INSTALL_OPTS} vmm.cfg ${PREFIX}/etc/
27
8c5f1eba0ea6 * 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 24
diff changeset
    27
install -b -m 0640 -g ${PF_GID} -o 0 -p -v pgsql-*.cf ${PF_CONFDIR}/
4
f3c30b7421b9 * 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 0
diff changeset
    28
install -m 0700 ${INSTALL_OPTS} vmm ${PREFIX}/sbin
f3c30b7421b9 * 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 0
diff changeset
    29
23
d5ad5432e9eb * 'vmm.1'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 14
diff changeset
    30
[ -d ${MAN1DIR} ] || mkdir -m 0755 -p ${MAN1DIR}
d5ad5432e9eb * 'vmm.1'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 14
diff changeset
    31
install -m 0644 ${INSTALL_OPTS} vmm.1 ${MAN1DIR}
d5ad5432e9eb * 'vmm.1'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 14
diff changeset
    32
24
48ea255e8a85 * 'vmm.cfg.5'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 23
diff changeset
    33
[ -d ${MAN5DIR} ] || mkdir -m 0755 -p ${MAN5DIR}
48ea255e8a85 * 'vmm.cfg.5'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 23
diff changeset
    34
install -m 0644 ${INSTALL_OPTS} vmm.cfg.5 ${MAN5DIR}
48ea255e8a85 * 'vmm.cfg.5'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 23
diff changeset
    35
4
f3c30b7421b9 * 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 0
diff changeset
    36
[ -d ${DOC_DIR} ] || mkdir -m 0755 -p ${DOC_DIR}
f3c30b7421b9 * 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 0
diff changeset
    37
for DOC in ${DOCS}; do
f3c30b7421b9 * 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 0
diff changeset
    38
    install -m 0644 ${INSTALL_OPTS} ${DOC} ${DOC_DIR}
f3c30b7421b9 * 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 0
diff changeset
    39
done
f3c30b7421b9 * 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 0
diff changeset
    40
f3c30b7421b9 * 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 0
diff changeset
    41
[ -d ${DOC_DIR}/examples ] || mkdir -m 0755 -p ${DOC_DIR}/examples
f3c30b7421b9 * 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 0
diff changeset
    42
install -m 0644 ${INSTALL_OPTS} pgsql-*.cf ${DOC_DIR}/examples
f3c30b7421b9 * 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 0
diff changeset
    43
install -m 0644 ${INSTALL_OPTS} vmm.cfg ${DOC_DIR}/examples
0
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    44
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    45
echo
14
ebc9b864bc9a * 'update_config_0.3.x-0.4.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents: 4
diff changeset
    46
echo "Don't forget to edit ${PREFIX}/etc/vmm.cfg - or run: vmm cf"
0
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    47
echo "and ${PF_CONFDIR}/pgsql-*.cf files."
bb0aa2102206 Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    48
echo