Rev 97 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | magnus | 1 | #! /bin/sh |
41 | magnus | 2 | # postinst script for pike7.8 |
2 | magnus | 3 | # |
4 | # see: dh_installdeb(1) |
||
5 | # |
||
41 | magnus | 6 | # $Id: pike7.8-core.postinst,v 1.1 2006/01/17 22:37:48 grendel Exp $ |
2 | magnus | 7 | # |
8 | |||
9 | set -e |
||
10 | |||
41 | magnus | 11 | PIKE=7.8 |
2 | magnus | 12 | PIKEBIN=pike${PIKE} |
13 | |||
14 | # summary of how this script can be called: |
||
15 | # * <postinst> `configure' <most-recently-configured-version> |
||
16 | # * <old-postinst> `abort-upgrade' <new version> |
||
17 | # * <conflictor's-postinst> `abort-remove' `in-favour' <package> |
||
18 | # <new-version> |
||
19 | # * <deconfigured's-postinst> `abort-deconfigure' `in-favour' |
||
20 | # <failed-install-package> <version> `removing' |
||
21 | # <conflicting-package> <version> |
||
22 | # for details, see http://www.debian.org/doc/debian-policy/ or |
||
23 | # the debian-policy package |
||
24 | # |
||
25 | # quoting from the policy: |
||
26 | # Any necessary prompting should almost always be confined to the |
||
27 | # post-installation script, and should be protected with a conditional |
||
28 | # so that unnecessary prompting doesn't happen if a package's |
||
29 | # installation fails and the `postinst' is called with `abort-upgrade', |
||
30 | # `abort-remove' or `abort-deconfigure'. |
||
88 | holmgren | 31 | LOCAL_DIRS="lib/pike${PIKE}/modules lib/pike${PIKE}/include" |
2 | magnus | 32 | |
87 | holmgren | 33 | update_modules () { |
97 | holmgren | 34 | find /usr/lib/$PIKEBIN/modules -name '*.o' -delete |
35 | $PIKEBIN -x dump --distquiet -r /usr/lib/$PIKEBIN/modules |
||
87 | holmgren | 36 | } |
37 | |||
2 | magnus | 38 | case "$1" in |
39 | configure) |
||
43 | magnus | 40 | update-alternatives --install /usr/bin/pike pike /usr/bin/${PIKEBIN} 12 \ |
2 | magnus | 41 | --slave /usr/share/man/man1/pike.1.gz pike.1.gz /usr/share/man/man1/${PIKEBIN}.1.gz |
42 | # |
||
43 | # If the creation fails, so be it, user might have the filesystem mounted r/o |
||
44 | # |
||
45 | for d in $LOCAL_DIRS; do |
||
46 | if [ ! -d /usr/local/$d ]; then |
||
47 | install -d -m 755 -o root -g root /usr/local/$d || true |
||
48 | fi |
||
49 | done |
||
87 | holmgren | 50 | |
98 | holmgren | 51 | $PIKEBIN -x dump --distquiet /usr/lib/$PIKEBIN/master.pike |
87 | holmgren | 52 | update_modules |
2 | magnus | 53 | ;; |
54 | |||
55 | abort-upgrade|abort-remove|abort-deconfigure) |
||
56 | |||
57 | ;; |
||
58 | |||
87 | holmgren | 59 | triggered) |
97 | holmgren | 60 | update_modules |
90 | holmgren | 61 | ;; |
87 | holmgren | 62 | |
2 | magnus | 63 | *) |
64 | echo "postinst called with unknown argument \`$1'" >&2 |
||
65 | exit 1 |
||
66 | ;; |
||
67 | esac |
||
68 | |||
69 | # dh_installdeb will replace this with shell code automatically |
||
70 | # generated by other debhelper scripts. |
||
71 | |||
72 | #DEBHELPER# |
||
73 | |||
74 | exit 0 |