author | Pascal Volk <neverseen@users.sourceforge.net> |
Fri, 18 Jan 2008 20:25:05 +0000 | |
changeset 7 | 96761c442dcf |
parent 4 | f3c30b7421b9 |
child 14 | ebc9b864bc9a |
permissions | -rwxr-xr-x |
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 | 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 | 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) |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
12 |
PF_GID=$(id -g postfix) |
4 | 13 |
DOC_DIR=${PREFIX}/share/doc/vmm |
14 |
DOCS="ChangeLog COPYING INSTALL README" |
|
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
15 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
16 |
if [ $(id -u) -ne 0 ]; then |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
17 |
echo "Run this script as root." |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
18 |
exit 1 |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
19 |
fi |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
20 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
21 |
python setup.py install --prefix ${PREFIX} |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
22 |
python setup.py clean --all >/dev/null |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
23 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
24 |
install -b -m 0600 ${INSTALL_OPTS} vmm.cfg ${PREFIX}/etc/ |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
25 |
install -b -m 0640 -g ${PF_GID} -o 0 -p -v pgsql-*.cf ${PF_CONFDIR}/ |
4 | 26 |
install -m 0700 ${INSTALL_OPTS} vmm ${PREFIX}/sbin |
27 |
||
28 |
[ -d ${DOC_DIR} ] || mkdir -m 0755 -p ${DOC_DIR} |
|
29 |
for DOC in ${DOCS}; do |
|
30 |
install -m 0644 ${INSTALL_OPTS} ${DOC} ${DOC_DIR} |
|
31 |
done |
|
32 |
||
33 |
[ -d ${DOC_DIR}/examples ] || mkdir -m 0755 -p ${DOC_DIR}/examples |
|
34 |
install -m 0644 ${INSTALL_OPTS} pgsql-*.cf ${DOC_DIR}/examples |
|
35 |
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
|
36 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
37 |
echo |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
38 |
echo "Don't forget to edit ${PREFIX}/etc/vmm.cfg" |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
39 |
echo "and ${PF_CONFDIR}/pgsql-*.cf files." |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
40 |
echo |