Subversion Repositories

?revision_form?Rev ?revision_input??revision_submit??revision_endform?

Rev 149 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 magnus 1
#! /bin/sh
198 holmgren 2
# postinst script for pike8.0
2 magnus 3
 
4
set -e
5
 
198 holmgren 6
PIKE=8.0
2 magnus 7
PIKEBIN=pike${PIKE}
8
 
9
# summary of how this script can be called:
10
#        * <postinst> `configure' <most-recently-configured-version>
11
#        * <old-postinst> `abort-upgrade' <new version>
12
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
13
#          <new-version>
14
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
15
#          <failed-install-package> <version> `removing'
16
#          <conflicting-package> <version>
17
# for details, see http://www.debian.org/doc/debian-policy/ or
18
# the debian-policy package
19
#
20
# quoting from the policy:
21
#     Any necessary prompting should almost always be confined to the
22
#     post-installation script, and should be protected with a conditional
23
#     so that unnecessary prompting doesn't happen if a package's
24
#     installation fails and the `postinst' is called with `abort-upgrade',
25
#     `abort-remove' or `abort-deconfigure'.
88 holmgren 26
LOCAL_DIRS="lib/pike${PIKE}/modules lib/pike${PIKE}/include"
2 magnus 27
 
87 holmgren 28
update_modules () {
114 holmgren 29
    # Unfortunately we more or less have to delete all .o files and
30
    # redump everything, because although master.pike won't use a .o
31
    # file that is older than its corresponding source, modules often
32
    # contain compile-time conditionals like
33
    #
34
    #   #if constant(Mysql.mysql)
35
    #
36
    # If the Mysql module is not installed, the code inside that
37
    # conditional block will not be compiled, and the referring module
38
    # won't be detected as out-of-date if the Mysql module is later
39
    # installed.
40
    find /usr/lib/$PIKEBIN -name '*.o' -delete
149 holmgren 41
    $PIKEBIN -x dump --distquiet -r /usr/lib/$PIKEBIN/modules /usr/lib/$PIKEBIN/?.?/modules
87 holmgren 42
}
43
 
2 magnus 44
case "$1" in
45
    configure)
198 holmgren 46
    update-alternatives --install /usr/bin/pike pike /usr/bin/${PIKEBIN} 14 \
2 magnus 47
    --slave /usr/share/man/man1/pike.1.gz pike.1.gz /usr/share/man/man1/${PIKEBIN}.1.gz
48
    #
49
    # If the creation fails, so be it, user might have the filesystem mounted r/o
50
    #
51
    for d in $LOCAL_DIRS; do
52
        if [ ! -d /usr/local/$d ]; then
53
            install -d -m 755 -o root -g root /usr/local/$d || true
54
        fi
55
    done
87 holmgren 56
 
57
    update_modules
2 magnus 58
    ;;
59
 
60
    abort-upgrade|abort-remove|abort-deconfigure)
61
 
62
    ;;
63
 
87 holmgren 64
    triggered)
97 holmgren 65
	update_modules
90 holmgren 66
    ;;
87 holmgren 67
 
2 magnus 68
    *)
69
        echo "postinst called with unknown argument \`$1'" >&2
70
        exit 1
71
    ;;
72
esac
73
 
74
# dh_installdeb will replace this with shell code automatically
75
# generated by other debhelper scripts.
76
 
77
#DEBHELPER#
78
 
79
exit 0