]> git.donarmstrong.com Git - debian/debian-policy.git/blob - debian/postinst.in
update standards version
[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 : Sat Oct 26 13:19:34 2002
9 # Last Machine Used: glaurung.green-gryphon.com
10 # Update Count     : 9
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" -o "$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     # FSSTND compatible symlinks
72     if [ -d /usr/doc -a ! -e /usr/doc/$PACKAGE \
73         -a -d /usr/share/doc/$PACKAGE ]; then
74             ln -sf ../share/doc/$PACKAGE /usr/doc/$PACKAGE
75     fi
76     ;;
77   abort-upgrade)
78     # Back out of an attempt to upgrade this package FROM THIS VERSION
79     # to version $2.  Undo the effects of "prerm upgrade $2".
80     :
81
82     ;;
83   abort-remove)
84     if test "$2" != in-favour; then
85       echo "$0: undocumented call to \`postinst $*'" 1>&2
86       exit 0
87     fi
88     # Back out of an attempt to remove this package, which was due to
89     # a conflict with package $3 (version $4).  Undo the effects of
90     # "prerm remove in-favour $3 $4".
91     :
92
93     ;;
94   abort-deconfigure)
95     if test "$2" != in-favour -o "$5" != removing; then
96       echo "$0: undocumented call to \`postinst $*'" 1>&2
97       exit 0
98     fi
99     # Back out of an attempt to deconfigure this package, which was
100     # due to package $6 (version $7) which we depend on being removed
101     # to make way for package $3 (version $4).  Undo the effects of
102     # "prerm deconfigure in-favour $3 $4 removing $6 $7".
103     :
104
105     ;;
106   *) echo "$0: didn't understand being called with \`$1'" 1>&2
107      exit 0;;
108 esac
109
110 exit 0