author | Pascal Volk <neverseen@users.sourceforge.net> |
Mon, 28 Apr 2008 21:33:28 +0000 | |
changeset 24 | 48ea255e8a85 |
parent 23 | d5ad5432e9eb |
child 27 | 8c5f1eba0ea6 |
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) |
4 | 12 |
DOC_DIR=${PREFIX}/share/doc/vmm |
23 | 13 |
MAN1DIR=${PREFIX}/share/man/man1 |
14 |
MAN5DIR=${PREFIX}/share/man/man5 |
|
4 | 15 |
DOCS="ChangeLog COPYING INSTALL README" |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
16 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
17 |
if [ $(id -u) -ne 0 ]; then |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
18 |
echo "Run this script as root." |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
19 |
exit 1 |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
20 |
fi |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
21 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
22 |
python setup.py install --prefix ${PREFIX} |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
23 |
python setup.py clean --all >/dev/null |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
24 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
25 |
install -b -m 0600 ${INSTALL_OPTS} vmm.cfg ${PREFIX}/etc/ |
14
ebc9b864bc9a
* 'update_config_0.3.x-0.4.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
4
diff
changeset
|
26 |
install -b -m 0640 ${INSTALL_OPTS} pgsql-*.cf ${PF_CONFDIR}/ |
4 | 27 |
install -m 0700 ${INSTALL_OPTS} vmm ${PREFIX}/sbin |
28 |
||
23 | 29 |
[ -d ${MAN1DIR} ] || mkdir -m 0755 -p ${MAN1DIR} |
30 |
install -m 0644 ${INSTALL_OPTS} vmm.1 ${MAN1DIR} |
|
31 |
||
24 | 32 |
[ -d ${MAN5DIR} ] || mkdir -m 0755 -p ${MAN5DIR} |
33 |
install -m 0644 ${INSTALL_OPTS} vmm.cfg.5 ${MAN5DIR} |
|
34 |
||
4 | 35 |
[ -d ${DOC_DIR} ] || mkdir -m 0755 -p ${DOC_DIR} |
36 |
for DOC in ${DOCS}; do |
|
37 |
install -m 0644 ${INSTALL_OPTS} ${DOC} ${DOC_DIR} |
|
38 |
done |
|
39 |
||
40 |
[ -d ${DOC_DIR}/examples ] || mkdir -m 0755 -p ${DOC_DIR}/examples |
|
41 |
install -m 0644 ${INSTALL_OPTS} pgsql-*.cf ${DOC_DIR}/examples |
|
42 |
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
|
43 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
44 |
echo |
14
ebc9b864bc9a
* 'update_config_0.3.x-0.4.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
4
diff
changeset
|
45 |
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
|
46 |
echo "and ${PF_CONFDIR}/pgsql-*.cf files." |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
47 |
echo |