author | Pascal Volk <neverseen@users.sourceforge.net> |
Mon, 26 May 2008 22:18:19 +0000 | |
changeset 36 | 8a9ce20d2569 |
parent 32 | ceb700bc4a80 |
child 37 | 89f952b0f366 |
permissions | -rwxr-xr-x |
31
b7a7e566833c
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
27
diff
changeset
|
1 |
#!/bin/sh |
0
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 |
31
b7a7e566833c
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
27
diff
changeset
|
8 |
PATH=/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
9 |
PREFIX=/usr/local |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
10 |
PF_CONFDIR=$(postconf -h config_directory) |
31
b7a7e566833c
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
27
diff
changeset
|
11 |
PF_GID=$(id -g $(postconf -h mail_owner)) |
32
ceb700bc4a80
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
31
diff
changeset
|
12 |
LOCALE_DIR=${PREFIX}/share/locale |
4 | 13 |
DOC_DIR=${PREFIX}/share/doc/vmm |
23 | 14 |
MAN1DIR=${PREFIX}/share/man/man1 |
15 |
MAN5DIR=${PREFIX}/share/man/man5 |
|
4 | 16 |
DOCS="ChangeLog COPYING INSTALL README" |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
17 |
|
31
b7a7e566833c
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
27
diff
changeset
|
18 |
case "$(uname -s)" in |
b7a7e566833c
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
27
diff
changeset
|
19 |
'OpenBSD' | 'NetBSD') |
b7a7e566833c
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
27
diff
changeset
|
20 |
INSTALL_OPTS="-g 0 -o 0 -p" |
b7a7e566833c
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
27
diff
changeset
|
21 |
INSTALL_OPTS_CF="-b -m 0640 -g ${PF_GID} -o 0 -p" |
b7a7e566833c
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
27
diff
changeset
|
22 |
;; |
b7a7e566833c
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
27
diff
changeset
|
23 |
*) |
b7a7e566833c
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
27
diff
changeset
|
24 |
INSTALL_OPTS="-g 0 -o 0 -p -v" |
b7a7e566833c
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
27
diff
changeset
|
25 |
INSTALL_OPTS_CF="-b -m 0640 -g ${PF_GID} -o 0 -p -v" |
b7a7e566833c
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
27
diff
changeset
|
26 |
;; |
b7a7e566833c
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
27
diff
changeset
|
27 |
esac |
b7a7e566833c
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
27
diff
changeset
|
28 |
|
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
29 |
if [ $(id -u) -ne 0 ]; then |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
30 |
echo "Run this script as root." |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
31 |
exit 1 |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
32 |
fi |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
33 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
34 |
python setup.py install --prefix ${PREFIX} |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
35 |
python setup.py clean --all >/dev/null |
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 |
install -b -m 0600 ${INSTALL_OPTS} vmm.cfg ${PREFIX}/etc/ |
31
b7a7e566833c
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
27
diff
changeset
|
38 |
install ${INSTALL_OPTS_CF} pgsql-*.cf ${PF_CONFDIR}/ |
4 | 39 |
install -m 0700 ${INSTALL_OPTS} vmm ${PREFIX}/sbin |
40 |
||
32
ceb700bc4a80
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
31
diff
changeset
|
41 |
[ -d ${LOCALE_DIR} ] || mkdir -m 0755 -p ${LOCALE_DIR} |
ceb700bc4a80
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
31
diff
changeset
|
42 |
cd po |
ceb700bc4a80
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
31
diff
changeset
|
43 |
for po in $(ls -1 *.po); do |
ceb700bc4a80
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
31
diff
changeset
|
44 |
lang=$(basename ${po} .po) |
ceb700bc4a80
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
31
diff
changeset
|
45 |
ddir=${LOCALE_DIR}/${lang}/LC_MESSAGES |
ceb700bc4a80
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
31
diff
changeset
|
46 |
[ -d ${ddir} ] || mkdir -m 0755 -p ${ddir} |
ceb700bc4a80
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
31
diff
changeset
|
47 |
msgfmt -o ${LOCALE_DIR}/${lang}/LC_MESSAGES/vmm.mo ${po} |
ceb700bc4a80
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
31
diff
changeset
|
48 |
done |
ceb700bc4a80
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
31
diff
changeset
|
49 |
cd - |
ceb700bc4a80
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
31
diff
changeset
|
50 |
|
23 | 51 |
[ -d ${MAN1DIR} ] || mkdir -m 0755 -p ${MAN1DIR} |
52 |
install -m 0644 ${INSTALL_OPTS} vmm.1 ${MAN1DIR} |
|
53 |
||
24 | 54 |
[ -d ${MAN5DIR} ] || mkdir -m 0755 -p ${MAN5DIR} |
55 |
install -m 0644 ${INSTALL_OPTS} vmm.cfg.5 ${MAN5DIR} |
|
56 |
||
4 | 57 |
[ -d ${DOC_DIR} ] || mkdir -m 0755 -p ${DOC_DIR} |
58 |
for DOC in ${DOCS}; do |
|
59 |
install -m 0644 ${INSTALL_OPTS} ${DOC} ${DOC_DIR} |
|
60 |
done |
|
61 |
||
62 |
[ -d ${DOC_DIR}/examples ] || mkdir -m 0755 -p ${DOC_DIR}/examples |
|
63 |
install -m 0644 ${INSTALL_OPTS} pgsql-*.cf ${DOC_DIR}/examples |
|
64 |
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
|
65 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
66 |
echo |
14
ebc9b864bc9a
* 'update_config_0.3.x-0.4.py'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
4
diff
changeset
|
67 |
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
|
68 |
echo "and ${PF_CONFDIR}/pgsql-*.cf files." |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
69 |
echo |