author | Pascal Volk <user@localhost.localdomain.org> |
Sun, 06 Jan 2013 19:10:37 +0000 | |
branch | v0.7.x |
changeset 680 | 5365af94a8ec |
parent 631 | 9b4d0e2c97d5 |
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 |
# |
4 | 3 |
# Installation script for the Virtual Mail Manager |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
4 |
# run: ./install.sh |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
5 |
|
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
6 |
LANG=C |
31
b7a7e566833c
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
27
diff
changeset
|
7 |
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
|
8 |
PREFIX=/usr/local |
39
8dcf739fc97e
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
37
diff
changeset
|
9 |
|
0
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 |
102
485d3f7d6981
Removed svn keywords, more POSIX compliant shell scripts
Pascal Volk <neverseen@users.sourceforge.net>
parents:
81
diff
changeset
|
14 |
if [ ${PREFIX} = "/usr" ]; then |
39
8dcf739fc97e
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
37
diff
changeset
|
15 |
MANDIR=${PREFIX}/share/man |
631
9b4d0e2c97d5
install.sh: Don't fail if $SYSCONFDIR doesn't exist.
Pascal Volk <user@localhost.localdomain.org>
parents:
562
diff
changeset
|
16 |
SYSCONFDIR=/etc |
39
8dcf739fc97e
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
37
diff
changeset
|
17 |
else |
8dcf739fc97e
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
37
diff
changeset
|
18 |
MANDIR=${PREFIX}/man |
631
9b4d0e2c97d5
install.sh: Don't fail if $SYSCONFDIR doesn't exist.
Pascal Volk <user@localhost.localdomain.org>
parents:
562
diff
changeset
|
19 |
SYSCONFDIR=${PREFIX}/etc |
39
8dcf739fc97e
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
37
diff
changeset
|
20 |
fi |
562
b5bb7b34e831
Configure.Dovecot_2: Added configuration documentation for Dovecot_2 >= 2.0.
Pascal Volk <user@localhost.localdomain.org>
parents:
167
diff
changeset
|
21 |
DOCS="ChangeLog Configure.Dovecot_2 COPYING INSTALL NEWS README" |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
22 |
|
37
89f952b0f366
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
32
diff
changeset
|
23 |
INSTALL_OPTS="-g 0 -o 0 -p" |
89f952b0f366
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
32
diff
changeset
|
24 |
INSTALL_OPTS_CF="-b -m 0640 -g ${PF_GID} -o 0 -p" |
31
b7a7e566833c
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
27
diff
changeset
|
25 |
|
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
26 |
if [ $(id -u) -ne 0 ]; then |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
27 |
echo "Run this script as root." |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
28 |
exit 1 |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
29 |
fi |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
30 |
|
164
67dc18294de6
*.sh: Added --force option to python setup.py install call.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
159
diff
changeset
|
31 |
python setup.py -q install --force --prefix ${PREFIX} |
0
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
32 |
python setup.py clean --all >/dev/null |
bb0aa2102206
Initial import @sf.net
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff
changeset
|
33 |
|
631
9b4d0e2c97d5
install.sh: Don't fail if $SYSCONFDIR doesn't exist.
Pascal Volk <user@localhost.localdomain.org>
parents:
562
diff
changeset
|
34 |
[ -d ${SYSCONFDIR} ] || mkdir -m 0755 -p ${SYSCONFDIR} |
9b4d0e2c97d5
install.sh: Don't fail if $SYSCONFDIR doesn't exist.
Pascal Volk <user@localhost.localdomain.org>
parents:
562
diff
changeset
|
35 |
install -b -m 0600 ${INSTALL_OPTS} vmm.cfg ${SYSCONFDIR}/ |
159
78b6b06188d3
Moved Postfix PostgreSQL client configuration files into the postfix directory.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
102
diff
changeset
|
36 |
install ${INSTALL_OPTS_CF} postfix/pgsql-*.cf ${PF_CONFDIR}/ |
4 | 37 |
install -m 0700 ${INSTALL_OPTS} vmm ${PREFIX}/sbin |
38 |
||
32
ceb700bc4a80
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
31
diff
changeset
|
39 |
[ -d ${LOCALE_DIR} ] || mkdir -m 0755 -p ${LOCALE_DIR} |
ceb700bc4a80
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
31
diff
changeset
|
40 |
cd po |
ceb700bc4a80
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
31
diff
changeset
|
41 |
for po in $(ls -1 *.po); do |
ceb700bc4a80
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
31
diff
changeset
|
42 |
lang=$(basename ${po} .po) |
ceb700bc4a80
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
31
diff
changeset
|
43 |
ddir=${LOCALE_DIR}/${lang}/LC_MESSAGES |
ceb700bc4a80
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
31
diff
changeset
|
44 |
[ -d ${ddir} ] || mkdir -m 0755 -p ${ddir} |
ceb700bc4a80
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
31
diff
changeset
|
45 |
msgfmt -o ${LOCALE_DIR}/${lang}/LC_MESSAGES/vmm.mo ${po} |
ceb700bc4a80
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
31
diff
changeset
|
46 |
done |
37
89f952b0f366
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
32
diff
changeset
|
47 |
cd - >/dev/null |
89f952b0f366
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
32
diff
changeset
|
48 |
|
89f952b0f366
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
32
diff
changeset
|
49 |
cd man |
89f952b0f366
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
32
diff
changeset
|
50 |
[ -d ${MANDIR}/man1 ] || mkdir -m 0755 -p ${MANDIR}/man1 |
89f952b0f366
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
32
diff
changeset
|
51 |
install -m 0644 ${INSTALL_OPTS} man1/vmm.1 ${MANDIR}/man1 |
89f952b0f366
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
32
diff
changeset
|
52 |
|
89f952b0f366
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
32
diff
changeset
|
53 |
[ -d ${MANDIR}/man5 ] || mkdir -m 0755 -p ${MANDIR}/man5 |
89f952b0f366
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
32
diff
changeset
|
54 |
install -m 0644 ${INSTALL_OPTS} man5/vmm.cfg.5 ${MANDIR}/man5 |
89f952b0f366
* 'install.sh'
Pascal Volk <neverseen@users.sourceforge.net>
parents:
32
diff
changeset
|
55 |
cd - >/dev/null |
24 | 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 |
|
159
78b6b06188d3
Moved Postfix PostgreSQL client configuration files into the postfix directory.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
102
diff
changeset
|
63 |
install -m 0644 ${INSTALL_OPTS} postfix/pgsql-*.cf ${DOC_DIR}/examples |
4 | 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 |