* Added in Wilfried Goesgens' debian/ build directory.
[citadel.git] / citadel / debian / citadel-client.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         gunzip -c  /usr/share/doc/citadel-client/examples/citadel.rc.gz> /tmp/citadel.rc
20         ucf /tmp/citadel.rc /etc/citadel/citadel.rc
21         rm -f /tmp/citadel.rc
22
23     ### We could also do this on the fly. The following is from Tore
24     ### Anderson:
25     
26     #. /usr/share/debconf/confmodule
27
28     ### find out what the user answered.
29     #  db_get foo/run_on_boot
30     #  run_on_boot=$RET
31     #  db_stop
32
33     ### safely create a temporary file to generate our suggested
34     ### configuration file.
35     #    tempfile=`tempfile`
36     #    cat << _eof > $tempfile
37     ### Configuration file for Foo.
38
39     ### this was answered by you, the user in a debconf dialogue
40     #  RUNONBOOT=$run_on_boot
41
42     ### this was not, as it has a sane default value.
43     #  COLOUROFSKY=blue
44
45     #_eof
46
47     ### Note that some versions of debconf do not release stdin, so
48     ### the following invocation of ucf may not work, since the stdin
49     ### is never coneected to ucfr.
50
51     ### now, invoke ucf, which will take care of the rest, and ask
52     ### the user if he wants to update his file, if it is modified.
53     #ucf $tempfile /etc/foo.conf
54
55     ### done! now we'll just clear up our cruft.
56     #rm -f $tempfile
57
58
59     #### There are three sub-cases:
60     ###if test "${2+set}" != set; then
61     ###  # We're being installed by an ancient dpkg which doesn't remember
62     ###  # which version was most recently configured, or even whether
63     ###  # there is a most recently configured version.
64     ###  :
65         ###
66     ###elif test -z "$2" -o "$2" = "<unknown>"; then
67     ###  # The package has not ever been configured on this system, or was
68     ###  # purged since it was last configured.
69     ###  :
70         ###
71     ###else
72     ###  # Version $2 is the most recently configured version of this
73     ###  # package.
74     ###  :
75         ###
76     ###fi 
77         ;;
78   abort-upgrade)
79     # Back out of an attempt to upgrade this package FROM THIS VERSION
80     # to version $2.  Undo the effects of "prerm upgrade $2".
81     :
82
83     ;;
84   abort-remove)
85     ###if test "$2" != in-favour; then
86     ###  echo "$0: undocumented call to \`postinst $*'" 1>&2
87     ###  exit 0
88     ###fi
89     #### Back out of an attempt to remove this package, which was due to
90     #### a conflict with package $3 (version $4).  Undo the effects of
91     #### "prerm remove in-favour $3 $4".
92     ###:
93
94     ;;
95   abort-deconfigure)
96     ###if test "$2" != in-favour -o "$5" != removing; then
97     ###  echo "$0: undocumented call to \`postinst $*'" 1>&2
98     ###  exit 0
99     ###fi
100     #### Back out of an attempt to deconfigure this package, which was
101     #### due to package $6 (version $7) which we depend on being removed
102     #### to make way for package $3 (version $4).  Undo the effects of
103     #### "prerm deconfigure in-favour $3 $4 removing $6 $7".
104     ###:
105
106     ;;
107   *) echo "$0: didn't understand being called with \`$1'" 1>&2
108      exit 0;;
109 esac
110
111 exit 0