076d3df76c71b95943852852900e3fa40e2baa34
[citadel.git] / citadel / debian / citadel-mta.postinst
1 #! /bin/sh
2 # postinst.skeleton
3 # Skeleton maintainer script showing all the possible cases.
4 # Written by Charles Briscoe-Smith, March-June 1998.  Public Domain.
5
6 # Abort if any command returns an error value
7 set -e
8
9 # This script is called as the last step of the installation of the
10 # package.  All the package's files are in place, dpkg has already done
11 # its automatic conffile handling, and all the packages we depend of
12 # are already fully installed and configured.
13
14 case "$1" in
15   configure)
16     # Configure this package.  If the package must prompt the user for
17     # information, do it here.
18         :
19         
20         #ln -s /usr/sbin/citmail /usr/sbin/sendmail
21
22         chown root:citadel /usr/sbin/sendmail
23         chmod 04755 /usr/sbin/sendmail
24     ### We could also do this on the fly. The following is from Tore
25     ### Anderson:
26     
27     #. /usr/share/debconf/confmodule
28
29     ### find out what the user answered.
30     #  db_get foo/run_on_boot
31     #  run_on_boot=$RET
32     #  db_stop
33
34     ### safely create a temporary file to generate our suggested
35     ### configuration file.
36     #    tempfile=`tempfile`
37     #    cat << _eof > $tempfile
38     ### Configuration file for Foo.
39
40     ### this was answered by you, the user in a debconf dialogue
41     #  RUNONBOOT=$run_on_boot
42
43     ### this was not, as it has a sane default value.
44     #  COLOUROFSKY=blue
45
46     #_eof
47
48     ### Note that some versions of debconf do not release stdin, so
49     ### the following invocation of ucf may not work, since the stdin
50     ### is never coneected to ucfr.
51
52     ### now, invoke ucf, which will take care of the rest, and ask
53     ### the user if he wants to update his file, if it is modified.
54     #ucf $tempfile /etc/foo.conf
55
56     ### done! now we'll just clear up our cruft.
57     #rm -f $tempfile
58
59
60     #### There are three sub-cases:
61     ###if test "${2+set}" != set; then
62     ###  # We're being installed by an ancient dpkg which doesn't remember
63     ###  # which version was most recently configured, or even whether
64     ###  # there is a most recently configured version.
65     ###  :
66         ###
67     ###elif test -z "$2" -o "$2" = "<unknown>"; then
68     ###  # The package has not ever been configured on this system, or was
69     ###  # purged since it was last configured.
70     ###  :
71         ###
72     ###else
73     ###  # Version $2 is the most recently configured version of this
74     ###  # package.
75     ###  :
76         ###
77     ###fi 
78         ;;
79   abort-upgrade)
80     # Back out of an attempt to upgrade this package FROM THIS VERSION
81     # to version $2.  Undo the effects of "prerm upgrade $2".
82     :
83
84     ;;
85   abort-remove)
86     ###if test "$2" != in-favour; then
87     ###  echo "$0: undocumented call to \`postinst $*'" 1>&2
88     ###  exit 0
89     ###fi
90     #### Back out of an attempt to remove this package, which was due to
91     #### a conflict with package $3 (version $4).  Undo the effects of
92     #### "prerm remove in-favour $3 $4".
93     ###:
94
95     ;;
96   abort-deconfigure)
97     ###if test "$2" != in-favour -o "$5" != removing; then
98     ###  echo "$0: undocumented call to \`postinst $*'" 1>&2
99     ###  exit 0
100     ###fi
101     #### Back out of an attempt to deconfigure this package, which was
102     #### due to package $6 (version $7) which we depend on being removed
103     #### to make way for package $3 (version $4).  Undo the effects of
104     #### "prerm deconfigure in-favour $3 $4 removing $6 $7".
105     ###:
106
107     ;;
108   *) echo "$0: didn't understand being called with \`$1'" 1>&2
109      exit 0;;
110 esac
111
112 exit 0