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 17 17:00:35 2000
9 # Last Machine Used: glaurung.green-gryphon.com
11 # Status : Unknown, Use with caution!
18 # Abort if any command returns an error value
21 # This is filled in by debian/rules
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.
29 package_name=#PACKAGE#
31 if [ -z "package_name" ]; then
32 print >&2 "Internal Error. Please report a bug."
36 #perl -e 'print readlink("/usr/doc/'$package_name'"), "\n"; '
39 # Configure this package. If the package must prompt the user for
40 # information, do it here.
42 if [ -d /usr/doc ]; then
43 # Well, we still need to handle this. At this point, /usr/doc
46 if [ -d /usr/share/doc/$package_name ]; then
47 # So the new doc dir exists, goody
49 # well, either one of these is a symlink, they can be
50 # pointing off _anywhere_
52 target_dir=$(/bin/pwd);
54 starget_dir=$(/bin/pwd);
57 link_target="../share/doc/$package_name";
59 if [ -d ../share/doc/ ]; then
62 if [ "$starget_dir" = "$ltarget" ]; then
63 link_target="../share/doc/$package_name";
65 link_target="/usr/share/doc/$package_name";
68 link_target="/usr/share/doc/$package_name"
72 # Well, make sure that we do not get tripped up by the symlink
73 if [ -L /usr/doc/$package_name ]; then
74 rm -f /usr/doc/$package_name
77 if [ "$target_dir" != "$starget_dir" ]; then
78 # Ok. The directories are in different locations
79 if [ -d /usr/doc/$package_name ]; then
80 echo "Yikes! The old directory, /usr/doc/$package_name,"
81 echo "has not ben removed! This is an error; attempting"
83 find /usr/doc/$package_name/ -type f -name .dhelp \
85 find /usr/doc/$package_name/ -type d -depth \
86 -exec rmdir --ignore-fail-on-non-empty {} \;
88 if [ -d /usr/doc/$package_name ]; then
90 Failed repairs. There are old files in /usr/doc/$package_name/ created
91 by you or another script. I can copy them over to the new location
92 /usr/share/doc/$package_name, if you wish, preserving your versions of
93 the files. No files shall be over written, instead, backup versions
94 shall be created in /usr/share/doc/$package_name as needed.
96 Shall I copy the files over [Yn]?
101 echo "Not copying over, aborting";
105 cp -a --backup=t /usr/doc/$package_name \
106 /usr/share/doc/$package_name/.. ;
107 rm -rf /usr/doc/$package_name;
112 if [ -e /usr/doc/$package_name ]; then
113 echo "/usr/doc/$package_name still exists"
114 if [ -L /usr/doc/$package_name ]; then
115 echo "it is a symbolic link, overwriting"
116 ln -sf $link_target /usr/doc/$package_name
118 echo "This is an error. Aborting"
122 # File unexists. Free to go ahead and create link
123 ln -sf $link_target /usr/doc/$package_name
130 if [ -x /usr/sbin/install-docs ]; then
131 /usr/sbin/install-docs -i /usr/share/doc-base/debian-policy
132 /usr/sbin/install-docs -i /usr/share/doc-base/debian-menu-policy
133 /usr/sbin/install-docs -i /usr/share/doc-base/debian-mime-policy
134 /usr/sbin/install-docs -i /usr/share/doc-base/debian-perl-policy
135 /usr/sbin/install-docs -i /usr/share/doc-base/debian-policy-process
136 /usr/sbin/install-docs -i /usr/share/doc-base/debconf-spec
137 /usr/sbin/install-docs -i /usr/share/doc-base/fhs
140 # There are three sub-cases:
141 if test "${2+set}" != set; then
142 # We're being installed by an ancient dpkg which doesn't remember
143 # which version was most recently configured, or even whether
144 # there is a most recently configured version.
147 elif test -z "$2" -o "$2" = "<unknown>"; then
148 # The package has not ever been configured on this system, or was
149 # purged since it was last configured.
153 # Version $2 is the most recently configured version of this
159 # FSSTND compatible symlinks
160 if [ -d /usr/doc -a ! -e /usr/doc/$PACKAGE \
161 -a -d /usr/share/doc/$PACKAGE ]; then
162 ln -sf ../share/doc/$PACKAGE /usr/doc/$PACKAGE
166 # Back out of an attempt to upgrade this package FROM THIS VERSION
167 # to version $2. Undo the effects of "prerm upgrade $2".
172 if test "$2" != in-favour; then
173 echo "$0: undocumented call to \`postinst $*'" 1>&2
176 # Back out of an attempt to remove this package, which was due to
177 # a conflict with package $3 (version $4). Undo the effects of
178 # "prerm remove in-favour $3 $4".
183 if test "$2" != in-favour -o "$5" != removing; then
184 echo "$0: undocumented call to \`postinst $*'" 1>&2
187 # Back out of an attempt to deconfigure this package, which was
188 # due to package $6 (version $7) which we depend on being removed
189 # to make way for package $3 (version $4). Undo the effects of
190 # "prerm deconfigure in-favour $3 $4 removing $6 $7".
194 *) echo "$0: didn't understand being called with \`$1'" 1>&2