]> git.donarmstrong.com Git - debian/debian-policy.git/blob - debian/postinst.in
Julian's versions
[debian/debian-policy.git] / debian / postinst.in
1 #!/bin/sh
2 #                               -*- Mode: Sh -*- 
3 # postinst --- 
4 # Author           : Manoj Srivastava ( srivasta@tiamat.datasync.com ) 
5 # Created On       : Thu Oct 29 15:23:36 1998
6 # Created On Node  : tiamat.datasync.com
7 # Last Modified By : Manoj Srivastava
8 # Last Modified On : Thu Oct 29 15:28:24 1998
9 # Last Machine Used: tiamat.datasync.com
10 # Update Count     : 3
11 # Status           : Unknown, Use with caution!
12 # HISTORY          : 
13 # Description      : 
14
15
16
17
18 # Abort if any command returns an error value
19 set -e
20
21 # This is filled in by debian/rules
22 PACKAGE=#PACKAGE#
23
24 # This script is called as the last step of the installation of the
25 # package.  All the package's files are in place, dpkg has already done
26 # its automatic conffile handling, and all the packages we depend of
27 # are already fully installed and configured.
28
29
30 case "$1" in
31   configure)
32     # Configure this package.  If the package must prompt the user for
33     # information, do it here.
34     :
35
36     if [ -x /usr/sbin/install-docs ]; then
37         /usr/sbin/install-docs -i /usr/share/doc-base/$PACKAGE
38     fi
39
40     # There are three sub-cases:
41     if test "${2+set}" != set; then
42       # We're being installed by an ancient dpkg which doesn't remember
43       # which version was most recently configured, or even whether
44       # there is a most recently configured version.
45       :
46
47     elif test -z "$2" -o "$2" = "<unknown>"; then
48       # The package has not ever been configured on this system, or was
49       # purged since it was last configured.
50       :
51
52     else
53       # Version $2 is the most recently configured version of this
54       # package.
55       :
56
57     fi
58
59     # FSSTND compatible symlinks
60     if [ -d /usr/doc -a ! -e /usr/doc/$PACKAGE \
61         -a -d /usr/share/doc/$PACKAGE ]; then
62             ln -sf ../share/doc/$PACKAGE /usr/doc/$PACKAGE
63     fi
64     ;;
65   abort-upgrade)
66     # Back out of an attempt to upgrade this package FROM THIS VERSION
67     # to version $2.  Undo the effects of "prerm upgrade $2".
68     :
69
70     ;;
71   abort-remove)
72     if test "$2" != in-favour; then
73       echo "$0: undocumented call to \`postinst $*'" 1>&2
74       exit 0
75     fi
76     # Back out of an attempt to remove this package, which was due to
77     # a conflict with package $3 (version $4).  Undo the effects of
78     # "prerm remove in-favour $3 $4".
79     :
80
81     ;;
82   abort-deconfigure)
83     if test "$2" != in-favour -o "$5" != removing; then
84       echo "$0: undocumented call to \`postinst $*'" 1>&2
85       exit 0
86     fi
87     # Back out of an attempt to deconfigure this package, which was
88     # due to package $6 (version $7) which we depend on being removed
89     # to make way for package $3 (version $4).  Undo the effects of
90     # "prerm deconfigure in-favour $3 $4 removing $6 $7".
91     :
92
93     ;;
94   *) echo "$0: didn't understand being called with \`$1'" 1>&2
95      exit 0;;
96 esac
97
98 exit 0