| 1 |
#! /bin/sh |
| 2 |
# -*- Mode: Sh -*- |
| 3 |
# postinst --- |
| 4 |
# Author : Manoj Srivastava ( [email protected] ) |
| 5 |
# Created On : Fri Nov 14 11:25:07 2003 |
| 6 |
# Created On Node : glaurung.green-gryphon.com |
| 7 |
# Last Modified By : Manoj Srivastava |
| 8 |
# Last Modified On : Thu Dec 4 02:35:13 2003 |
| 9 |
# Last Machine Used: glaurung.green-gryphon.com |
| 10 |
# Update Count : 14 |
| 11 |
# Status : Unknown, Use with caution! |
| 12 |
# HISTORY : |
| 13 |
# Description : |
| 14 |
# |
| 15 |
# arch-tag: b5b8f5a7-813f-494e-8aa0-f51e8986f9ee |
| 16 |
# |
| 17 |
# This program is free software; you can redistribute it and/or modify |
| 18 |
# it under the terms of the GNU General Public License as published by |
| 19 |
# the Free Software Foundation; either version 2 of the License, or |
| 20 |
# (at your option) any later version. |
| 21 |
# |
| 22 |
# This program is distributed in the hope that it will be useful, |
| 23 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 24 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 25 |
# GNU General Public License for more details. |
| 26 |
# |
| 27 |
# You should have received a copy of the GNU General Public License |
| 28 |
# along with this program; if not, write to the Free Software |
| 29 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 30 |
# |
| 31 |
# |
| 32 |
|
| 33 |
# Abort if any command returns an error value |
| 34 |
set -e |
| 35 |
|
| 36 |
package_name=flex-doc |
| 37 |
|
| 38 |
if [ -z "$package_name" ]; then |
| 39 |
print >&2 "Internal Error. Please report a bug." |
| 40 |
exit 1; |
| 41 |
fi |
| 42 |
|
| 43 |
# This script is called as the last step of the installation of the |
| 44 |
# package. All the package's files are in place, dpkg has already done |
| 45 |
# its automatic conffile handling, and all the packages we depend of |
| 46 |
# are already fully installed and configured. |
| 47 |
# summary of how this script can be called: |
| 48 |
# * <postinst> `configure' <most-recently-configured-version> |
| 49 |
# * <old-postinst> `abort-upgrade' <new version> |
| 50 |
# * <conflictor's-postinst> `abort-remove' `in-favour' <package> |
| 51 |
# <new-version> |
| 52 |
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' |
| 53 |
# <failed-install-package> <version> `removing' |
| 54 |
# <conflicting-package> <version> |
| 55 |
# for details, see http://www.debian.org/doc/debian-policy/ or |
| 56 |
# the debian-policy package |
| 57 |
# |
| 58 |
# quoting from the policy: |
| 59 |
# Any necessary prompting should almost always be confined to the |
| 60 |
# post-installation script, and should be protected with a conditional |
| 61 |
# so that unnecessary prompting doesn't happen if a package's |
| 62 |
# installation fails and the `postinst' is called with `abort-upgrade', |
| 63 |
# `abort-remove' or `abort-deconfigure'. |
| 64 |
|
| 65 |
# The following idempotent stuff doesn't generally need protecting |
| 66 |
# against being run in the abort-* cases. |
| 67 |
|
| 68 |
# Create stub directories under /usr/local |
| 69 |
##: if test ! -d /usr/local/lib/${package_name}; then |
| 70 |
##: if test ! -d /usr/local/lib; then |
| 71 |
##: if mkdir /usr/local/lib; then |
| 72 |
##: chown root.staff /usr/local/lib || true |
| 73 |
##: chmod 2775 /usr/local/lib || true |
| 74 |
##: fi |
| 75 |
##: fi |
| 76 |
##: if mkdir /usr/local/lib/${package_name}; then |
| 77 |
##: chown root.staff /usr/local/lib/${package_name} || true |
| 78 |
##: chmod 2775 /usr/local/lib/${package_name} || true |
| 79 |
##: fi |
| 80 |
##: fi |
| 81 |
|
| 82 |
# Ensure the menu system is updated |
| 83 |
## [ ! -x /usr/bin/update-menus ] || /usr/bin/update-menus |
| 84 |
|
| 85 |
# Arrange for a daemon to be started at system boot time |
| 86 |
##: update-rc.d ${package_name} default >/dev/null |
| 87 |
|
| 88 |
case "$1" in |
| 89 |
configure) |
| 90 |
# Configure this package. If the package must prompt the user for |
| 91 |
# information, do it here. |
| 92 |
# Install emacs lisp files |
| 93 |
##:if [ -x /usr/lib/emacsen-common/emacs-package-install ]; then |
| 94 |
##: /usr/lib/emacsen-common/emacs-package-install $package_name |
| 95 |
##:fi |
| 96 |
|
| 97 |
|
| 98 |
# Activate menu-methods script |
| 99 |
##: chmod a+x /etc/menu-methods/${package_name} |
| 100 |
|
| 101 |
# Update ld.so cache |
| 102 |
##: ldconfig |
| 103 |
|
| 104 |
# Make our version of a program available |
| 105 |
##: update-alternatives \ |
| 106 |
##: --install /usr/bin/program program /usr/bin/alternative 50 \ |
| 107 |
##: --slave /usr/man/man1/program.1.gz program.1.gz \ |
| 108 |
##: /usr/man/man1/alternative.1.gz |
| 109 |
|
| 110 |
# Tell ucf that the file in /usr/share/foo is the latest |
| 111 |
# maintainer version, and let it handle how to manage the real |
| 112 |
# confuguration file in /etc. This is how a static configuration |
| 113 |
# file can be handled: |
| 114 |
##:if which ucf >/dev/null 2>&1; then |
| 115 |
##: ucf /usr/share/${package_name}/configuration /etc/${package_name}.conf |
| 116 |
##:fi |
| 117 |
|
| 118 |
### We could also do this on the fly. The following is from Tore |
| 119 |
### Anderson: |
| 120 |
|
| 121 |
#. /usr/share/debconf/confmodule |
| 122 |
|
| 123 |
### find out what the user answered. |
| 124 |
# db_get foo/run_on_boot |
| 125 |
# run_on_boot=$RET |
| 126 |
# db_stop |
| 127 |
|
| 128 |
### safely create a temporary file to generate our suggested |
| 129 |
### configuration file. |
| 130 |
# tempfile=`tempfile` |
| 131 |
# cat << _eof > $tempfile |
| 132 |
### Configuration file for Foo. |
| 133 |
|
| 134 |
### this was answered by you, the user in a debconf dialogue |
| 135 |
# RUNONBOOT=$run_on_boot |
| 136 |
|
| 137 |
### this was not, as it has a sane default value. |
| 138 |
# COLOUROFSKY=blue |
| 139 |
|
| 140 |
#_eof |
| 141 |
|
| 142 |
### Note that some versions of debconf do not release stdin, so |
| 143 |
### the following invocation of ucf may not work, since the stdin |
| 144 |
### is never coneected to ucfr. |
| 145 |
|
| 146 |
### now, invoke ucf, which will take care of the rest, and ask |
| 147 |
### the user if he wants to update his file, if it is modified. |
| 148 |
#ucf $tempfile /etc/foo.conf |
| 149 |
|
| 150 |
### done! now we'll just clear up our cruft. |
| 151 |
#rm -f $tempfile |
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
# There are three sub-cases: |
| 156 |
if test "${2+set}" != set; then |
| 157 |
# We're being installed by an ancient dpkg which doesn't remember |
| 158 |
# which version was most recently configured, or even whether |
| 159 |
# there is a most recently configured version. |
| 160 |
: |
| 161 |
|
| 162 |
elif test -z "$2" || test "$2" = "<unknown>"; then |
| 163 |
# The package has not ever been configured on this system, or was |
| 164 |
# purged since it was last configured. |
| 165 |
: |
| 166 |
|
| 167 |
else |
| 168 |
# Version $2 is the most recently configured version of this |
| 169 |
# package. |
| 170 |
: |
| 171 |
|
| 172 |
fi ;; |
| 173 |
abort-upgrade) |
| 174 |
# Back out of an attempt to upgrade this package FROM THIS VERSION |
| 175 |
# to version $2. Undo the effects of "prerm upgrade $2". |
| 176 |
: |
| 177 |
|
| 178 |
;; |
| 179 |
abort-remove) |
| 180 |
if test "$2" != in-favour; then |
| 181 |
echo "$0: undocumented call to \`postinst $*'" 1>&2 |
| 182 |
exit 0 |
| 183 |
fi |
| 184 |
# Back out of an attempt to remove this package, which was due to |
| 185 |
# a conflict with package $3 (version $4). Undo the effects of |
| 186 |
# "prerm remove in-favour $3 $4". |
| 187 |
: |
| 188 |
|
| 189 |
;; |
| 190 |
abort-deconfigure) |
| 191 |
if test "$2" != in-favour || test "$5" != removing; then |
| 192 |
echo "$0: undocumented call to \`postinst $*'" 1>&2 |
| 193 |
exit 0 |
| 194 |
fi |
| 195 |
# Back out of an attempt to deconfigure this package, which was |
| 196 |
# due to package $6 (version $7) which we depend on being removed |
| 197 |
# to make way for package $3 (version $4). Undo the effects of |
| 198 |
# "prerm deconfigure in-favour $3 $4 removing $6 $7". |
| 199 |
: |
| 200 |
|
| 201 |
;; |
| 202 |
*) echo "$0: didn't understand being called with \`$1'" 1>&2 |
| 203 |
exit 0;; |
| 204 |
esac |
| 205 |
|
| 206 |
#DEBHELPER# |
| 207 |
|
| 208 |
exit 0 |