*** empty log message ***
[mmondor.git] / mmsoftware / mmmail / install.sh
CommitLineData
47071c2b 1#!/bin/sh
5eb34fba
MM
2# $Id: install.sh,v 1.2 2003/01/01 14:54:11 mmondor Exp $
3
4if [ "$1" = "help" ]; then
5 echo
6 echo 'You can optionally set the following environment variables'
7 echo 'to customize the installation process. For each is shown an'
8 echo 'example using the default value followed by a breif description.'
9 echo
10 echo 'export MMLAUNCH="FALSE"'
11 echo ' Tells the install process to not immediately launch the'
12 echo ' daemon(s). They are automatically killed before the binaries'
13 echo ' are copied over the old ones as is necessary with some'
14 echo ' systems (i.e. Linux). The default is to also start'
15 echo ' them back. Especially useful with -DNODETACH.'
16 echo
17 echo 'export MMPREFIX="/usr/local"'
18 echo ' Allows to set the installation base directory. All files but'
19 echo ' configuration ones will be installed in directories relative'
20 echo ' to this one.'
21 echo
22 echo 'export MMCONFDIR="/etc"'
23 echo ' Directory in which configuration files should be stored.'
24 echo
25 echo 'export MMDEFAULTUSER="0"'
26 echo ' User new files and directories should be owned by, using'
27 echo ' user id or name.'
28 echo
29 echo 'export MMDEFAULTGROUP="0"'
30 echo ' Group new files and directories should be under, using id'
31 echo ' or name.'
32 echo
33 echo 'export MMADMINGROUP="staff"'
34 echo ' The administrators group, these can for instance view and the'
35 echo ' rotate mmstat statistics and execute mmpasswd. Will be'
36 echo ' created automatically if necessary.'
37 echo
38 echo 'export MMSTATDIR="/var/mmstatd"'
39 echo ' The directory in which mmstatd will store the stats database'
40 echo ' and log files.'
41 echo
42 echo 'export MMSTATDUSER="mmstatd"'
43 echo ' The user mmstatd will run under, to be automatically created.'
44 echo
45 echo 'export MMSTATDGROUP="mmstat"'
46 echo ' Group the mmstatd user should be part of, automatically'
47 echo ' created.'
48 echo
49 echo 'export MMMAILUSER="mmmail"'
50 echo ' The user mmmail daemons should run under, will be created'
51 echo ' automatically if nonexisting.'
52 echo
53 echo 'export MMMAILGROUP="mmmail"'
54 echo ' Group the mmmail user should be part of. Created if needed.'
55 echo
56 exit
57fi
58
59# Set defaults if not set
60if [ -z "$MMLAUNCH" ]; then
61 export MMLAUNCH='TRUE'
62fi
63if [ -z "$MMPREFIX" ]; then
64 export MMPREFIX='/usr/local'
65fi
66if [ -z "$MMCONFDIR" ]; then
67 export MMCONFDIR='/etc'
68fi
69if [ -z "$MMDEFAULTUSER" ]; then
70 export MMDEFAULTUSER='0'
71fi
72if [ -z "$MMDEFAULTGROUP" ]; then
73 export MMDEFAULTGROUP='0'
74fi
75if [ -z "$MMADMINGROUP" ]; then
76 export MMADMINGROUP='staff'
77fi
78if [ -z "$MMSTATDIR" ]; then
79 export MMSTATDIR='/var/mmstatd'
80fi
81if [ -z "$MMSTATDUSER" ]; then
82 export MMSTATDUSER='mmstatd'
83fi
84if [ -z "$MMSTATDGROUP" ]; then
85 export MMSTATDGROUP='mmstat'
86fi
87if [ -z "$MMMAILUSER" ]; then
88 export MMMAILUSER='mmmail'
89fi
90if [ -z "$MMMAILGROUP" ]; then
91 export MMMAILGROUP='mmmail'
92fi
47071c2b
MM
93
94. ../mmlib/makefuncs.sh
95
5eb34fba 96instgroup $MMADMINGROUP
47071c2b
MM
97
98cd ../mmlib/
99instman mmfd.3 3
100instman mmlist.3 3
101instman mmstat.3 3
102cd ../
103
104cd mmpasswd/
5eb34fba 105instbin mmpasswd 750 $MMADMINGROUP
47071c2b
MM
106instman mmpasswd.8 8
107cd ../
108
109cd mmstatd/src/
5eb34fba 110instuser $MMSTATDUSER $MMSTATDGROUP
47071c2b
MM
111killbin mmstatd
112instbin mmstatd 700
5eb34fba 113instbin mmstat 750 $MMADMINGROUP
47071c2b
MM
114instman mmstat.8 8
115instman mmstatd.8 8
116instman mmstatd.conf.5 5
117cd ../etc/
5eb34fba
MM
118instconf mmstatd.conf 640 $MMSTATDGROUP
119instdir $MMSTATDIR 750 $MMSTATDUSER $MMSTATDGROUP
120if [ "$MMLAUNCH" = "TRUE" ]; then
121 startbin mmstatd $MMCONFDIR/mmstatd.conf
122fi
47071c2b
MM
123cd ../../
124
125cd mmmail/src/mmsmtpd/
5eb34fba 126instuser $MMMAILUSER $MMMAILGROUP
47071c2b
MM
127killbin mmsmtpd
128instbin mmsmtpd 700
129instman mmsmtpd.8 8
130instman mmsmtpd.conf.5 5
131cd ../mmpop3d
132killbin mmpop3d
133instbin mmpop3d 700
134instman mmpop3d.8 8
135instman mmpop3d.conf.5 5
136cd ../../etc
137instconf mmsmtpd.conf 600
138instconf mmpop3d.conf 600
5eb34fba
MM
139if [ "$MMLAUNCH" = "TRUE" ]; then
140 startbin mmsmtpd $MMCONFDIR/mmsmtpd.conf
141 startbin mmpop3d $MMCONFDIR/mmpop3d.conf
142fi
143cd ../src
47071c2b
MM
144instman mmmail.8 8
145cd ../../
146
147echo
148echo "*** Please read the following man pages ***"
149echo
5eb34fba
MM
150echo "mmstat(8), mmstatd(8), mmstatd.conf(5) mmpasswd(8)"
151echo "mmmail(8), mmsmtpd(8), mmsmtpd.conf(5), mmpop3d(8) mmpop3d.conf(5)"
47071c2b
MM
152echo "source auditors: mmstat(3), mmfd(3), mmlist(3)"
153echo
154echo "Thank you for using mmsoftware."
155echo