Subversion Repositories

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

Rev 98 | 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 () {
114 holmgren 34
    # Unfortunately we more or less have to delete all .o files and
35
    # redump everything, because although master.pike won't use a .o
36
    # file that is older than its corresponding source, modules often
37
    # contain compile-time conditionals like
38
    #
39
    #   #if constant(Mysql.mysql)
40
    #
41
    # If the Mysql module is not installed, the code inside that
42
    # conditional block will not be compiled, and the referring module
43
    # won't be detected as out-of-date if the Mysql module is later
44
    # installed.
45
    find /usr/lib/$PIKEBIN -name '*.o' -delete
46
    $PIKEBIN -x dump --distquiet -r /usr/lib/$PIKEBIN
87 holmgren 47
}
48
 
2 magnus 49
case "$1" in
50
    configure)
43 magnus 51
    update-alternatives --install /usr/bin/pike pike /usr/bin/${PIKEBIN} 12 \
2 magnus 52
    --slave /usr/share/man/man1/pike.1.gz pike.1.gz /usr/share/man/man1/${PIKEBIN}.1.gz
53
    #
54
    # If the creation fails, so be it, user might have the filesystem mounted r/o
55
    #
56
    for d in $LOCAL_DIRS; do
57
        if [ ! -d /usr/local/$d ]; then
58
            install -d -m 755 -o root -g root /usr/local/$d || true
59
        fi
60
    done
87 holmgren 61
 
62
    update_modules
2 magnus 63
    ;;
64
 
65
    abort-upgrade|abort-remove|abort-deconfigure)
66
 
67
    ;;
68
 
87 holmgren 69
    triggered)
97 holmgren 70
	update_modules
90 holmgren 71
    ;;
87 holmgren 72
 
2 magnus 73
    *)
74
        echo "postinst called with unknown argument \`$1'" >&2
75
        exit 1
76
    ;;
77
esac
78
 
79
# dh_installdeb will replace this with shell code automatically
80
# generated by other debhelper scripts.
81
 
82
#DEBHELPER#
83
 
84
exit 0