Debian Codegraph @

debian/flex.postinst

raw
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:36:10 2003
9 # Last Machine Used: glaurung.green-gryphon.com
10 # Update Count : 13
11 # Status : Unknown, Use with caution!
12 # HISTORY :
13 # Description :
14 #
15 # arch-tag: 5401e9ef-39cc-4aee-96a4-61dfb8f32cf7
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
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 # This package uses debconf to ask a question, so source the debconf
89 # confmodule as early as possible. However, it does not depend on debconf,
90 # so debconf may not be installed.
91 #################################################
92 # if [ -e /usr/share/debconf/confmodule ]; then #
93 # . /usr/share/debconf/confmodule #
94 # db_capb #
95 # fi #
96 #################################################
97
98 case "$1" in
99 configure)
100 # Configure this package. If the package must prompt the user for
101 # information, do it here.
102 # Install emacs lisp files
103 ##:if [ -x /usr/lib/emacsen-common/emacs-package-install ]; then
104 ##: /usr/lib/emacsen-common/emacs-package-install $package_name
105 ##:fi
106
107
108 # Activate menu-methods script
109 ##: chmod a+x /etc/menu-methods/${package_name}
110
111 # Update ld.so cache
112 ##: ldconfig
113
114 # Make our version of a program available
115 ##: update-alternatives \
116 ##: --install /usr/bin/program program /usr/bin/alternative 50 \
117 ##: --slave /usr/man/man1/program.1.gz program.1.gz \
118 ##: /usr/man/man1/alternative.1.gz
119
120 # Tell ucf that the file in /usr/share/foo is the latest
121 # maintainer version, and let it handle how to manage the real
122 # confuguration file in /etc. This is how a static configuration
123 # file can be handled:
124 ##:if which ucf >/dev/null 2>&1; then
125 ##: ucf /usr/share/${package_name}/configuration /etc/${package_name}.conf
126 ##:fi
127
128 ### We could also do this on the fly. The following is from Tore
129 ### Anderson:
130
131 #. /usr/share/debconf/confmodule
132
133 ### find out what the user answered.
134 # db_get foo/run_on_boot
135 # run_on_boot=$RET
136 # db_stop
137
138 ### safely create a temporary file to generate our suggested
139 ### configuration file.
140 # tempfile=`tempfile`
141 # cat << _eof > $tempfile
142 ### Configuration file for Foo.
143
144 ### this was answered by you, the user in a debconf dialogue
145 # RUNONBOOT=$run_on_boot
146
147 ### this was not, as it has a sane default value.
148 # COLOUROFSKY=blue
149
150 #_eof
151
152 ### Note that some versions of debconf do not release stdin, so
153 ### the following invocation of ucf may not work, since the stdin
154 ### is never coneected to ucfr.
155
156 ### now, invoke ucf, which will take care of the rest, and ask
157 ### the user if he wants to update his file, if it is modified.
158 #ucf $tempfile /etc/foo.conf
159
160 ### done! now we'll just clear up our cruft.
161 #rm -f $tempfile
162
163
164
165 # There are three sub-cases:
166 if test "${2+set}" != set; then
167 # We're being installed by an ancient dpkg which doesn't remember
168 # which version was most recently configured, or even whether
169 # there is a most recently configured version.
170 :
171
172 elif test -z "$2" || test "$2" = "<unknown>"; then
173 # The package has not ever been configured on this system, or was
174 # purged since it was last configured.
175 :
176
177 else
178 # Version $2 is the most recently configured version of this
179 # package.
180 :
181
182 fi ;;
183 abort-upgrade)
184 # Back out of an attempt to upgrade this package FROM THIS VERSION
185 # to version $2. Undo the effects of "prerm upgrade $2".
186 :
187
188 ;;
189 abort-remove)
190 if test "$2" != in-favour; then
191 echo "$0: undocumented call to \`postinst $*'" 1>&2
192 exit 0
193 fi
194 # Back out of an attempt to remove this package, which was due to
195 # a conflict with package $3 (version $4). Undo the effects of
196 # "prerm remove in-favour $3 $4".
197 :
198
199 ;;
200 abort-deconfigure)
201 if test "$2" != in-favour || test "$5" != removing; then
202 echo "$0: undocumented call to \`postinst $*'" 1>&2
203 exit 0
204 fi
205 # Back out of an attempt to deconfigure this package, which was
206 # due to package $6 (version $7) which we depend on being removed
207 # to make way for package $3 (version $4). Undo the effects of
208 # "prerm deconfigure in-favour $3 $4 removing $6 $7".
209 :
210
211 ;;
212 *) echo "$0: didn't understand being called with \`$1'" 1>&2
213 exit 0;;
214 esac
215
216 # Install doc base documentation
217 ##:if which install-docs >/dev/null 2>&1; then
218 ##: if [ -e /usr/share/doc-base/${package_name} ]; then
219 ##: install-docs -i /usr/share/doc-base/${package_name}
220 ##: fi
221 ##:fi
222
223 #DEBHELPER#
224
225
226 exit 0