webcit_before_automake is now the trunk
[citadel.git] / webcit / debian / citadel-webcit.postrm
1 #! /bin/sh
2 # postrm.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 . /usr/share/debconf/confmodule
9
10 # This script is called twice during the removal of the package; once
11 # after the removal of the package's files from the system, and as
12 # the final step in the removal of this package, after the package's
13 # conffiles have been removed.
14
15 # Ensure the menu system is updated
16 : [ ! -x /usr/bin/update-menus ] || /usr/bin/update-menus
17
18 case "$1" in
19   remove)
20     # This package is being removed, but its configuration has not yet
21     # been purged.
22     # TODO:  remove from inittab.
23
24     # Remove diversion
25     #: dpkg-divert --package foo --remove --rename \
26     #:             --divert /usr/bin/other.real /usr/bin/other
27
28     # ldconfig is NOT needed during removal of a library, only during
29     # installation
30
31     ;;
32   purge)
33     # This package has previously been removed and is now having
34     # its configuration purged from the system.
35         # remove the gunzipped setup executable.
36     # we mimic dpkg as closely as possible, so we remove configuration
37     # files with dpkg backup extensions too:
38     ### Some of the following is from Tore Anderson:
39         if test -d /var/lib/citadel/www/static; then 
40                 cd /var/lib/citadel/www/static; for i in *; do 
41                         i=`echo $i|sed "s;.gz;;"`
42                         ucf --purge "/var/lib/citadel/www/static/$i"
43                         rm -f "/var/lib/citadel/www/static/$i"
44                 done
45         fi
46         #rmdir /var/lib/citadel/www/static
47         echo "/var/lib/citadel/www/keys not removed. "
48         db_purge 'citadel/WebcitHttpsPort'
49         db_purge 'citadel/WebcitHttpPort'
50         db_purge 'citade/WebcitInstallnote'
51         ### TODO: remove citadel from inittab!
52     ;;
53   disappear)
54     if test "$2" != overwriter; then
55       echo "$0: undocumented call to \`postrm $*'" 1>&2
56       exit 0
57     fi
58     # This package has been completely overwritten by package $3
59     # (version $4).  All our files are already gone from the system.
60     # This is a special case: neither "prerm remove" nor "postrm remove"
61     # have been called, because dpkg didn't know that this package would
62     # disappear until this stage.
63     :
64
65     ;;
66   upgrade)
67     # About to upgrade FROM THIS VERSION to version $2 of this package.
68     # "prerm upgrade" has been called for this version, and "preinst
69     # upgrade" has been called for the new version.  Last chance to
70     # clean up.
71     :
72
73     ;;
74   failed-upgrade)
75     # About to upgrade from version $2 of this package TO THIS VERSION.
76     # "prerm upgrade" has been called for the old version, and "preinst
77     # upgrade" has been called for this version.  This is only used if
78     # the previous version's "postrm upgrade" couldn't handle it and
79     # returned non-zero. (Fix old postrm bugs here.)
80     :
81
82     ;;
83   abort-install)
84     # Back out of an attempt to install this package.  Undo the effects of
85     # "preinst install...".  There are two sub-cases.
86     :
87
88     if test "${2+set}" = set; then
89       # When the install was attempted, version $2's configuration
90       # files were still on the system.  Undo the effects of "preinst
91       # install $2".
92       :
93
94     else
95       # We were being installed from scratch.  Undo the effects of
96       # "preinst install".
97       :
98
99     fi ;;
100   abort-upgrade)
101     # Back out of an attempt to upgrade this package from version $2
102     # TO THIS VERSION.  Undo the effects of "preinst upgrade $2".
103     :
104
105     ;;
106   *) echo "$0: didn't understand being called with \`$1'" 1>&2
107      exit 0;;
108 esac
109
110 exit 0