]> git.donarmstrong.com Git - debian/debian-policy.git/blob - debian/postinst.in
Sync with upstream
[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 : Fri Mar  7 13:32:56 2003
9 # Last Machine Used: glaurung.green-gryphon.com
10 # Update Count     : 10
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 package_name=#PACKAGE#
30
31 if [ -z "package_name" ]; then
32     print >&2 "Internal Error. Please report a bug."
33     exit 1;
34 fi
35
36 #perl -e 'print readlink("/usr/doc/'$package_name'"), "\n"; '
37 case "$1" in
38   configure)
39     # Configure this package.  If the package must prompt the user for
40     # information, do it here.
41
42     if [ -x /usr/sbin/install-docs ]; then
43         /usr/sbin/install-docs -i /usr/share/doc-base/debian-policy
44         /usr/sbin/install-docs -i /usr/share/doc-base/debian-menu-policy
45         /usr/sbin/install-docs -i /usr/share/doc-base/debian-mime-policy
46         /usr/sbin/install-docs -i /usr/share/doc-base/debian-perl-policy
47         /usr/sbin/install-docs -i /usr/share/doc-base/debian-policy-process
48         /usr/sbin/install-docs -i /usr/share/doc-base/debconf-spec
49         /usr/sbin/install-docs -i /usr/share/doc-base/fhs
50     fi
51
52     # There are three sub-cases:
53     if test "${2+set}" != set; then
54       # We're being installed by an ancient dpkg which doesn't remember
55       # which version was most recently configured, or even whether
56       # there is a most recently configured version.
57       :
58
59     elif test -z "$2" || test "$2" = "<unknown>"; then
60       # The package has not ever been configured on this system, or was
61       # purged since it was last configured.
62       :
63
64     else
65       # Version $2 is the most recently configured version of this
66       # package.
67       :
68
69     fi
70
71     
72     ;;
73   abort-upgrade)
74     # Back out of an attempt to upgrade this package FROM THIS VERSION
75     # to version $2.  Undo the effects of "prerm upgrade $2".
76     :
77
78     ;;
79   abort-remove)
80     if test "$2" != in-favour; then
81       echo "$0: undocumented call to \`postinst $*'" 1>&2
82       exit 0
83     fi
84     # Back out of an attempt to remove this package, which was due to
85     # a conflict with package $3 (version $4).  Undo the effects of
86     # "prerm remove in-favour $3 $4".
87     :
88
89     ;;
90   abort-deconfigure)
91     if test "$2" != in-favour || test "$5" != removing; then
92       echo "$0: undocumented call to \`postinst $*'" 1>&2
93       exit 0
94     fi
95     # Back out of an attempt to deconfigure this package, which was
96     # due to package $6 (version $7) which we depend on being removed
97     # to make way for package $3 (version $4).  Undo the effects of
98     # "prerm deconfigure in-favour $3 $4 removing $6 $7".
99     :
100
101     ;;
102   *) echo "$0: didn't understand being called with \`$1'" 1>&2
103      exit 0;;
104 esac
105
106 exit 0